9
9
10
10
import CoreFoundation
11
11
12
- public class NSAttributedString : NSObject , NSCopying , NSMutableCopying , NSSecureCoding {
12
+ public class AttributedString : NSObject , NSCopying , NSMutableCopying , NSSecureCoding {
13
13
14
14
private let _cfinfo = _CFInfo ( typeID: CFAttributedStringGetTypeID ( ) )
15
15
private let _string : NSString
@@ -95,12 +95,12 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
95
95
}
96
96
}
97
97
98
- public func attributedSubstringFromRange( _ range: NSRange ) -> NSAttributedString { NSUnimplemented ( ) }
98
+ public func attributedSubstringFromRange( _ range: NSRange ) -> AttributedString { NSUnimplemented ( ) }
99
99
100
100
public func attributesAtIndex( _ location: Int , longestEffectiveRange range: NSRangePointer , inRange rangeLimit: NSRange ) -> [ String : AnyObject ] { NSUnimplemented ( ) }
101
101
public func attribute( _ attrName: String , atIndex location: Int , longestEffectiveRange range: NSRangePointer , inRange rangeLimit: NSRange ) -> AnyObject ? { NSUnimplemented ( ) }
102
102
103
- public func isEqualToAttributedString( _ other: NSAttributedString ) -> Bool { NSUnimplemented ( ) }
103
+ public func isEqualToAttributedString( _ other: AttributedString ) -> Bool { NSUnimplemented ( ) }
104
104
105
105
public init ( string str: String ) {
106
106
_string = str. _nsObject
@@ -118,7 +118,7 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
118
118
addAttributesToAttributeArray ( attrs: attrs)
119
119
}
120
120
121
- public init ( attributedString attrStr: NSAttributedString ) { NSUnimplemented ( ) }
121
+ public init ( attributedString attrStr: AttributedString ) { NSUnimplemented ( ) }
122
122
123
123
private func addAttributesToAttributeArray( attrs: [ String : AnyObject ] ? ) {
124
124
guard _string. length > 0 else {
@@ -134,24 +134,29 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
134
134
}
135
135
}
136
136
137
- public func enumerateAttributesInRange( _ enumerationRange: NSRange , options opts: NSAttributedStringEnumerationOptions , usingBlock block: ( [ String : AnyObject ] , NSRange , UnsafeMutablePointer < ObjCBool > ) -> Void ) { NSUnimplemented ( ) }
138
- public func enumerateAttribute( _ attrName: String , inRange enumerationRange: NSRange , options opts: NSAttributedStringEnumerationOptions , usingBlock block: ( AnyObject ? , NSRange , UnsafeMutablePointer < ObjCBool > ) -> Void ) { NSUnimplemented ( ) }
137
+ public func enumerateAttributesInRange( _ enumerationRange: NSRange , options opts: EnumerationOptions , usingBlock block: ( [ String : AnyObject ] , NSRange , UnsafeMutablePointer < ObjCBool > ) -> Void ) { NSUnimplemented ( ) }
138
+ public func enumerateAttribute( _ attrName: String , inRange enumerationRange: NSRange , options opts: EnumerationOptions , usingBlock block: ( AnyObject ? , NSRange , UnsafeMutablePointer < ObjCBool > ) -> Void ) { NSUnimplemented ( ) }
139
139
}
140
140
141
- extension NSAttributedString : _CFBridgable {
141
+ extension AttributedString : _CFBridgable {
142
142
internal var _cfObject : CFAttributedString { return unsafeBitCast ( self , to: CFAttributedString . self) }
143
143
}
144
144
145
- public struct NSAttributedStringEnumerationOptions : OptionSet {
146
- public let rawValue : UInt
147
- public init ( rawValue: UInt ) { self . rawValue = rawValue }
148
- public static let Reverse = NSAttributedStringEnumerationOptions ( rawValue: 1 << 1 )
149
- public static let LongestEffectiveRangeNotRequired = NSAttributedStringEnumerationOptions ( rawValue: 1 << 20 )
150
- }
145
+ extension AttributedString {
151
146
147
+ public struct EnumerationOptions : OptionSet {
148
+ public let rawValue : UInt
149
+ public init ( rawValue: UInt ) {
150
+ self . rawValue = rawValue
151
+ }
152
+ public static let Reverse = EnumerationOptions ( rawValue: 1 << 1 )
153
+ public static let LongestEffectiveRangeNotRequired = EnumerationOptions ( rawValue: 1 << 20 )
154
+ }
155
+
156
+ }
152
157
153
158
154
- public class NSMutableAttributedString : NSAttributedString {
159
+ public class NSMutableAttributedString : AttributedString {
155
160
156
161
public func replaceCharactersInRange( _ range: NSRange , withString str: String ) { NSUnimplemented ( ) }
157
162
public func setAttributes( _ attrs: [ String : AnyObject ] ? , range: NSRange ) { NSUnimplemented ( ) }
@@ -163,11 +168,11 @@ public class NSMutableAttributedString : NSAttributedString {
163
168
public func addAttributes( _ attrs: [ String : AnyObject ] , range: NSRange ) { NSUnimplemented ( ) }
164
169
public func removeAttribute( _ name: String , range: NSRange ) { NSUnimplemented ( ) }
165
170
166
- public func replaceCharactersInRange( _ range: NSRange , withAttributedString attrString: NSAttributedString ) { NSUnimplemented ( ) }
167
- public func insertAttributedString( _ attrString: NSAttributedString , atIndex loc: Int ) { NSUnimplemented ( ) }
168
- public func appendAttributedString( _ attrString: NSAttributedString ) { NSUnimplemented ( ) }
171
+ public func replaceCharactersInRange( _ range: NSRange , withAttributedString attrString: AttributedString ) { NSUnimplemented ( ) }
172
+ public func insertAttributedString( _ attrString: AttributedString , atIndex loc: Int ) { NSUnimplemented ( ) }
173
+ public func appendAttributedString( _ attrString: AttributedString ) { NSUnimplemented ( ) }
169
174
public func deleteCharactersInRange( _ range: NSRange ) { NSUnimplemented ( ) }
170
- public func setAttributedString( _ attrString: NSAttributedString ) { NSUnimplemented ( ) }
175
+ public func setAttributedString( _ attrString: AttributedString ) { NSUnimplemented ( ) }
171
176
172
177
public func beginEditing( ) { NSUnimplemented ( ) }
173
178
public func endEditing( ) { NSUnimplemented ( ) }
0 commit comments