You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
openfunc attribute(_ attrName:String, at location:Int, effectiveRange range:NSRangePointer?)->Any?{
80
+
81
+
/// Returns the value for an attribute with a given name of the character at a given index, and by reference the range over which the attribute applies.
82
+
openfunc attribute(_ attrName:NSAttributedStringKey, at location:Int, effectiveRange range:NSRangePointer?)->Any?{
openfunc attribute(_ attrName:String, at location:Int, longestEffectiveRange range:NSRangePointer?, in rangeLimit:NSRange)->Any?{
101
+
102
+
/// Returns the value for the attribute with a given name of the character at a given index, and by reference the range over which the attribute applies.
103
+
openfunc attribute(_ attrName:NSAttributedStringKey, at location:Int, longestEffectiveRange range:NSRangePointer?, in rangeLimit:NSRange)->Any?{
@@ -122,8 +152,9 @@ open class NSAttributedString: NSObject, NSCopying, NSMutableCopying, NSSecureCo
122
152
return attributesEffectiveRange
123
153
}
124
154
}
125
-
126
-
openfunc enumerateAttribute(_ attrName:String, in enumerationRange:NSRange, options opts:NSAttributedString.EnumerationOptions=[], using block:(Any?,NSRange,UnsafeMutablePointer<ObjCBool>)->Swift.Void){
155
+
156
+
/// Executes the block for the specified attribute run in the specified range.
157
+
openfunc enumerateAttribute(_ attrName:NSAttributedStringKey, in enumerationRange:NSRange, options opts:NSAttributedString.EnumerationOptions=[], using block:(Any?,NSRange,UnsafeMutablePointer<ObjCBool>)->Swift.Void){
127
158
_enumerate(in: enumerationRange, reversed: opts.contains(.reverse)){ currentIndex, stop in
letstring="Lorem 😀 ipsum dolor sit amet, consectetur adipiscing elit. ⌘ Phasellus consectetur et sem vitae consectetur. Nam venenatis lectus a laoreet blandit. ಠ_ರೃ"
36
35
letattrString=NSAttributedString(string: string)
@@ -43,40 +42,40 @@ class TestNSAttributedString : XCTestCase {
letstring="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus consectetur et sem vitae consectetur. Nam venenatis lectus a laoreet blandit."
@@ -85,7 +84,7 @@ class TestNSAttributedString : XCTestCase {
85
84
func test_longestEffectiveRange(){
86
85
letstring="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus consectetur et sem vitae consectetur. Nam venenatis lectus a laoreet blandit."
@@ -110,12 +109,12 @@ class TestNSAttributedString : XCTestCase {
110
109
func test_enumerateAttributeWithName(){
111
110
letstring="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus consectetur et sem vitae consectetur. Nam venenatis lectus a laoreet blandit."
@@ -161,15 +160,15 @@ class TestNSAttributedString : XCTestCase {
161
160
#else
162
161
letstring="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus consectetur et sem vitae consectetur. Nam venenatis lectus a laoreet blandit."
0 commit comments