Member-only story
NSAttributedString vs NSMutableAttributedString
How ARE you going add formatting to that writing?
Strings can be tricky things. That is why the Swift overlords helped you out with formatting, using attributed Strings. Let’s get stuck in with this guide.
This post is about explaining what that is, and how you can use it to help you in your production Apps. That is — make your Strings look good!
Difficulty: Easy | Normal | Challenging
Prerequisites:
- Know what a String is, and have some experience in using it in Swift
Terminology
Character: A character, usually associated with a letter of the alphabet.
NSAttributedString: is a piece of text that has attributes (like links or fonts) that apply to portions of text.
NSMutableAttributedString: is an NSAttributedString with additional methods for mutating the content.
String: A collection of Characters.
The video guide
You want a video? Fine. However, I’d suggest that you also read the text as the person who has narrated the video really hasn’t made themselves to clear.