spotwhole.blogg.se

Appicon swift
Appicon swift














In the snippet above, we first check if the badge command is available or else we print a warning.

#APPICON SWIFT INSTALL#

This lane will look like the following snippet.ĪPP_PROJECT = ".xcodeproj" desc "Add a shield on the App Icon" lane :add_shield do | options | puts options version = get_version_number ( xcodeproj: APP_PROJECT ) if options = "dev" add_badge ( shield: "Dev- # " -no_badge fiĮcho "warning: 'badge' is not installed, run 'sudo /usr/bin/gem install badge'" fi When this command is completed, we can open the fastlane/Fastfile and add a new lane to add the shield on the app icon. To install it, we will run the command bundle exec fastlane add_plugin badge on the root directory of the project. To begin with, there is a fastlane plugin for badge. If not, you can refer to my previous posts and find out how you can setup both Bundler and fastlane on an iOS project.

appicon swift appicon swift

Note: I make the assumption that you already have Bundler and fastlane setup. Let’s first see how we can use it from the Fastfile! The fastlane way If you prefer to create something custom, then ImageMagick is the way to go, as it allows for more freedom and creativity in regards to the position and the style of the shield. badge itself is using ImageMagick but it restricts you to a specific style for the shield. Note: As an alternative to this gem, you can use ImageMagick. It also offers the option to either use it directly from the command like or from fastlane’s Fastfile. Let’s get started! badge gemĪs I mentioned before, badge is a Ruby gem that makes it easy to add a shield or a badge on the app icon. In this post, we are going to see how we can use a Ruby gem name badge to add this shield on the app icon. Wouldn’t it make it much easier to recognize them if we were to add a shield on the app icon with information about the configuration and the version for dev or stage builds?

appicon swift

For example, we could add this info on the app name, present it somewhere inside the app, use a settings bundle to show it in the app settings or use a different app icon.Īmong all these options, I personally believe that the most efficient, when using the app, is to change the app icon. The good news is that, with a little imagination, we can find multiple alternatives to ease this issue. Have you ever ended up in a situation where you have multiple builds of the same app installed on a device and you find it hard to figure out the configuration and the version of each build? Wouldn’t it be great if we could make it easier to identify which one is which with a single glance?














Appicon swift