ooper-shlab / HMCatalog-Swift3

An experimental conversion of Apple's sample code "HomeKit Catalog: Creating Homes, Pairing and Controlling Accessories, and Setting Up Triggers" in Swift 2.3 into Swift 5 (Sorry for the mismatching repository name, I thought Apple would release the new version before Swift 4 was out.)
Other
28 stars 14 forks source link

Specify location of the popover menu on iPad #6

Closed ghost closed 6 years ago

ghost commented 6 years ago

The sample project is a universal build, but doesn't work properly on iPad. When you press "Add Trigger" on iPad, the modal menu that displays just fine on iPhone causes a constraint-related exception. This is fixed by proper use of the popoverPresentationController, in this case by specifying sourceView and sourceRect.

ooper-shlab commented 6 years ago

Thanks for proposing fixes which I have not been aware of. In fact I lack some experience on iPad programming and your proposal really helped.