Skip to content

me-public/ImagePickerService

Repository files navigation

ImagePickerService

Version License Platform MobSF UI Tests

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

ImagePickerService is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ImagePickerService'

How to use?

That's simple :)

//PermissionedViewController is a UIViewController that conforms to PermissionViewControllerProtocol
let permissionController: PermissionedViewController = ....
let presentingController: UIViewController = ....
let source: ImagePickerServiceSource = ... //Camera or library

ImagePickerService.runImagePickingService(withSource: source,
                                          permissionController: permissionController,
                                          fromController: presentingController)
.sink { completion in
    switch completion {
    case .failure(let error):
        //got an error - oh boy...
        break
    case .finished:
        //service is done with flying colors..
        break
    }
} receiveValue: { image in
    //User selected/scanned/took picture an image
}
.store(in: &anyCancellables)

Do you want to use the iOS native scanner?

Easy... simply run the service with the parameter

useNativeScanner = true

Author

Sion Sasson, sion.sasson@melio.com

License

ImagePickerService is available under the MIT license. See the LICENSE file for more info.

About

A delightful image picker service for iOS 13 and up - including scanning option

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors