UIPresentationController initialisation

Originator:dieter.komendera
Number:rdar://22342203 Date Originated:19-Aug-2015 03:18 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.0
Classification:Enhancement Reproducible:Always
 
This is a duplicate of rdar://22269465

Summary:
UIPresentationController does not follow the designated initialiser pattern and is lax about checking arguments, resulting in exceptions happing later rather than immediately.

Steps to Reproduce:
Look at UIPresentationController.h and also try making a presentation controller with alloc & init.

Expected Results:
- initWithPresentedViewController:presentingViewController: to be marked with NS_DESIGNATED_INITIALIZER.
- UIPresentationController to override init and call initWithPresentedViewController:presentingViewController: (or raise an exception).
- The implementation of initWithPresentedViewController:presentingViewController: to raise an exception if either of the arguments are nil.

With these things in place, creating a presentation controller without the required parameters would raise an exception immediately.

Actual Results:
- initWithPresentedViewController:presentingViewController: is not marked with NS_DESIGNATED_INITIALIZER.
- UIPresentationController does not override init.
- The implementation of initWithPresentedViewController:presentingViewController: silently accepts nil arguments.

Creating a presentation controller without the required parameters results in an exception when presenting: trying to add nil to a set. See http://stackoverflow.com/questions/27198145/mysterious-crash-when-presenting-a-view-controller-using-a-custom-uipresentation

Version:
iOS 9.0, Xcode 7.0 beta 5 (7A176x)

Notes:


Configuration:
Simulator

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!