UIAlertcontroller set attributed messages
You app is crashing because of DataType mismatch.
alert.setValue(<value>, forKey: "attributedMessage")
Here <value>
must be an instance of NSMutableAttributedString
.
But you are passing myAttribute Which is Dictionary
.
It is trying ta call length
method but it is not found on Dictionary
thats why app is crashing.
Try this:
alert.setValue(myString, forKey: "attributedMessage")