Rather than managing API notes directly in the Clang importer, tell
Clang where to find the API notes files and let it map them directly
to attributes. Then, use the existing attribute-mapping
mechanisms---with minor extensions for cases where Clang previously
didn't map some Swift-specific API notes---to get at that information.
There is a minor regression where we can no longer apply API notes to
declarations that don't have a specific Clang declaration. The
specific example (NSError's inherited init()) comes from
rdar://problem/21042412; we've regressed here, but the correct fix is
(and has always been) on the Objective-C side
(rdar://problem/19977891).
Finishes rdar://problem/24447420.
Like decodeTopLevelObjectOfClass(_:forKey:), this API works very nicely
as a generic method in Swift, and this one is actually the one we expect
to be commonly used. One thing to note here is that these methods are
stricter than their ObjC counterparts: they will do a forced checked cast
even when the unarchiver does not use "secure" coding.
This depends on the previous commit; without it, we do not actually
enforce type safety for these methods.
The API notes change is to make the non-generic version of this method
unavailable so that it does not participate in overload resolution.
Without this we prefer the non-generic method unless there's a contextual
type for the result. I've filed rdar://problem/22243198 to track taking
this out once Foundation has updated their headers.
rdar://problem/17060110 (again)
Swift SVN r31154
In iOS 9 and OS X 10.11 the old GameKit was effectively renamed GameCenter, while
the new GameKit is a sort of umbrella framework like Cocoa. We need to support
backwards deployment, though, so the GameCenter overlay links to GameKit.framework.
(This is essentially the same solution implemented for CoreImage moving out of
QuartzCore in r28449)
rdar://problem/21340738
Swift SVN r30322
Then use that to ban NSError.init(), because it doesn't create a valid
NSError. In the long run Foundation will hopefully add this to their
headers, but they can't yet (rdar://problem/19977891).
rdar://problem/21042412
Swift SVN r28881
<rdar://problem/17902944> UIView's motionEffects property should never return 'nil'
<rdar://problem/17971360> [factor-init] SKPhysicsJointPin's factory method is not converted to a Swift API initializer
<rdar://problem/18553910> #IUO UICollectionViewUpdateItem properties
<rdar://problem/18875692> NSEntityDescription subentities/subentitiesByName should be marked optional
<rdar://problem/18919879> Swift: NSTableView's preparedCellAtColumn(_:row:) should return an optional
<rdar://problem/18940072> NSPredicate's init(format:) should not be optional
<rdar://problem/18987481> NSURLRequest without NSURL crashes Swift
<rdar://problem/19034448> UIPrintInfo’s -init is banned, should use +printInfo
<rdar://problem/19147412> NSUserInterfaceItemIdentification declares identifier as a non-optional String and it should be optional or IUO
<rdar://problem/19347931> Declaration of a parameter in Cocoa API in Swift is wrong (NSDateFormatter)
+ additions to the WatchKit audit
+ additions to HealthKit and HomeKit.
Swift SVN r24630
Here, we mark the null_resettable properties as explicit "U".
Fixed UIColor and NSColor's initWithCGColor as returning an optional (radar://18420272)
Fixed fontDescriptorWithSymbolicTraits (rdar://problem/18812268)
Contains audit for NSXMLParserDelegate (rdar://problem/18227344)
+ a few other newly audited APIs
Swift SVN r23698
- Mark more initializers as non-optional.
<rdar://problem/18559511> Audit the list of UIKit symbols that marked as returning optional
<rdar://problem/18559660> Audit the list of AppKit symbols that marked as returning optional
<rdar://problem/18559676> Audit the list of Foundation symbols that marked as returning optional
<rdar://problem/18559730> Audit the list of Scenekit symbols that marked as returning optional
- NSMenu.popUpMenuPositioningItem (radar://18505688)
- Remove NSXMLParserDelegate audit since it leads to crashes (radar://18227344)
- UICollectionViewController collectionView should not be optional (radar://18508177)
Swift SVN r22570
- Make NSZone functions unavailable radar://16688847
- Distributed Objects subsystem should not be imported into Swift radar://16689104
- NSCalendarDate is available in Swift, but deprecated radar://16689207
- Do not import NSMethodSignature class and related methods radar://16689329
- NSInvocationOperation should be unavailble in Swift radar://17921785
Swift SVN r22090
This drop adds 3 new frameworks: Metal, SceneKit, and SpriteKit.
The other frameworks (Foundation, CoreData, ObjectiveC, UIKit) have been refined:
- conflicting items went to unknowns,
- bugs got fixed,
- more auditing has been performed.
Swift SVN r21443
Also, move the ObjectiveC overlay into its own directory, so that we can
use the directory name as an indicator of what overlays exist.
This is in preparation for DevPubs providing the contents of the apinotes/
directory. The downside here is that adding new apinotes files doesn't
automatically trigger a rebuild; I intend to mitigate that somewhat by at
least triggering one when the revision number of the DevPubs repo changes.
Swift SVN r21078
This requires a bit of special handling because we override the getter's type
in the importer, to make sure it's compatible with the setter, but other than
that we just use the information from the apinotes file.
<rdar://problem/17891179>
Swift SVN r21027
stringByAddingPercentEncodingWithAllowedCharacters() and
stringByAddingPercentEscapesUsingEncoding() to String?, and add API notes for
NSString to the same effect
Swift SVN r21007
The corrections are:
- Change the UIFont's API from '?' to '!'. These APIs are almost never get checked.
- Change the "options" array parameter to being optional.
Swift SVN r20723
This allows us to express required initializers in the API notes. Use
it to smooth over NSString differences in the various SDKs even more.
Swift SVN r20511