All Projects → jellybeansoup → Ios Icon Selector

jellybeansoup / Ios Icon Selector

Licence: bsd-2-clause
A drop-in UI component to allow easy selection of alternate icons on iOS.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Ios Icon Selector

Social Circles
Well designed social media buttons.
Stars: ✭ 66 (-14.29%)
Mutual labels:  icons
Uikit Computer Store Template
Computer store e-commerce template
Stars: ✭ 72 (-6.49%)
Mutual labels:  uikit
Ibanimatable
Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.
Stars: ✭ 8,585 (+11049.35%)
Mutual labels:  uikit
Tailwindcss Sketch Kit
💎 Sketch UI kit for Tailwind CSS
Stars: ✭ 68 (-11.69%)
Mutual labels:  uikit
Fruity
Rusty bindings for Apple libraries
Stars: ✭ 72 (-6.49%)
Mutual labels:  uikit
Svg Sprite Webpack Plugin
Webpack plugin for loading/extracting SVGs into a sprite file
Stars: ✭ 73 (-5.19%)
Mutual labels:  icons
Dctb Links
My Personal Links
Stars: ✭ 65 (-15.58%)
Mutual labels:  icons
Iconify Sketch
Sketch plug-in for importing over 70,000 icons from 80+ icon sets, including Material Design Icons, FontAwesome, Jam Icons, Open Emoji and many others.
Stars: ✭ 76 (-1.3%)
Mutual labels:  icons
React Bootstrap Icons
React component for Bootstrap Icons
Stars: ✭ 71 (-7.79%)
Mutual labels:  icons
Blade Icons
A package to easily make use of SVG icons in your Laravel Blade views.
Stars: ✭ 1,181 (+1433.77%)
Mutual labels:  icons
H2d2 Shopicons
Essentials E-Commerce icon pack for free.
Stars: ✭ 67 (-12.99%)
Mutual labels:  icons
Screenadaptationkit
🎨iOS rapidScreen Compatible AdapterKit(Deprecate)
Stars: ✭ 70 (-9.09%)
Mutual labels:  uikit
Sing App
💥Free and open-source admin dashboard template built with Bootstrap 4.5 💥
Stars: ✭ 1,187 (+1441.56%)
Mutual labels:  icons
Xcodeicontagger
Adds version and commit hash as an overlay to your iOS app's icon.
Stars: ✭ 66 (-14.29%)
Mutual labels:  icons
Hass Bha Icons
Additional icons for Home Assistant to accompany the MDI icons
Stars: ✭ 75 (-2.6%)
Mutual labels:  icons
Materialstyleddialogs
A library that shows a beautiful and customizable Material-based dialog with header. API 14+ required.
Stars: ✭ 1,139 (+1379.22%)
Mutual labels:  icons
Svgsprit.es
Public endpoint to generate SVG Sprites
Stars: ✭ 73 (-5.19%)
Mutual labels:  icons
Dtgradientbutton
Easy way to set gradient background to your buttons.
Stars: ✭ 76 (-1.3%)
Mutual labels:  uikit
Lvthemekit
App 多区域皮肤 UIKit Category
Stars: ✭ 75 (-2.6%)
Mutual labels:  uikit
Bootstrap Xd
Bootstrap Design Template — Assets Library — for Adobe XD
Stars: ✭ 74 (-3.9%)
Mutual labels:  uikit

IconSelector

IconSelector

A drop-in UI component to allow easy selection of alternate icons on iOS.

Why?

Adding alternative icons to an iOS app isn't entirely straightforward, but it should be. It's tricky enough to add the entries to your Info.plist, let alone implement UI that you can display on both iPhone and iPad. This library takes care of that last part, and leaves you the much easier task of choosing the icons you want to add!

Features

  • Build on top of UIControl.
  • Adjustable borders, padding, labels, etc.
  • Drop in as-is, or use it to power custom UI.
  • Compatible with iOS 10.3 and above.

IconSelector in Slopes IconSelector in GIFwrapped

Installation

Swift Package Manager (for Apple platforms only)

In Xcode, select File > Swift Packages > Add Package Dependency and enter the repository URL:

https://github.com/jellybeansoup/ios-icon-selector

Carthage

Add the following line to your Cartfile:

github "jellybeansoup/ios-icon-selector"

Getting Started

Begin by defining your alternate icons under the CFBundleIcons key within your app's Info.plist file. Don't forget to include an entry for your app's primary icon!

<key>CFBundleIcons</key>
<dict>
	<key>CFBundleAlternateIcons</key>
	<dict>
		<key>blue</key>
		<dict>
			<key>CFBundleIconFiles</key>
			<array>
				<string>blue-20</string>
				<!-- Include all the relevant sizes! -->
			</array>
		</dict>
	</dict>
	<key>CFBundlePrimaryIcon</key>
	<dict>
		<key>CFBundleIconFiles</key>
		<array>
			<string>green-83.5</string>
			<!-- Include all the relevant sizes! -->
		</array>
	</dict>
</dict>

Next, instantiate the IconSelector and add it to your view heirarchy. The IconSelector class inherits from UIControl, so you'll also need to add a target/action pair to be notified when the user selects a different icon.

// Goes at the top of the file.
import IconSelector

// Retrieve all the icons defined in your app's main bundle.
let icons = Icon.main

// Instantiate the IconSelector with a target/action combo, and add it to your view hierarchy.
let iconSelector = IconSelector(icons: icons)
iconSelector.addTarget(self, action: #selector(iconSelectorDidChange(_:)), for: .valueChanged)
view.addSubview(iconSelector)

Finally, implement the action needed to change the app's icon in response to the user's selection.

@objc func iconSelectorDidChange(_ iconSelector: IconSelector) {
	guard UIApplication.shared.supportsAlternateIcons, let selectedIcon = iconSelector.selectedIcon else {
		return
	}

	UIApplication.shared.setAlternateIcon(selectedIcon, completionHandler: nil)
}

Documentation

You can find complete documentation for this project here. This documentation is automatically generated with jazzy from a GitHub Action and hosted with GitHub Pages.

To generate documentation locally, run make documentation or sh ./scripts/documentation.sh from the repository's root directory. The output will be generated in the docs folder, and should not be included with commits (as the online documentation is automatically generated and updated).

Released under the BSD License

Copyright © 2021 Daniel Farrelly & Curtis Herbert

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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].