It was a warning because I didn't want to break anything when I first
added the check, but we've been warning-free for a while now. Let's
keep it that way.
This changes how we import CGPDFContextEndPage to be
CGContext.endPDFPage(), instead of .endPage() which conflicts with
another CGContext function. Also does .beginPDFPage() for consistency,
which is consistent with e.g. drawPDFPage().
Note that the Swift name here is deliberately different from the
Objective-C name. It is the authorization that changed, even though
the argument is an authorization status.
- (void)locationManager:(CLLocationManager *)manager
didChangeAuthorizationStatus:(CLAuthorizationStatus)status;
optional func locationManager(_ manager: CLLocationManager,
didChangeAuthorization status: CLAuthorizationStatus)
rdar://problem/26586048
The problem here is that there isn't an obvious way to force a CMake
reconfiguration when you need to add new apinotes. This dates back to
when we (internally) had the apinotes in a separate repo, but that
hasn't been the case for a long time.
We're still not using a /normal/ CMake add_subdirectory for these
because we compile the apinotes as part of building overlays for
frameworks that have both overlays and apinotes, and I didn't want to
touch any of that stuff right now.
That is, import something like 'CGColorCreateGenericGray' as
"CGColor.init(gray:alpha:)" rather than "CGColorRef.init(gray:alpha:)".
Since we print the type name in diagnostic text and in fix-its, it's
important to use the name that Swift sources use.
Finishes rdar://problem/26347297.
CGPathCreateMutableCopy and CGPathCreateMutableCopyByTransformingPath
have 'self' type of CGPath, and thus must be imported as members of
CGPath proper, not CGMutablePath. Does so by following common naming
conventions for producing mutable copies.
Introduces CoreGraphics.apinotes, in which we enable the
import-as-member inference system. Additionally, include some explicit
SwiftNames, for when inference doesn't produce the right result, and
to aid compatibility with the overlays.
Refactors many of the trivial overlays out, shrinking the
CoreGraphics.swift overlay by over half. Updates in-tree test
cases. The names we currently have will be highly in flux for a while,
and are likely to change frequently over the near term.
There are a few remaining known bugs that are worked around by
apinotes entries.
When an Objective-C class type is annotated with the swift_bridge
value type, bridge it to the named type. Use API notes on Foundation
rather than special cases.
For Objective-C classes where bridging was baked into the Clang
importer (NSString, NSArray, NSDictionary, NSSet), add API notes to
put the appropriate swift_bridge attribute on these Objective-C
classes.
Note: requires Clang update.
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