NSAttributed String을 긍정적인 마음으로 처리하기 위해 프로그램 라이브러리를 만들었습니다.
전주 
NSAttributedString에 문자를 장식하고 싶다면 다음과 같은 설명이 있다.let label = UILabel(frame: CGRectMake(0,0,100,50))
let str1 = NSMutableAttributedString(
    string: "Hoge", 
    attributes: [
       NSForegroundColorAttributeName: UIColor.redColor(),
       NSFontAttributeName: UIFont.systemFontOfSize(14)
    ]
)
let str2 = NSMutableAttributedString(
    string: "Fuga", 
    attributes: [
       NSForegroundColorAttributeName: UIColor.blueColor(),
       NSFontAttributeName: UIFont(name: "Helvetica", size: 17)!
    ]
)
str1.appendAttributedString(str2)
label.attributedText = str1
이 기술 방법에 대해 나는 좀 까다롭다고 느낀다.
let label = UILabel(frame: CGRectMake(0,0,100,50))
let str1 = NSMutableAttributedString(
    string: "Hoge", 
    attributes: [
       NSForegroundColorAttributeName: UIColor.redColor(),
       NSFontAttributeName: UIFont.systemFontOfSize(14)
    ]
)
let str2 = NSMutableAttributedString(
    string: "Fuga", 
    attributes: [
       NSForegroundColorAttributeName: UIColor.blueColor(),
       NSFontAttributeName: UIFont(name: "Helvetica", size: 17)!
    ]
)
str1.appendAttributedString(str2)
label.attributedText = str1
사용법 
프로그램 라이브러리에 같은 텍스트를 표시할 때 다음과 같습니다.let label = UILabel(frame: CGRectMake(0,0,100,50))
label.attributedText = "Hoge".stylize().color(.redColor) .size(14).attr +
                       "Fuga".stylize().color(.blueColor).size(17).font(.Helvetica).attr
메소드 체인에서 문자열에 스타일을 적용하면 최종 호칭 "attr"가 NSAttributedString으로 변환됩니다.NSAttributedString은 "+"로 연결할 수 있기 때문에 다양한 스타일에 문자열을 더한 느낌으로 쓸 수 있습니다.
범위를 지정할 수도 있습니다. 방금 문자열은let label = UILabel(frame: CGRectMake(0,0,100,50))
label.attributedText = "HogeFuga".stylize()
                         .range(0..<4)       .color(.redColor) .size(14)
                         .range(4..<UInt.max).color(.blueColor).size(17).font(.Helvetica)
                         .attr
다 쓸 수 있어요.
특징. 
let label = UILabel(frame: CGRectMake(0,0,100,50))
label.attributedText = "Hoge".stylize().color(.redColor) .size(14).attr +
                       "Fuga".stylize().color(.blueColor).size(17).font(.Helvetica).attr
let label = UILabel(frame: CGRectMake(0,0,100,50))
label.attributedText = "HogeFuga".stylize()
                         .range(0..<4)       .color(.redColor) .size(14)
                         .range(4..<UInt.max).color(.blueColor).size(17).font(.Helvetica)
                         .attr
이루어지다 
인터페이스 부분은 기본적으로 Builder Pattern(Effective Java version이라고 함)에서 제작되었습니다.
또 이 반에서는 상태에 따라 행동거지를 바꾸고 싶어요.
Phantom Type이라는 기법을 당시의 참고로 이용했다.
먼저 stylize()를 스트링으로 꼭 불러야 하는 이유는 이쪽에서 준비한 반으로 먼저 전환한 뒤 그 안에서 준비한 다양한 방법을 부르고 싶어서다.또 최종적으로 NSAttributed String을 만들기 위해서는 attra를 명확하게 불러야 한다.결국 이 라이브러리의 역할은 String에서 NSAttributed String까지의 제작이다.
 
 최후 
버그도 있을 수 있지만 NSAttributed String에 대해 자신과 같은 고통을 느끼는 사람은 반드시 사용하세요.모두가 기분 좋게 프로그램을 쓸 수 있는 힘이 됐으면 좋겠어요.
                
                    
        
    
    
    
    
    
                
                
                
                
                    
                        
                            
                            
                            Reference
                            
                            이 문제에 관하여(NSAttributed String을 긍정적인 마음으로 처리하기 위해 프로그램 라이브러리를 만들었습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
                                
                                https://qiita.com/kazuhiro4949/items/11693966970af33bdade
                            
                            
                            
                                텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                            
                            
                                
                                
                                 우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)
                            
                            
                        
                    
                
                
                
            
Reference
이 문제에 관하여(NSAttributed String을 긍정적인 마음으로 처리하기 위해 프로그램 라이브러리를 만들었습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kazuhiro4949/items/11693966970af33bdade텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)