Git Product home page Git Product logo

alternativeicon-example's Introduction

AlternativeIcon

Since iOS 10.3, it is possible to change the application's icon programmatically. This repository contains simple application demo it.

Screenshot

Demo

Requirements

  • Xcode 8.3 or higher.
  • iOS 10.3 or higher.

How to build.

  1. Install cocoapods (if needed) .
  2. Clone this project.
  3. Redirect to /Project directory.
  4. pod install.
  5. Open AlternativeIconExample.xcworkspace with Xcode.
  6. Build and run on your device or simulator.

Alternate icon, step by step

  • Import your alternative icon files to project file.

    • IMPORTANT I don't know why, but it doesn't support .xcassets.
  • Open your project's Info.plist file.

     <key>CFBundleIcons</key>
     	<dict>
     		<key>CFBundleAlternateIcons</key>
     		<dict>
     			<key>{alternate-icon-key}</key>
     			<dict>
     				<key>CFBundleIconFiles</key>
     				<array>
     					<string>{alternate-icon-file-name}</string>
     				</array>
     				<key>UIPrerenderedIcon</key>
     				<false/>
     			</dict>
     		</dict>
     		<key>CFBundlePrimaryIcon</key>
     		<dict>
     			<key>CFBundleIconFiles</key>
     			<array>
     				<string>{primary-icon-file-name}</string>
     			</array>
     			<key>UIPrerenderedIcon</key>
     			<false/>
     		</dict>
     	</dict>
  • Write some code to set alternative icon.

     UIApplication.shared.setAlternateIconName("alternative-icon-key") { error in
     	// Handle error or do something.
     }

Before submit to App Store.

  • The icon must to be user-choosable.
  • The icon must to be related to your app.
  • Click here to show more details.

Used libraries.

License

AlternativeIcon-Example is available under the MIT license. See the LICENSE file for more info.

alternativeicon-example's People

Contributors

kimdarren avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.