ImagePickerSheetController
ImagePickerSheetController copied to clipboard
First button in actionSheet is animated with scale
Branch: fix-maximum-selection IOS: 11
Currently I faced the problem that the first button in the action-sheet is somehow animated with a scale transition if you present the ImagePickerSheetController which looks really weird.
This is my code which is from the example code:
let presentImagePickerController: (UIImagePickerControllerSourceType) -> () = { source in
let controller = UIImagePickerController()
controller.delegate = self
var sourceType = source
if (!UIImagePickerController.isSourceTypeAvailable(sourceType)) {
sourceType = .photoLibrary
}
controller.sourceType = sourceType
self.present(controller, animated: true, completion: nil)
}
let controller = ImagePickerSheetController(mediaType: .image)
controller.maximumSelection = 1
controller.addAction(ImagePickerAction(title: "Photo Library", secondaryTitle: "Add Selection", handler: { _ in
presentImagePickerController(.photoLibrary)
}, secondaryHandler: { _, numberOfPhotos in
}))
controller.addAction(ImagePickerAction(title: "Take Photo", handler: { _ in
presentImagePickerController(.camera)
}, secondaryHandler: { _, numberOfPhotos in
presentImagePickerController(.camera)
}))
controller.addAction(ImagePickerAction(cancelTitle: "Cancel"))
present(controller, animated: false, completion: nil)
As you can see I set animated to false cause this seems like the only solution for me. Does someone else have the problem or a solution for it?