let baseText = "吾輩は猫である" // フォント .withFont(UIFont) sample1Label.attributedText = baseText.withFont(UIFont.boldSystemFont(ofSize: 24.0)) // 文字色 .withTextColor(UIColor) sample2Label.attributedText = baseText.withTextColor(.orange) // 背景色 .withBackgroundColor(UIColor) sample3Label.attributedText = baseText.withBackgroundColor(.cyan) // カーニング .withKern(Double) sample4Label.attributedText = baseText.wi
![[iOS][Swift3.0] NSAttributedStringが直感的に書けるようになるSwiftyAttributes | DevelopersIO](https://cdn-ak-scissors.b.st-hatena.com/image/square/4b9b98d8423d1943cae402d21764bf51589e811b/height=288;version=1;width=512/https%3A%2F%2Fdevio2023-media.developers.io%2Fwp-content%2Fuploads%2F2014%2F11%2Flogo_swift_400x400.png)