Skip to content

Commit

Permalink
[Clang importer] Strip the "NS" prefix from entities in Foundation.
Browse files Browse the repository at this point in the history
As part of the improved import of Objective-C APIs into Swift, strip
the "NS" prefix from entities defined in the Foundation
framework. Addresses rdar://problem/24050011, which is part of
SE-0005. Naturally, this is hidden behind -enable-omit-needless-words.
  • Loading branch information
DougGregor committed Jan 21, 2016
1 parent a1d909c commit 45e9023
Show file tree
Hide file tree
Showing 259 changed files with 24,377 additions and 24,433 deletions.
706 changes: 353 additions & 353 deletions Platforms/OSX/AVFoundation.swift

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Platforms/OSX/AVKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class AVCaptureView : NSView {
@discussion Options are AVLayerVideoGravityResize, AVLayerVideoGravityResizeAspect and AVLayerVideoGravityResizeAspectFill. AVLayerVideoGravityResizeAspect is default. See <AVFoundation/AVAnimation.h> for a description of these options.
*/
var videoGravity: String
init(frame frameRect: NSRect)
init?(coder: NSCoder)
init(frame frameRect: Rect)
init?(coder: Coder)
convenience init()
}

Expand Down Expand Up @@ -55,7 +55,7 @@ enum AVCaptureViewControlsStyle : Int {
@protocol AVCaptureViewDelegate
@abstract Defines an interface for delegates of AVCaptureView.
*/
protocol AVCaptureViewDelegate : NSObjectProtocol {
protocol AVCaptureViewDelegate : ObjectProtocol {
}

/*!
Expand Down Expand Up @@ -92,16 +92,16 @@ class AVPlayerView : NSView {
@abstract The current size and position of the video image as displayed within the receiver's view's bounds.
*/
@available(OSX 10.10, *)
var videoBounds: NSRect { get }
var videoBounds: Rect { get }

/*!
@property contentOverlayView
@abstract Use the content overlay view to add additional custom views between the video content and the controls.
*/
@available(OSX 10.10, *)
var contentOverlayView: NSView? { get }
init(frame frameRect: NSRect)
init?(coder: NSCoder)
init(frame frameRect: Rect)
init?(coder: Coder)
convenience init()
}

Expand Down
2 changes: 1 addition & 1 deletion Platforms/OSX/Accelerate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16464,7 +16464,7 @@ func la_norm_as_double(vector: la_object_t, _ vector_norm: la_norm_t) -> Double
*/
@available(OSX 10.10, *)
func la_normalized_vector(vector: la_object_t, _ vector_norm: la_norm_t) -> la_object_t!
protocol OS_la_object : NSObjectProtocol {
protocol OS_la_object : ObjectProtocol {
}
typealias la_object_t = OS_la_object

Expand Down
20 changes: 10 additions & 10 deletions Platforms/OSX/Accounts.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

@available(OSX 10.8, *)
class ACAccount : NSObject {
class ACAccount : Object {
init!(accountType type: ACAccountType!)
var identifier: String! { get }
var accountType: ACAccountType!
Expand All @@ -10,9 +10,9 @@ class ACAccount : NSObject {
convenience init()
}
@available(OSX 10.8, *)
class ACAccountCredential : NSObject {
class ACAccountCredential : Object {
init!(oAuthToken token: String!, tokenSecret secret: String!)
init!(oAuth2Token token: String!, refreshToken: String!, expiryDate: NSDate!)
init!(oAuth2Token token: String!, refreshToken: String!, expiryDate: Date!)
var oauthToken: String!
init()
}
Expand All @@ -23,18 +23,18 @@ enum ACAccountCredentialRenewResult : Int {
case Rejected
case Failed
}
typealias ACAccountStoreSaveCompletionHandler = (Bool, NSError!) -> Void
typealias ACAccountStoreRemoveCompletionHandler = (Bool, NSError!) -> Void
typealias ACAccountStoreRequestAccessCompletionHandler = (Bool, NSError!) -> Void
typealias ACAccountStoreCredentialRenewalHandler = (ACAccountCredentialRenewResult, NSError!) -> Void
typealias ACAccountStoreSaveCompletionHandler = (Bool, Error!) -> Void
typealias ACAccountStoreRemoveCompletionHandler = (Bool, Error!) -> Void
typealias ACAccountStoreRequestAccessCompletionHandler = (Bool, Error!) -> Void
typealias ACAccountStoreCredentialRenewalHandler = (ACAccountCredentialRenewResult, Error!) -> Void
@available(OSX 10.8, *)
class ACAccountStore : NSObject {
class ACAccountStore : Object {
var accounts: [AnyObject]! { get }
func accountWithIdentifier(identifier: String!) -> ACAccount!
func accountTypeWithAccountTypeIdentifier(typeIdentifier: String!) -> ACAccountType!
func accountsWith(accountType: ACAccountType!) -> [AnyObject]!
func saveAccount(account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreSaveCompletionHandler!)
func requestAccessToAccountsWith(accountType: ACAccountType!, options: [NSObject : AnyObject]! = [:], completion: ACAccountStoreRequestAccessCompletionHandler!)
func requestAccessToAccountsWith(accountType: ACAccountType!, options: [Object : AnyObject]! = [:], completion: ACAccountStoreRequestAccessCompletionHandler!)
func renewCredentialsFor(account: ACAccount!, completion completionHandler: ACAccountStoreCredentialRenewalHandler!)
func removeAccount(account: ACAccount!, withCompletionHandler completionHandler: ACAccountStoreRemoveCompletionHandler!)
init()
Expand Down Expand Up @@ -70,7 +70,7 @@ let ACLinkedInPermissionsKey: String
@available(OSX 10.9, *)
let ACTencentWeiboAppIdKey: String
@available(OSX 10.8, *)
class ACAccountType : NSObject {
class ACAccountType : Object {
var accountTypeDescription: String! { get }
var identifier: String! { get }
var accessGranted: Bool { get }
Expand Down
32 changes: 16 additions & 16 deletions Platforms/OSX/AddressBook.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ var ABPropertyReadOnlyError: Int { get }
let ABAddressBookErrorDomain: String
@available(OSX 10.7, *)
let ABMultiValueIdentifiersErrorKey: String
class ABAddressBook : NSObject {
class ABAddressBook : Object {
class func shared() -> ABAddressBook!
func recordsMatching(search: ABSearchElement!) -> [AnyObject]!
func save() -> Bool
Expand All @@ -182,7 +182,7 @@ class ABAddressBook : NSObject {
@available(OSX 10.3, *)
func recordClassFromUniqueId(uniqueId: String!) -> String!
@available(OSX 10.3, *)
func formattedAddressFrom(address: [NSObject : AnyObject]!) -> NSAttributedString!
func formattedAddressFrom(address: [Object : AnyObject]!) -> AttributedString!
@available(OSX 10.3, *)
func defaultCountryCode() -> String!
@available(OSX 10.3, *)
Expand Down Expand Up @@ -379,24 +379,24 @@ class ABGroup : ABRecord {
init!(addressBook: ABAddressBook!)
}
extension ABGroup {
class func addPropertiesAndTypes(properties: [NSObject : AnyObject]!) -> Int
class func addPropertiesAndTypes(properties: [Object : AnyObject]!) -> Int
class func removeProperties(properties: [AnyObject]!) -> Int
class func properties() -> [AnyObject]!
class func typeOfProperty(property: String!) -> ABPropertyType
}
extension ABGroup {
class func searchElementForProperty(property: String!, label: String!, key: String!, value: AnyObject!, comparison: ABSearchComparison) -> ABSearchElement!
}
protocol ABImageClient : NSObjectProtocol {
func consumeImageData(data: NSData!, forTag tag: Int)
protocol ABImageClient : ObjectProtocol {
func consumeImageData(data: Data!, forTag tag: Int)
}
extension ABPerson {
func setImageData(data: NSData!) -> Bool
func imageData() -> NSData!
func setImageData(data: Data!) -> Bool
func imageData() -> Data!
func beginLoadingImageDataFor(client: ABImageClient!) -> Int
class func cancelLoadingImageDataForTag(tag: Int)
}
class ABMultiValue : NSObject, NSCopying, NSMutableCopying, NSFastEnumeration {
class ABMultiValue : Object, Copying, MutableCopying, FastEnumeration {
func count() -> Int
func valueAt(index: Int) -> AnyObject!
func labelAt(index: Int) -> String!
Expand All @@ -407,9 +407,9 @@ class ABMultiValue : NSObject, NSCopying, NSMutableCopying, NSFastEnumeration {
func valueForIdentifier(identifier: String!) -> AnyObject!
func labelForIdentifier(identifier: String!) -> AnyObject!
init()
func copy(zone zone: NSZone = nil) -> AnyObject
func mutableCopy(zone zone: NSZone = nil) -> AnyObject
func countByEnumeratingWith(state: UnsafeMutablePointer<NSFastEnumerationState>, objects buffer: AutoreleasingUnsafeMutablePointer<AnyObject?>, count len: Int) -> Int
func copy(zone zone: Zone = nil) -> AnyObject
func mutableCopy(zone zone: Zone = nil) -> AnyObject
func countByEnumeratingWith(state: UnsafeMutablePointer<FastEnumerationState>, objects buffer: AutoreleasingUnsafeMutablePointer<AnyObject?>, count len: Int) -> Int
}
class ABMutableMultiValue : ABMultiValue {
func add(value: AnyObject!, withLabel label: String!) -> String!
Expand All @@ -429,7 +429,7 @@ class ABPerson : ABRecord {
init!(addressBook: ABAddressBook!)
}
extension ABPerson {
class func addPropertiesAndTypes(properties: [NSObject : AnyObject]!) -> Int
class func addPropertiesAndTypes(properties: [Object : AnyObject]!) -> Int
class func removeProperties(properties: [AnyObject]!) -> Int
class func properties() -> [AnyObject]!
class func typeOfProperty(property: String!) -> ABPropertyType
Expand All @@ -438,10 +438,10 @@ extension ABPerson {
class func searchElementForProperty(property: String!, label: String!, key: String!, value: AnyObject!, comparison: ABSearchComparison) -> ABSearchElement!
}
extension ABPerson {
init!(vCardRepresentation vCardData: NSData!)
func vCardRepresentation() -> NSData!
init!(vCardRepresentation vCardData: Data!)
func vCardRepresentation() -> Data!
}
class ABRecord : NSObject {
class ABRecord : Object {
init!()
@available(OSX 10.5, *)
init!(addressBook: ABAddressBook!)
Expand All @@ -458,7 +458,7 @@ extension ABRecord {
@available(OSX 10.10, *)
var displayName: String! { get }
}
class ABSearchElement : NSObject {
class ABSearchElement : Object {
/*not inherited*/ init!(forConjunction conjuction: ABSearchConjunction, children: [AnyObject]!)
func matchesRecord(record: ABRecord!) -> Bool
init()
Expand Down
Loading

0 comments on commit 45e9023

Please sign in to comment.