ImagePickerSheetController icon indicating copy to clipboard operation
ImagePickerSheetController copied to clipboard

First button in actionSheet is animated with scale

Open Yetispapa opened this issue 6 years ago • 0 comments

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?

Yetispapa avatar Nov 14 '17 11:11 Yetispapa