Skip to content

Commit e35f973

Browse files
committed
Revert this when SR-310 is resolved
1 parent 2df02ff commit e35f973

34 files changed

+197
-1
lines changed

Foundation/NSArray.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,18 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
7979
return true
8080
}
8181

82+
public override func copy() -> AnyObject {
83+
return copyWithZone(nil)
84+
}
85+
8286
public func copyWithZone(zone: NSZone) -> AnyObject {
8387
return self
8488
}
8589

90+
public override func mutableCopy() -> AnyObject {
91+
return mutableCopyWithZone(nil)
92+
}
93+
8694
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
8795
return NSMutableArray(array: _swiftObject)
8896
}

Foundation/NSAttributedString.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,18 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
2222
return true
2323
}
2424

25+
public override func copy() -> AnyObject {
26+
return copyWithZone(nil)
27+
}
28+
2529
public func copyWithZone(zone: NSZone) -> AnyObject {
2630
NSUnimplemented()
2731
}
2832

33+
public override func mutableCopy() -> AnyObject {
34+
return mutableCopyWithZone(nil)
35+
}
36+
2937
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
3038
NSUnimplemented()
3139
}

Foundation/NSCalendar.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ public class NSCalendar : NSObject, NSCopying, NSSecureCoding {
118118
return true
119119
}
120120

121+
public override func copy() -> AnyObject {
122+
return copyWithZone(nil)
123+
}
124+
121125
public func copyWithZone(zone: NSZone) -> AnyObject {
122126
NSUnimplemented()
123127
}
@@ -1202,6 +1206,10 @@ public class NSDateComponents : NSObject, NSCopying, NSSecureCoding {
12021206
return true
12031207
}
12041208

1209+
public override func copy() -> AnyObject {
1210+
return copyWithZone(nil)
1211+
}
1212+
12051213
public func copyWithZone(zone: NSZone) -> AnyObject {
12061214
NSUnimplemented()
12071215
}

Foundation/NSCharacterSet.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,18 @@ public class NSCharacterSet : NSObject, NSCopying, NSMutableCopying, NSCoding {
164164
return CFCharacterSetHasMemberInPlane(_cfObject, CFIndex(thePlane))
165165
}
166166

167+
public override func copy() -> AnyObject {
168+
return copyWithZone(nil)
169+
}
170+
167171
public func copyWithZone(zone: NSZone) -> AnyObject {
168172
return CFCharacterSetCreateCopy(kCFAllocatorSystemDefault, self._cfObject)
169173
}
170174

175+
public override func mutableCopy() -> AnyObject {
176+
return mutableCopyWithZone(nil)
177+
}
178+
171179
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
172180
return CFCharacterSetCreateMutableCopy(kCFAllocatorSystemDefault, _cfObject)._nsObject
173181
}

Foundation/NSData.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,18 @@ public class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
131131
}
132132
}
133133

134+
public override func copy() -> AnyObject {
135+
return copyWithZone(nil)
136+
}
137+
134138
public func copyWithZone(zone: NSZone) -> AnyObject {
135139
return self
136140
}
137141

142+
public override func mutableCopy() -> AnyObject {
143+
return mutableCopyWithZone(nil)
144+
}
145+
138146
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
139147
return NSMutableData(bytes: UnsafeMutablePointer<Void>(bytes), length: length, copy: true, deallocator: nil)
140148
}

Foundation/NSDate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public class NSDate : NSObject, NSCopying, NSSecureCoding, NSCoding {
6060
public required init?(coder aDecoder: NSCoder) {
6161
NSUnimplemented()
6262
}
63+
64+
public override func copy() -> AnyObject {
65+
return copyWithZone(nil)
66+
}
6367

6468
public func copyWithZone(zone: NSZone) -> AnyObject {
6569
return self

Foundation/NSDictionary.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,18 @@ public class NSDictionary : NSObject, NSCopying, NSMutableCopying, NSSecureCodin
147147
return true
148148
}
149149

150+
public override func copy() -> AnyObject {
151+
return copyWithZone(nil)
152+
}
153+
150154
public func copyWithZone(zone: NSZone) -> AnyObject {
151155
NSUnimplemented()
152156
}
153157

158+
public override func mutableCopy() -> AnyObject {
159+
return mutableCopyWithZone(nil)
160+
}
161+
154162
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
155163
NSUnimplemented()
156164
}

Foundation/NSError.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public class NSError : NSObject, NSCopying, NSSecureCoding, NSCoding {
6767

6868
}
6969

