To run the example project, clone the repo, and run pod install from the Example directory first.
ImagePickerService is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ImagePickerService'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)Easy... simply run the service with the parameter
useNativeScanner = trueSion Sasson, sion.sasson@melio.com
ImagePickerService is available under the MIT license. See the LICENSE file for more info.