Skip to content

Commit 6488630

Browse files
committed
Revert "Implement basic initializers of NSAttributedString (#297)"
This reverts commit 03d534c.
1 parent 03d534c commit 6488630

File tree

4 files changed

+5
-101
lines changed

4 files changed

+5
-101
lines changed

Foundation.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
0B6439E01CA192FC0019CB56 /* TestNSAttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B6439DF1CA192FC0019CB56 /* TestNSAttributedString.swift */; };
1110
2EBE67A51C77BF0E006583D5 /* TestNSDateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EBE67A31C77BF05006583D5 /* TestNSDateFormatter.swift */; };
1211
528776141BF2629700CB0090 /* FoundationErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 522C253A1BF16E1600804FC6 /* FoundationErrors.swift */; };
1312
528776191BF27D9500CB0090 /* Test.plist in Resources */ = {isa = PBXBuildFile; fileRef = 528776181BF27D9500CB0090 /* Test.plist */; };
@@ -385,7 +384,6 @@
385384
/* End PBXCopyFilesBuildPhase section */
386385

387386
/* Begin PBXFileReference section */
388-
0B6439DF1CA192FC0019CB56 /* TestNSAttributedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestNSAttributedString.swift; sourceTree = "<group>"; };
389387
22B9C1E01C165D7A00DECFF9 /* TestNSDate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestNSDate.swift; sourceTree = "<group>"; };
390388
2EBE67A31C77BF05006583D5 /* TestNSDateFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestNSDateFormatter.swift; sourceTree = "<group>"; };
391389
400E22641C1A4E58007C5933 /* TestNSProcessInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestNSProcessInfo.swift; sourceTree = "<group>"; };
@@ -1164,7 +1162,6 @@
11641162
children = (
11651163
C93559281C12C49F009FD6A9 /* TestNSAffineTransform.swift */,
11661164
EA66F63C1BF1619600136161 /* TestNSArray.swift */,
1167-
0B6439DF1CA192FC0019CB56 /* TestNSAttributedString.swift */,
11681165
6E203B8C1C1303BB003B2576 /* TestNSBundle.swift */,
11691166
A5A34B551C18C85D00FD972B /* TestNSByteCountFormatter.swift */,
11701167
52829AD61C160D64003BC4EF /* TestNSCalendar.swift */,
@@ -1992,7 +1989,6 @@
19921989
5B13B3521C582D4C00651CE2 /* TestNSValue.swift in Sources */,
19931990
5B13B3311C582D4C00651CE2 /* TestNSIndexPath.swift in Sources */,
19941991
5B13B3271C582D4C00651CE2 /* TestNSArray.swift in Sources */,
1995-
0B6439E01CA192FC0019CB56 /* TestNSAttributedString.swift in Sources */,
19961992
5B13B3461C582D4C00651CE2 /* TestNSTask.swift in Sources */,
19971993
555683BD1C1250E70041D4C6 /* TestNSUserDefaults.swift in Sources */,
19981994
7900433B1CACD33E00ECCBF1 /* TestNSCompoundPredicate.swift in Sources */,

Foundation/NSAttributedString.swift

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
import CoreFoundation
1110

1211
public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
1312

14-
private var _cfAttributedString: CFAttributedString
15-
16-
internal init(cfObject: CFAttributedString) {
17-
_cfAttributedString = cfObject
18-
}
19-
2013
public required init?(coder aDecoder: NSCoder) {
2114
NSUnimplemented()
2215
}
@@ -45,16 +38,10 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
4538
NSUnimplemented()
4639
}
4740

48-
public var string: String {
49-
return CFAttributedStringGetString(_cfAttributedString)._swiftObject
50-
}
51-
41+
public var string: String { NSUnimplemented() }
5242
public func attributesAtIndex(_ location: Int, effectiveRange range: NSRangePointer) -> [String : AnyObject] { NSUnimplemented() }
5343

54-
public var length: Int {
55-
return CFAttributedStringGetLength(_cfAttributedString)
56-
}
57-
44+
public var length: Int { NSUnimplemented() }
5845
public func attribute(_ attrName: String, atIndex location: Int, effectiveRange range: NSRangePointer) -> AnyObject? { NSUnimplemented() }
5946
public func attributedSubstringFromRange(_ range: NSRange) -> NSAttributedString { NSUnimplemented() }
6047

@@ -63,20 +50,9 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
6350

6451
public func isEqualToAttributedString(_ other: NSAttributedString) -> Bool { NSUnimplemented() }
6552

66-
public init(string str: String) {
67-
_cfAttributedString = CFAttributedStringCreate(kCFAllocatorDefault, str._cfObject, nil)
68-
super.init()
69-
}
70-
71-
public init(string str: String, attributes attrs: [String : AnyObject]?) {
72-
_cfAttributedString = CFAttributedStringCreate(kCFAllocatorDefault, str._cfObject, attrs?._cfObject)
73-
super.init()
74-
}
75-
76-
public init(attributedString attrStr: NSAttributedString) {
77-
_cfAttributedString = CFAttributedStringCreateCopy(kCFAllocatorDefault, attrStr._cfAttributedString)
78-
super.init()
79-
}
53+
public init(string str: String) { NSUnimplemented() }
54+
public init(string str: String, attributes attrs: [String : AnyObject]?) { NSUnimplemented() }
55+
public init(attributedString attrStr: NSAttributedString) { NSUnimplemented() }
8056

8157
public func enumerateAttributesInRange(_ enumerationRange: NSRange, options opts: NSAttributedStringEnumerationOptions, usingBlock block: ([String : AnyObject], NSRange, UnsafeMutablePointer<ObjCBool>) -> Void) { NSUnimplemented() }
8258
public func enumerateAttribute(_ attrName: String, inRange enumerationRange: NSRange, options opts: NSAttributedStringEnumerationOptions, usingBlock block: (AnyObject?, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void) { NSUnimplemented() }

TestFoundation/TestNSAttributedString.swift

Lines changed: 0 additions & 67 deletions
This file was deleted.

TestFoundation/main.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ internal func testBundle() -> NSBundle {
2323
XCTMain([
2424
testCase(TestNSAffineTransform.allTests),
2525
testCase(TestNSArray.allTests),
26-
testCase(TestNSAttributedString.allTests),
2726
testCase(TestNSBundle.allTests),
2827
testCase(TestNSByteCountFormatter.allTests),
2928
testCase(TestNSCalendar.allTests),

0 commit comments

Comments
 (0)