Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 아이폰7
- GCD
- 얻는법
- push
- Bitcode
- error
- 샘플
- setting
- 포켓몬 GO
- afterdelay
- simulator
- 페이백
- 공략
- 해몽
- loop
- IOS
- 신도림
- swift3
- 스마트폰
- UITableView
- LG유플러스
- 신도림 테크노마트
- Check
- Xcode
- swift
- Example
- 포켓볼
- 앱스토어
- 보라카이
- UIView
Archives
- Today
- Total
도래울
swift NSMutableAttributedString text color 본문
extension NSMutableAttributedString {
static public func multicolorTextAttribute(fullText : String, colorText : String, fontColor : UIColor, label : UILabel) -> NSMutableAttributedString {
var mutableString = NSMutableAttributedString()
let range = fullText.rangeOfString(colorText)
let index: Int = fullText.startIndex.distanceTo(range!.startIndex)
mutableString = NSMutableAttributedString(string: fullText as String, attributes: [NSFontAttributeName:label.font])
mutableString.addAttribute(NSForegroundColorAttributeName, value: fontColor, range: NSRange(location:index,length:colorText.characters.count))
return mutableString
}
}
'개발 > iOS' 카테고리의 다른 글
xcode downloads all version (0) | 2016.09.23 |
---|---|
cocoapods 최신버전 업데이트 (0) | 2016.09.20 |
swift wkwebview alert (0) | 2016.09.09 |
swift url parsing (0) | 2016.09.09 |
FBSOpenApplicationErrorDomain error 1 (0) | 2016.09.06 |
Comments