LoginSignup
21
18

More than 5 years have passed since last update.

ビルドの設定に応じてアプリのアイコンを変える

Posted at

Debug, Releaseだけでなく、さらに細かく変えたいときのやり方。

build configuration をつくる

PROJECT > Info > Configurations で新しいconfigurationをつくる。
ReleaseかDebugか近い方をベースにする。

注意
cocoapodsを使っている場合は、そのままだとモジュールをimportできなくなってしまう。configurationのファイル(Pods-hogefuga)を一旦Noneにして、pod installすること。そうすると勝手に設定してくれる。

アイコンを追加

images.xcassets で新しいアイコンセットを追加

AssetCatalogの設定を変更

TARGETS > Build Settings > Asset Catalog Compiler - Options で先ほど作ったbuild configuration の欄に、追加したアイコンの名前を指定。

以上。build configuration使うと、fastlaneとかでビルドするときもさくっと適用できて便利。

21
18
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
21
18