Skip to content

lorenzofiamingo/swiftui-photos-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.

import SwiftUI
import PhotosPicker

struct 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 πŸ₯ž

SwiftUI AsyncButton πŸ–²οΈ

SwiftUI MapItemPicker πŸ—ΊοΈ

SwiftUI CachedAsyncImage πŸ—ƒοΈ

SwiftUI VerticalTabView πŸ”

SwiftUI SharedObject 🍱

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages