Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lorenzofiamingo/swiftui-photos-picker
https://github.com/lorenzofiamingo/swiftui-photos-picker
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lorenzofiamingo/swiftui-photos-picker
- Owner: lorenzofiamingo
- Created: 2022-02-25T16:00:30.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T13:07:47.000Z (9 months ago)
- Last Synced: 2024-10-29T19:52:57.269Z (2 months ago)
- Language: Swift
- Size: 11.7 KB
- Stars: 18
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SwiftUI PhotosPicker π
`PhotosPicker` is a photos picker sheet, based on `PHPickerViewController`. Currently supports only iOS and Mac Catalyst.
## Usage
`PhotosPicker` has similar API and behavior as other [Presentation Modifiers](https://developer.apple.com/documentation/swiftui/view-presentation).
```swift
import SwiftUI
import PhotosPickerstruct ContentView: View {
@State private var showingPicker = false
var body: some View {
Button("Choose image") {
showingPicker = true
}
.photosPicker(isPresented: $showingPicker) { photos in
if photos.count > 0 {
print("Selected \(photos)")
}
}
}
}
```## Installation
1. In Xcode, open your project and navigate to **File** β **Swift Packages** β **Add Package Dependency...**
2. Paste the repository URL (`https://github.com/lorenzofiamingo/swiftui-photos-picker`) and click **Next**.
3. Click **Finish**.## Other projects
[SwiftUI VariadicViews π₯](https://github.com/lorenzofiamingo/swiftui-variadic-views)
[SwiftUI AsyncButton π²οΈ](https://github.com/lorenzofiamingo/swiftui-async-button)
[SwiftUI MapItemPicker πΊοΈ](https://github.com/lorenzofiamingo/swiftui-map-item-picker)
[SwiftUI CachedAsyncImage ποΈ](https://github.com/lorenzofiamingo/swiftui-cached-async-image)
[SwiftUI VerticalTabView π](https://github.com/lorenzofiamingo/swiftui-vertical-tab-view)
[SwiftUI SharedObject π±](https://github.com/lorenzofiamingo/swiftui-shared-object)