70+
public override func copy() -> AnyObject {
71+
return copyWithZone(nil)
72+
}
73+
7074
public func copyWithZone(zone: NSZone) -> AnyObject {
7175
return self
7276
}

Foundation/NSExpression.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public class NSExpression : NSObject, NSSecureCoding, NSCopying {
4141
NSUnimplemented()
4242
}
4343

44+
public override func copy() -> AnyObject {
45+
return copyWithZone(nil)
46+
}
47+
4448
public func copyWithZone(zone: NSZone) -> AnyObject {
4549
NSUnimplemented()
4650
}

Foundation/NSFormatter.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ public class NSFormatter : NSObject, NSCopying, NSCoding {
5656

5757
}
5858

59+
public override func copy() -> AnyObject {
60+
return copyWithZone(nil)
61+
}
62+
5963
public func copyWithZone(zone: NSZone) -> AnyObject {
6064
return self
6165
}

Foundation/NSIndexPath.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ public class NSIndexPath : NSObject, NSCopying, NSSecureCoding {
2121
private init(indexes: [Int]) {
2222
_indexes = indexes
2323
}
24+
25+
public override func copy() -> AnyObject {
26+
return copyWithZone(nil)
27+
}
28+
2429
public func copyWithZone(zone: NSZone) -> AnyObject { NSUnimplemented() }
2530
public convenience init(index: Int) {
2631
self.init(indexes: [index])

Foundation/NSIndexSet.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@ public class NSIndexSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding
4646
_ranges = indexSet._ranges
4747
_count = indexSet.count
4848
}
49+
50+
public override func copy() -> AnyObject {
51+
return copyWithZone(nil)
52+
}
53+
4954
public func copyWithZone(zone: NSZone) -> AnyObject { NSUnimplemented() }
55+
56+
public override func mutableCopy() -> AnyObject {
57+
return mutableCopyWithZone(nil)
58+
}
59+
5060
public func mutableCopyWithZone(zone: NSZone) -> AnyObject { NSUnimplemented() }
5161
public static func supportsSecureCoding() -> Bool { return true }
5262
public required init?(coder aDecoder: NSCoder) { NSUnimplemented() }

Foundation/NSLocale.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public class NSLocale : NSObject, NSCopying, NSSecureCoding {
4444
NSUnimplemented()
4545
}
4646

47+
public override func copy() -> AnyObject {
48+
return copyWithZone(nil)
49+
}
50+
4751
public func copyWithZone(zone: NSZone) -> AnyObject { NSUnimplemented() }
4852

4953
public func encodeWithCoder(aCoder: NSCoder) { NSUnimplemented() }

Foundation/NSNotification.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public class NSNotification : NSObject, NSCopying, NSCoding {
3333
NSUnimplemented()
3434
}
3535

36+
public override func copy() -> AnyObject {
37+
return copyWithZone(nil)
38+
}
39+
3640
public func copyWithZone(zone: NSZone) -> AnyObject {
3741
return self
3842
}

Foundation/NSNull.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010

1111
public class NSNull : NSObject, NSCopying, NSSecureCoding {
12+
13+
public override func copy() -> AnyObject {
14+
return copyWithZone(nil)
15+
}
16+
1217
public func copyWithZone(zone: NSZone) -> AnyObject {
1318
return self
1419
}

Foundation/NSOrderedSet.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@
1111
/**************** Immutable Ordered Set ****************/
1212
public class NSOrderedSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, ArrayLiteralConvertible {
1313

14+
public override func copy() -> AnyObject {
15+
return copyWithZone(nil)
16+
}
17+
1418
public func copyWithZone(zone: NSZone) -> AnyObject {
1519
NSUnimplemented()
1620
}
17-
21+
22+
public override func mutableCopy() -> AnyObject {
23+
return mutableCopyWithZone(nil)
24+
}
25+
1826
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
1927
NSUnimplemented()
2028
}

Foundation/NSPredicate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public class NSPredicate : NSObject, NSSecureCoding, NSCopying {
2424
NSUnimplemented()
2525
}
2626

27+
public override func copy() -> AnyObject {
28+
return copyWithZone(nil)
29+
}
30+
2731
public func copyWithZone(zone: NSZone) -> AnyObject {
2832
NSUnimplemented()
2933
}

Foundation/NSRegularExpression.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ public struct NSRegularExpressionOptions : OptionSetType {
2424
}
2525

2626
public class NSRegularExpression : NSObject, NSCopying, NSCoding {
27+
public override func copy() -> AnyObject {
28+
return copyWithZone(nil)
29+
}
30+
2731
public func copyWithZone(zone: NSZone) -> AnyObject {
2832
NSUnimplemented()
2933
}

Foundation/NSScanner.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public class NSScanner : NSObject, NSCopying {
1717
internal var _invertedSkipSet: NSCharacterSet?
1818
internal var _scanLocation: Int
1919

20+
public override func copy() -> AnyObject {
21+
return copyWithZone(nil)
22+
}
23+
2024
public func copyWithZone(zone: NSZone) -> AnyObject {
2125
return NSScanner(string: string)
2226
}

Foundation/NSSet.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,18 @@ public class NSSet : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCo
124124
NSUnimplemented()
125125
}
126126

127+
public override func copy() -> AnyObject {
128+
return copyWithZone(nil)
129+
}
130+
127131
public func copyWithZone(zone: NSZone) -> AnyObject {
128132
NSUnimplemented()
129133
}
130134

135+
public override func mutableCopy() -> AnyObject {
136+
return mutableCopyWithZone(nil)
137+
}
138+
131139
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
132140
NSUnimplemented()
133141
}

Foundation/NSSortDescriptor.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public class NSSortDescriptor : NSObject, NSSecureCoding, NSCopying {
2222
return true
2323
}
2424

25+
public override func copy() -> AnyObject {
26+
return copyWithZone(nil)
27+
}
28+
2529
public func copyWithZone(zone: NSZone) -> AnyObject {
2630
NSUnimplemented()
2731
}

Foundation/NSString.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,18 @@ public class NSString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, N
241241
NSUnimplemented()
242242
}
243243

244+
public override func copy() -> AnyObject {
245+
return copyWithZone(nil)
246+
}
247+
244248
public func copyWithZone(zone: NSZone) -> AnyObject {
245249
return self
246250
}
247251

252+
public override func mutableCopy() -> AnyObject {
253+
return mutableCopyWithZone(nil)
254+
}
255+
248256
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
249257
if self.dynamicType === NSString.self || self.dynamicType === NSMutableString.self {
250258
let contents = _fastContents

Foundation/NSTextCheckingResult.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public class NSTextCheckingResult : NSObject, NSCopying, NSCoding {
2828
NSUnimplemented()
2929
}
3030

31+
public override func copy() -> AnyObject {
32+
return copyWithZone(nil)
33+
}
34+
3135
public func copyWithZone(zone: NSZone) -> AnyObject {
3236
NSUnimplemented()
3337
}

Foundation/NSTimeZone.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public class NSTimeZone : NSObject, NSCopying, NSSecureCoding, NSCoding {
5858
return true
5959
}
6060

61+
public override func copy() -> AnyObject {
62+
return copyWithZone(nil)
63+
}
64+
6165
public func copyWithZone(zone: NSZone) -> AnyObject {
6266
return self
6367
}

Foundation/NSURL.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public class NSURL : NSObject, NSSecureCoding, NSCopying {
6262
_CFDeinit(self)
6363
}
6464

65+
public override func copy() -> AnyObject {
66+
return copyWithZone(nil)
67+
}
68+
6569
public func copyWithZone(zone: NSZone) -> AnyObject {
6670
NSUnimplemented()
6771
}
@@ -468,6 +472,10 @@ public class NSURLQueryItem : NSObject, NSSecureCoding, NSCopying {
468472
self.value = value
469473
}
470474

475+
public override func copy() -> AnyObject {
476+
return copyWithZone(nil)
477+
}
478+
471479
public func copyWithZone(zone: NSZone) -> AnyObject {
472480
NSUnimplemented()
473481
}
@@ -491,6 +499,10 @@ public class NSURLQueryItem : NSObject, NSSecureCoding, NSCopying {
491499
public class NSURLComponents : NSObject, NSCopying {
492500
private let _components : CFURLComponentsRef!
493501

502+
public override func copy() -> AnyObject {
503+
return copyWithZone(nil)
504+
}
505+
494506
public func copyWithZone(zone: NSZone) -> AnyObject {
495507
NSUnimplemented()
496508
}

Foundation/NSURLCache.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public class NSCachedURLResponse : NSObject, NSSecureCoding, NSCopying {
5454
return true
5555
}
5656

57+
public override func copy() -> AnyObject {
58+
return copyWithZone(nil)
59+
}
60+
5761
public func copyWithZone(zone: NSZone) -> AnyObject {
5862
NSUnimplemented()
5963
}

0 commit comments

Comments
 (0)