I am working on objective-C to swift conversion. For conversion, I am using String for NSString and Array for NSArray. Similarly, when I try to convert NSAttributedString , I could not find a structure type. Is there any structure type that can be used instead of NSAttributedString class or I must and should use NSAttributedString class itself for the conversion
1 Answer
The simple answer is no, you can and should use NSAttributedString even if you're writing Swift code.
E.g. As you can see here the property attributedText of UILabel
is of type NSAttributedString.
NSAttributedStringin swiftStringis just for plain text but for color, images, urls etc. you will useNSAttributedString.