Nullable Attributes Have Changed to Nonnull in the iOS 10 SDK
| Originator: | paul | ||
| Number: | rdar://26800945 | Date Originated: | 6/14/2016 |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 10 beta 1 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Some properties changed from nullable to nonnull in UIKit from iOS 9 to iOS 10. Because there are no @available guards for optionality changes, how should these be handled? Are they safe to call for apps that target iOS 9, or does that implicitly unwrap an Optional? One such property that changed its nullability attributes is UIViewControllerContextTransitioning, which changed the return value of public func containerView() from UIView? to UIView. Steps to Reproduce: Write an object in Swift that conforms to UIViewControllerContextTransitioning with the iOS 9 SDK. Expected Results: Properties of the SDK that were once nullable would not become nonnull. Actual Results: Properties of the SDK that were once nullable are now nonnull. I’ve attached a sample project that demonstrates the confusion I have. Check out the classes AnimatedTransitioning.swift and OptionalityChangeWrapper.swift. Version: iOS SDK 10 beta 1 Notes: Configuration: iOS Simulator Attachments: 'OptionalityChangesTest.zip' was successfully uploaded.
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!
Sample Project
https://github.com/paulrehkugler/OptionalityChanges