CoreML Demo App crashing, sources not up to date

Demo "Classifying Images with Vision and Core ML" is crashing:

The demo app Classifying Images with Vision and Core ML has gone outdated, creating conversion effort to the newest swift version (with the convertor working incorrectly), but furthermore, the demo app crashes, raising this exception (right at the AppDelegate declaration):

Code Block
Thread 1: "Your application has presented a UIAlertController (<UIAlertController: 0x10901bc00>) of style UIAlertControllerStyleActionSheet from Vision_ML_Example.ImageClassificationViewController (<Vision_ML_Example.ImageClassificationViewController: 0x105f0c600>). 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."


Do you got any ideas on how to approach this error and how to address Apple to update the demo sources?

This is an entry-level demo, but doesn't really help if it is neither updated nor working alright.

Config:
  • Xcode Version 12.2 beta 3

  • Target: iPad Pro 11 2nd Gen / iOS 14.2

Replies

Change the alert type on ipad to avoid this or provide a source view as suggested by the exception description.
Code Block      
var alertStyle: UIAlertController.Style = .actionSheet
    if PhoneModelService.isIpad() {
     alertStyle = .alert
    }
    let alertController = UIAlertController(title: nil,
                        message: nil,
                        preferredStyle: alertStyle)