LoginSignup
39
40

More than 5 years have passed since last update.

XCode9で追加されたAsset catalogsのNamed colors supportについて

Last updated at Posted at 2017-06-29

XCode9のAsset Catalogsに以下が追加

Asset Catalogs

  • Named colors support.
  • Added wide gamut app icons.
  • Added a larger iOS marketing to the App Icon set.
  • Added option to preserve image vector data for matching Dynamic Type scaling.
  • Added support for HEIF images.

その中の自分で設定した色をAsset catalogsで管理できるようになる
Named colors support.
について

使い方

Asset CatalogsでNew Color Setが追加されている

スクリーンショット 2017-06-29 19.07.02.png

New Color Setを選択して
以下のように追加

スクリーンショット 2017-06-29 19.19.32.png

これでstoryboardの色変更で呼び出せるように

スクリーンショット 2017-06-29 19.20.34.png

コードで呼ぶ場合は以下のように呼ぶ

label.textColor = UIColor.init(named: "myColor1")

これでアプリのよく使う色を一元管理できるように!!

39
40
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
39
40