Can anyone explain to me how NSAttributedString correctly follows the MVC paradigm? I know it doesn’t inherit from NSString, but it still is a string, so I would say that’s part of my model. However, setting UI attributes such as underline, font, shadow, etc. clearly are part of the View when talking MVC, so I’m not really sure how this follows the rules.
Can anyone explain to me how NSAttributedString correctly follows the MVC paradigm? I know
Share
NSAttributedString is a model class.
It just has the representation of the attributed string.
Just because it stores the attributes, that doesn’t make it responsible for the display of the attribute.
Imagine you had a custom class for shapes. If you had a square shape and stored it’s colour, it would still be a model object, because it’s up to the presenting view to draw the square and fill it with the colour, the model object is just a place to store the attributes.