Swift: UIApplication.setNewsstandIconImage() incorrectly set to Available in iOS 9.0, should be lower

Originator:mail
Number:rdar://23808479 Date Originated:12/8/2015
Status:Open Resolved:
Product:iOS SDK Product Version:9.1
Classification: Reproducible:Always
 
Summary:
UIApplication.setNewsstandIconImage() should be deprecated in iOS9 but it's also incorrectly marked @available(iOS 9,*) making it impossible to call in previous version of iOS where supported. ( 5 or 6 if I recall)

The result of this bug is that our users still on iOS 8 whom have upgraded to our new Newsstand application that no longer uses dynamic Newsstand icons are still seeing the last dynamic icon from our last version that supported the old behavior.

The workaround is to call out to Objective-C where this function is still correctly callable.

Steps to Reproduce:
Create a swift app
Set target to iOS 8 or lower
Try to call this code snippet

        if #available(iOS 9.0, *) {
          // Does nothing in iOS 9 since newsstand is gone.
        } else {
            // Clear any newsstand icons on iOS < 9.0
            UIApplication.sharedApplication().setNewsstandIconImage(nil)
       }

Expected Results:
Should be a valid call

Actual Results:
Compiler errors that the call is not available in SDK's lower than 9

Version:
iOS 9.1 Xcode 7.1.1

Notes:


Configuration:
iPhone 6+

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!