Awesome Open Source
Awesome Open Source

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.


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
swift (7,620) 
ios (3,545) 
cocoa (81) 

Find Open Source By Browsing 7,000 Topics Across 59 Categories

Advertising 📦 10
All Projects
Application Programming Interfaces 📦 124
Applications 📦 192
Artificial Intelligence 📦 78
Blockchain 📦 73
Build Tools 📦 113
Cloud Computing 📦 80
Code Quality 📦 28
Collaboration 📦 32
Command Line Interface 📦 49
Community 📦 83
Companies 📦 60
Compilers 📦 63
Computer Science 📦 80
Configuration Management 📦 42
Content Management 📦 175
Control Flow 📦 213
Data Formats 📦 78
Data Processing 📦 276
Data Storage 📦 135
Economics 📦 64
Frameworks 📦 215
Games 📦 129
Graphics 📦 110
Hardware 📦 152
Integrated Development Environments 📦 49
Learning Resources 📦 166
Legal 📦 29
Libraries 📦 129
Lists Of Projects 📦 22
Machine Learning 📦 347
Mapping 📦 64
Marketing 📦 15
Mathematics 📦 55
Media 📦 239
Messaging 📦 98
Networking 📦 315
Operating Systems 📦 89
Operations 📦 121
Package Managers 📦 55
Programming Languages 📦 245
Runtime Environments 📦 100
Science 📦 42
Security 📦 396
Social Media 📦 27
Software Architecture 📦 72
Software Development 📦 72
Software Performance 📦 58
Software Quality 📦 133
Text Editors 📦 49
Text Processing 📦 136
User Interface 📦 330
User Interface Components 📦 514
Version Control 📦 30
Virtualization 📦 71
Web Browsers 📦 42
Web Servers 📦 26
Web User Interface 📦 210