Skip to content

Commit 71ca4c5

Browse files
committed
Foundation: stop exporting certain overlay methods to Objective-C
1 parent c8c41b3 commit 71ca4c5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

stdlib/public/SDK/Foundation/Foundation.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ extension NSArray {
12031203
///
12041204
/// Discussion: After an immutable array has been initialized in
12051205
/// this way, it cannot be modified.
1206-
@objc(_swiftInitWithArray_NSArray:)
1206+
@nonobjc
12071207
public convenience init(array anArray: NSArray) {
12081208
self.init(array: anArray as Array)
12091209
}
@@ -1216,7 +1216,7 @@ extension NSString {
12161216
/// - Returns: An `NSString` object initialized by copying the
12171217
/// characters from `aString`. The returned object may be different
12181218
/// from the original receiver.
1219-
@objc(_swiftInitWithString_NSString:)
1219+
@nonobjc
12201220
public convenience init(string aString: NSString) {
12211221
self.init(string: aString as String)
12221222
}
@@ -1229,7 +1229,7 @@ extension NSSet {
12291229
/// - Returns: An initialized objects set containing the objects from
12301230
/// `set`. The returned set might be different than the original
12311231
/// receiver.
1232-
@objc(_swiftInitWithSet_NSSet:)
1232+
@nonobjc
12331233
public convenience init(set anSet: NSSet) {
12341234
self.init(set: anSet as Set)
12351235
}
@@ -1242,7 +1242,7 @@ extension NSDictionary {
12421242
/// - Returns: An initialized dictionary—which might be different
12431243
/// than the original receiver—containing the keys and values
12441244
/// found in `otherDictionary`.
1245-
@objc(_swiftInitWithDictionary_NSDictionary:)
1245+
@nonobjc
12461246
public convenience init(dictionary otherDictionary: NSDictionary) {
12471247
self.init(dictionary: otherDictionary as Dictionary)
12481248
}
@@ -1342,6 +1342,7 @@ extension NSCoder {
13421342
return NS_Swift_NSCoder_decodeObjectOfClassesForKey(self as AnyObject, classesAsNSObjects, key as AnyObject, nil).map { $0 as Any }
13431343
}
13441344

1345+
@nonobjc
13451346
@available(OSX 10.11, iOS 9.0, *)
13461347
public func decodeTopLevelObject() throws -> Any? {
13471348
var error: NSError?
@@ -1355,6 +1356,7 @@ extension NSCoder {
13551356
fatalError("This API has been renamed")
13561357
}
13571358

1359+
@nonobjc
13581360
@available(OSX 10.11, iOS 9.0, *)
13591361
public func decodeTopLevelObject(forKey key: String) throws -> AnyObject? {
13601362
var error: NSError?
@@ -1382,11 +1384,13 @@ extension NSCoder {
13821384
return result as? DecodedObjectType
13831385
}
13841386

1387+
@nonobjc
13851388
@available(*, unavailable, renamed: "decodeTopLevelObject(of:forKey:)")
13861389
public func decodeTopLevelObjectOfClasses(_ classes: NSSet?, forKey key: String) throws -> AnyObject? {
13871390
fatalError("This API has been renamed")
13881391
}
13891392

1393+
@nonobjc
13901394
@available(OSX 10.11, iOS 9.0, *)
13911395
public func decodeTopLevelObject(of classes: [AnyClass]?, forKey key: String) throws -> Any? {
13921396
var error: NSError? = nil
@@ -1412,6 +1416,7 @@ internal func NS_Swift_NSKeyedUnarchiver_unarchiveObjectWithData(
14121416

14131417
extension NSKeyedUnarchiver {
14141418
@available(OSX 10.11, iOS 9.0, *)
1419+
@nonobjc
14151420
public class func unarchiveTopLevelObjectWithData(_ data: NSData) throws -> AnyObject? {
14161421
var error: NSError?
14171422
let result = NS_Swift_NSKeyedUnarchiver_unarchiveObjectWithData(self, data as AnyObject, &error)

0 commit comments

Comments
 (0)