ios - '_ ??' is not convertible to '()' with NSMutableAttributedString -
i've i'm pretty new swift , i'm stuck in setting nsmutableattributedstring in uilabel.
var attributedstring = nsmutableattributedstring("random string example") attributedstring.addattribute(nsforegroundcolorattributename, value: uicolor.redcolor(), range: nsmakerange(1, 3)) tweettextlabel?.text = attributedstring the last line gives me: '_ ??' not convertible '()' can't compile.
i tried with:
tweettextlabel?.text = attributedstring.string but in way lose color attribute
you should set attributedtext property of uilabel, like:
tweettextlabel?.attributedtext = attributedstring
Comments
Post a Comment