swift---- 富文本
//富文本设置
var attrbutsString:NSMutableAttributedString = NSMutableAttributedString(string :"1234567890123");
attrbutsString.addAttribute(NSFontAttributeName, value : UIFont(name:"HelveticaNeue-Bold",size:16)!, range: NSMakeRange(0, 5) );
attrbutsString.addAttribute(NSForegroundColorAttributeName, value: UIColor.whiteColor(), range: NSMakeRange(0, 3));
//设置字体颜色
attrbutsString.addAttribute(NSBackgroundColorAttributeName, value: UIColor.greenColor(), range: NSMakeRange(3, 3));
nameLabe.attributedText = attrbutsString;