All Projects → alexisakers → Alternate Icons

alexisakers / Alternate Icons

Licence: mit
iOS alternate app icons from Asset Catalogs

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Alternate Icons

Appicon
AppIcon generates *.appiconset contains each resolution image for iOS
Stars: ✭ 1,454 (+1142.74%)
Mutual labels:  automation, xcode
Licenseplist
A license list generator of all your dependencies for iOS applications
Stars: ✭ 1,996 (+1605.98%)
Mutual labels:  automation, xcode
Chrome Devtools Protocol
Chrome Devtools Protocol client for PHP
Stars: ✭ 112 (-4.27%)
Mutual labels:  automation
Autobahn
CLI tool written in Swift heavily inspired by https://github.com/fastlane/fastlane
Stars: ✭ 116 (-0.85%)
Mutual labels:  automation
Finicky
A macOS app for customizing which browser to start
Stars: ✭ 2,026 (+1631.62%)
Mutual labels:  xcode
Cloudflare Ddns
Script for dynamically updating a CloudFlare DNS record. (Deprecated)
Stars: ✭ 112 (-4.27%)
Mutual labels:  automation
Scriptsdump
The biggest dump of scripts ever!
Stars: ✭ 114 (-2.56%)
Mutual labels:  automation
Quarantyne
Modern Web Firewall: stop account takeovers, weak passwords, cloud IPs, DoS attacks, disposable emails
Stars: ✭ 113 (-3.42%)
Mutual labels:  automation
Ayakashi
⚡️ Ayakashi.io - The next generation web scraping framework
Stars: ✭ 117 (+0%)
Mutual labels:  automation
Graphql Codegen Hasura
code-generator plugins for hasura/apollo-gql/typescript development
Stars: ✭ 113 (-3.42%)
Mutual labels:  automation
Speculid
Easily Manage Graphics in Xcode Projects
Stars: ✭ 115 (-1.71%)
Mutual labels:  xcode
Perspectivetransform
Calculate CATransform3D between two Perspectives
Stars: ✭ 113 (-3.42%)
Mutual labels:  xcode
Agsimpleimageeditorview
Yet Another Image Editor for iOS.
Stars: ✭ 112 (-4.27%)
Mutual labels:  xcode
Explo
Human and machine readable web vulnerability testing format
Stars: ✭ 114 (-2.56%)
Mutual labels:  automation
Microfeatures Example
📦📱 Example of iOS app built using the uFeatures architecture
Stars: ✭ 112 (-4.27%)
Mutual labels:  xcode
Napalm Salt
Modules for event-driven network automation and orchestration using Salt
Stars: ✭ 116 (-0.85%)
Mutual labels:  automation
Weblogic Deploy Tooling
Oracle WebLogic Server Deploy Tooling
Stars: ✭ 112 (-4.27%)
Mutual labels:  automation
Articles Zh Hans
Articles for NSHipster.cn
Stars: ✭ 113 (-3.42%)
Mutual labels:  xcode
Xcodecleaner
Cleaner for Xcode.app built with react-native-macos
Stars: ✭ 1,505 (+1186.32%)
Mutual labels:  xcode
Linkmapparser
A tool for parsing iOS app link map file.
Stars: ✭ 117 (+0%)
Mutual labels:  xcode

AlternateIcons

Build Status Requires macOS 10.10+ Requires Swift 4.0 Requires Xcode 9

AlternateIcons is a Swift script that automates adding alternate app icons to your iOS app. Group your alternate icons inside an asset catalog, add a build phase and let the script set up your app. No more manual maintenance required!

Installation

From a Pre-built Archive

You can download a pre-compiled binary for the version you want to install in the Releases section of this repository.

Once the archive is expanded, run the install.sh script to install the script on your system.

From Source

You can build and install AlternateIcons from source using Make:

git clone https://github.com/alexaubry/alternate-icons.git
cd alternate-icons
make
make install

Setting up your app

To set up AlternateIcons as an Xcode build phase, do the following:

  1. Add your main icon to your main asset catalog.

  2. Create a new Xcode asset catalog to store your icons, and do not add it to your target.

NOTE In this example, we'll name the catalog "AlternateIcons".

  1. Add your alternate app icons to this asset catalog, using the 'New iOS App Icon' template.

  2. In the Build Phases section of your project target, add a new Run Script phase. The script should be:

    embed-alternate-icons
    

    You now need to specify the path to the Asset Catalog you've created at step 2 under "Input Files", for example:

    $(SRCROOT)/AlternateIcons.xcassets
    

    NOTE: This Run Script phase needs to be the last build phase in your build.

  3. Build your app.

Et voilà! All the icons have automatically been embedded into your app and are ready for use!

Changing the icon

You can now change the icon from your code using:

UIApplication.shared.setAlternateIconName(iconName) { error in
    // handle the result
}

Where iconName is the name of an icon set in your alternate icons asset catalog or nil if you want to return to the default icon.

📚 Read the documentation on developer.apple.com

Demo

A demo project is included in the Demo/ folder, to help you set up your app.

Make sure to install AlternateIcons before you build it.

How it works

Every time you build your app, the script will perform the following steps:

  1. Get the build products location from environment variables passed by Xcode
  2. Parse the Asset Catalog to build a list of icons to embed
  3. Copy the alternate icon files in the app bundle
  4. Update the CFBundleIcon and CFBundleIcon~ipad sections of the Info.plist with the list of alternate icon file names

Authors

Alexis Aubry, [email protected] <@_alexaubry>

Acknowledgements

AlternateIcons uses these open source libraries:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].