Skip to content

NuPlay/SimpleImagePicker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

SimpleImagePicker

You don't have to get Photo Permission

iMac - 2

Swift: 5.1+ iOS: 14.0+

Code

import SwiftUI
import SimpleImagePicker

struct SimpleImagePickerTest: View {
    @State private var showImagePicker: Bool = false
    
    var body: some View {
        Button(action: {
            self.showImagePicker.toggle()
        }, label: {
                           Text("GetImage")
                       })
        .simpleImagePicker(showImagePicker: $showImagePicker) { result in
         // result == [UIImage]
            print(result)
        }
    }
}

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding SimpleImagePicker as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/NuPlay/SimpleImagePicker.git", .upToNextMajor(from: "1.0.0"))
]

More

import SwiftUI
import SimpleImagePicker

struct SimpleImagePickerTest: View {
    @State private var showImagePicker: Bool = false
    
    var body: some View {
        Button(action: {
            self.showImagePicker.toggle()
        }, label: {
                           Text("GetImage")
                       })
        .simpleImagePicker(showImagePicker: $showImagePicker, maxCount: 5, presentType: .sheet) { result in
         // result == [UIImage]
            print(result)
        }
    }
}
    

Parameter

Parameter Default
showImagePicker: Binding<Bool>
maxCount: Int 5(0 means Unlimited Photos)
presentType: ImagePickerPresentType(sheet, fullScreenCover) .sheet
result: @escaping ([UIImage]) -> Void

About

Get image without Photo Permission

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages