PKPaymentAuthorizationViewController.init(paymentRequest:) should be failable

Originator:DaNmarner
Number:rdar://28660713 Date Originated:10/6/2016
Status:Open Resolved:
Product:iOS Devices Product Version:iOS 10
Classification:Serious Bug Reproducible:Always
 
Summary:
PKPaymentAuthorizationViewController.init(paymentRequest:) returns nil when fails. This is not properly annotated for Swift. It’s not an failable initializer which means an unaware user can get crashes when the initialization fails.

Steps to Reproduce:
Use this init method when ApplePay is not supported in Swift


Expected Results:
Using this initializer in Swift should be safe by type.

Actual Results:
Using this initializer in Swift is dangerous.

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!