开发者

How to set a CGFloat to a UILabel's text property

开发者 https://www.devze.com 2022-12-15 05:45 出处:网络
I have a UILabel calle开发者_开发问答d optionsDisplayerBrushSizeLabel who\'s text property I want to set to a CGFloat: brushSizeVal. I understand that the text property needs to be a string but I don\

I have a UILabel calle开发者_开发问答d optionsDisplayerBrushSizeLabel who's text property I want to set to a CGFloat: brushSizeVal. I understand that the text property needs to be a string but I don't know how to convert a CGFloat to an NSString.


You can try:

[NSString stringWithFormat: @"%.2f", myFloat];


Tray this in swift

var a = String (stringInterpolationSegment:myFloat)
0

精彩评论

暂无评论...
验证码 换一张
取 消