AlternativeIcon-Example
所属分类:图标/字体
开发工具:Swift
文件大小:1831KB
下载次数:0
上传日期:2017-07-18 00:21:58
上 传 者:
sh-1993
说明: 从iOS 10.3开始以编程方式更改iOS应用程序的图标
(Change your iOS application s icon programmatically since iOS 10.3)
文件列表:
LICENSE (1067, 2017-07-18)
Project (0, 2017-07-18)
Project\AlternativeIconExample.xcodeproj (0, 2017-07-18)
Project\AlternativeIconExample.xcodeproj\project.pbxproj (22504, 2017-07-18)
Project\AlternativeIconExample.xcodeproj\project.xcworkspace (0, 2017-07-18)
Project\AlternativeIconExample.xcodeproj\project.xcworkspace\contents.xcworkspacedata (167, 2017-07-18)
Project\AlternativeIconExample.xcworkspace (0, 2017-07-18)
Project\AlternativeIconExample.xcworkspace\contents.xcworkspacedata (240, 2017-07-18)
Project\AlternativeIconExample (0, 2017-07-18)
Project\AlternativeIconExample\app delegate (0, 2017-07-18)
Project\AlternativeIconExample\app delegate\AppDelegate.swift (916, 2017-07-18)
Project\AlternativeIconExample\model (0, 2017-07-18)
Project\AlternativeIconExample\model\Icon.swift (1106, 2017-07-18)
Project\AlternativeIconExample\supporting files (0, 2017-07-18)
Project\AlternativeIconExample\supporting files\Assets.xcassets (0, 2017-07-18)
Project\AlternativeIconExample\supporting files\Assets.xcassets\AppIcon.appiconset (0, 2017-07-18)
Project\AlternativeIconExample\supporting files\Assets.xcassets\AppIcon.appiconset\AppIcon-default@2x.png (20398, 2017-07-18)
Project\AlternativeIconExample\supporting files\Assets.xcassets\AppIcon.appiconset\AppIcon-default@3x.png (21179, 2017-07-18)
Project\AlternativeIconExample\supporting files\Assets.xcassets\AppIcon.appiconset\Contents.json (843, 2017-07-18)
Project\AlternativeIconExample\supporting files\Base.lproj (0, 2017-07-18)
Project\AlternativeIconExample\supporting files\Base.lproj\LaunchScreen.storyboard (1740, 2017-07-18)
Project\AlternativeIconExample\supporting files\Info.plist (1908, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons (0, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-default@2x.png (20398, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-default@3x.png (21179, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-facebook@2x.png (26303, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-facebook@3x.png (36485, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-instagram@2x.png (37104, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-instagram@3x.png (55028, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-snapchat@2x.png (23931, 2017-07-18)
Project\AlternativeIconExample\supporting files\icons\AppIcon-snapchat@3x.png (28469, 2017-07-18)
Project\AlternativeIconExample\utility (0, 2017-07-18)
Project\AlternativeIconExample\utility\Alert.swift (810, 2017-07-18)
Project\AlternativeIconExample\view controller (0, 2017-07-18)
Project\AlternativeIconExample\view controller\IconViewController.swift (2672, 2017-07-18)
Project\AlternativeIconExample\view (0, 2017-07-18)
Project\AlternativeIconExample\view\IconTableViewCell.swift (2353, 2017-07-18)
Project\Podfile (156, 2017-07-18)
... ...
# AlternativeIcon
Since iOS 10.3, it is possible to change the application's icon programmatically.
This repository contains simple application demo it.
## Screenshot
![Demo](https://github.com/KimDarren/AlternativeIcon-Example/blob/master/Screenshots/demo.gif?raw=true)
## 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`](https://github.com/KimDarren/AlternativeIcon-Example/blob/master/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.
```plist
CFBundleIcons
CFBundleAlternateIcons
{alternate-icon-key}
CFBundleIconFiles
{alternate-icon-file-name}
UIPrerenderedIcon
CFBundlePrimaryIcon
CFBundleIconFiles
{primary-icon-file-name}
UIPrerenderedIcon
```
* Write some code to set alternative icon.
```swift
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](https://developer.apple.com/ios/human-interface-guidelines/graphics/app-icon#user-selectable-app-icons) to show more details.
## Used libraries.
* [AddWith](https://github.com/KimDarren/AddWith)
* [Then](https://github.com/devxoul/Then)
* [SnapKit](https://github.com/snapkit/snapkit)
## License
**AlternativeIcon-Example** is available under the MIT license. See the [LICENSE](LICENSE) file for more info.
近期下载者:
相关文件:
收藏者: