CleanyModal
CleanyModal copied to clipboard
Can't displayed attributed text in the default initializer
How would one implement the message label on the main alert to be attributed text? I tried changing the default init to be of ‘NSAttributedString’, but I didn’t know how to change it in the file AlertModel, because when I changed message to be of type NSAttributedString, I got an error that I couldn’t fix.
Yes actually you can't use an attributed string in the default model.
I will keep the model simple, but open visibility of message and title label (they are private variables) so you could pass attributed strings on them
So I should try to access the textfield in the label directly?
Aussi, je parle français 😎
Nevermind, I ended up creating a similar AlertModel class that didn't use Codable and is just a regular struct. I replaced all the instances of datasource with my own AlertModel instance and changed the labels to attributed text.
When Lory doesn't respond so you do it yourself: