photo-editor
photo-editor copied to clipboard
Crop function: crash on iPad when opening the "constrain" alert sheet
Using the photo editor on the iPad, it will crash when trying to open the "constrain" alert sheet (in crop mode), because it does not have a barButtonItem or sourceRect/sourceView set.
Name: NSGenericException, Reason: Your application has presented a UIAlertController (<UIAlertController: 0x103ca6400>) of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
Can be fixed by setting the appropriate barButtonItem in CropViewController.swift, before present
is called (around line 239):
actionSheet.popoverPresentationController?.barButtonItem = sender