iPhone:如何添加;学位;UILabel字符串文本中的符号?

iPhone:如何添加;学位;UILabel字符串文本中的符号?,iphone,Iphone,我想将天气报告的“度”符号包括为45摄氏度。如何在字符串中添加度符号以包括该UILabel 如果有人知道,请分享给我 谢谢。Swift中的Shift-option-8? NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"80\u00b0c"]; [attributedString setAttributes:@{NSFontAttributeN

我想将天气报告的“度”符号包括为45摄氏度。如何在字符串中添加度符号以包括该UILabel

如果有人知道,请分享给我


谢谢。

Swift中的Shift-option-8?

NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"80\u00b0c"];
    [attributedString setAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"Helvetica-light" size:10.0]
                                      , NSBaselineOffsetAttributeName : @22} range:NSMakeRange(2, 2)];
    //asign this as a 
examplelabel.attributedtext = attributedString;
cell.lblTemperature.text = NSString(format:"23%@", "\u{00B0}") as String
在Xcode 8.0中: 按Control+Command+空格键或Xcode->Edit->Emoji&Symbols,然后从弹出屏幕中搜索度符号。
您可以轻松添加UILabel或TextView组件。

您真是个伟人!谢谢。我不知道为什么这是问题的形式,但它确实是答案。