テキストを装飾するNSAttributedStringは文字の表現が豊かになり便利な反面、(個人の主観ですが) 記法がすこし面倒です。 今回はそんなNSAttributedStringが書きやすくなるSwiftyAttributesといういライブラリを試してみました。ライセンスはMITです。 https://github.com/eddiekaiger/SwiftyAttributes 検証環境 今回は下記環境で試しています。 Xcode 準備 CocoaPodsで追加します。 use_frameworks! target "ターゲット名" pod 'SwiftyAttributes' post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations
![[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)