A Shortcuts-like and highly customizable SFSymbol picker written in Swift.

Overview

SFTintedIconPicker

SFTintedIconPicker is a Shortcuts-like and highly customizable SFSymbol picker written in Swift.

Features

  • Native Appearance
  • Search Symbols
  • Gradient Color Support
  • Native Color Picker (iOS 14+)

And so much more...

Installation

Using CocoaPods

Add pod 'SFTintedIconPicker' to your Podfile and run pod install. Also add use_frameworks! to the Podfile.

target 'MyApp'
pod 'SFTintedIconPicker'
use_frameworks!

Using Swift Package Manager

Open SPM dependency manager through File > Swift Pakcages > Add Package Dependency....

and insert repository URL:

https://github.com/iamStephenFang/SFTintedIconPicker.git

To add dependency in your own package, just specify a package in dependencies of your Package.swift:

.package(
name: "SFTintedIconPicker",
url: "https://github.com/iamStephenFang/SFTintedIconPicker.git",
.upToNextMajor(from: "1.0.0")
)

Note: This has a minimum target iOS version of 13.0.

Configuration

All the configuration endpoints are in the SFTintedIconPickerConfiguration struct.

var config = SFTintedIconPickerConfiguration()
// config.showSystemColorPicker = true
// config.isDebugLogsEnabled = true
// config.isColorSelectionEnabled = true
// Build a picker with your configuration
let picker = SFTintedIconPicker(configuration: config)

Colors

config.colors.pickerTintColor = UIColor.systemBlue
config.colors.pickerBackgroundColor = UIColor.systemGroupedBackground
config.colors.pickerTitleColor = UIColor.label

config.colors.iconAreaBackgroundColor = UIColor.systemBackground

config.colors.colorPickerAreaBackgroundColor = UIColor.systemBackground
config.colors.colorPickerSelectedBorderColor = UIColor.systemFill

config.colors.searchBarBackgroundColor = UIColor.clear
config.colors.searchBarPlaceholderTextColor = UIColor.placeholderText

config.colors.iconPickerCellTintedColor = UIColor.gray
config.colors.iconPickerCellSelectedBackgroundColor = UIColor.systemFill
config.colors.iconPickerAreaBackgroundColor = UIColor.systemBackground

Titles

Rewrite the key value of the strings in the Bundle.main localization file can override the translation provided.

config.titles.navigationTitle = localizedStringInSFTintedIconPicker("SFTintedIconPickerNavigationTitle")
config.titles.navigationFinishTitle = localizedStringInSFTintedIconPicker("SFTintedIconPickerDone")
config.titles.searchBarPlaceHolder = localizedStringInSFTintedIconPicker("SFTintedIconPickerSearchBarPlaceHolder")

Provided Colors

Both solid color and gradient colours are supported.

config.demoIconConfig = [SFTintedColor(backgroundColor: .red),
                        SFTintedColor(backgroundColor: .orange),
                        SFTintedColor(backgroundColor: .yellow),
                        SFTintedColor(backgroundColor: .green),
                        SFTintedColor(backgroundColor: .cyan),
                        SFTintedColor(backgroundColor: .blue),
                        SFTintedColor(backgroundGradientColors: [.black, .purple])]

Component Configuration

config.demoIconConfig.topMargin = CGFloat(16)
config.demoIconConfig.horizontalMargin = CGFloat(16)
config.demoIconConfig.verticalPadding = CGFloat(17)
config.demoIconConfig.iconSize = CGFloat(61)
config.demoIconConfig.cornerRadius = CGFloat(10)

config.colorPickerConfig.topMargin = CGFloat(16)
config.colorPickerConfig.horizontalMargin = CGFloat(16)
config.colorPickerConfig.verticalPadding = CGFloat(16)
config.colorPickerConfig.horizontalPadding = CGFloat(16)
config.colorPickerConfig.lineSpacing = CGFloat(7)
config.colorPickerConfig.interitemSpacing = CGFloat(2)
config.colorPickerConfig.numberOfItemsInRow = Int(6)
config.colorPickerConfig.selectedBorderWidth = CGFloat(2)
config.colorPickerConfig.innerColorSizeRatio = CGFloat(0.7)
config.colorPickerConfig.cornerRadius = CGFloat(10)

config.iconPickerConfig.topMargin = CGFloat(16)
config.iconPickerConfig.bottomMargin = CGFloat(16)
config.iconPickerConfig.horizontalMargin = CGFloat(16)
config.iconPickerConfig.cornerRadius = CGFloat(10)
config.iconPickerConfig.searchBarTopPadding = CGFloat(14)
config.iconPickerConfig.searchBarHorizontalPadding = CGFloat(12)
config.iconPickerConfig.searchBarHeight = CGFloat(33)
config.iconPickerConfig.topPadding = CGFloat(20)
config.iconPickerConfig.bottomPadding = CGFloat(20)
config.iconPickerConfig.horizontalPadding = CGFloat(14)
config.iconPickerConfig.lineSpacing = CGFloat(22)
config.iconPickerConfig.interitemSpacing = CGFloat(15)
config.iconPickerConfig.numberOfItemsInRow = Int(6)
config.iconPickerConfig.cellCornerRadius = CGFloat(7)

Usage

  1. import SFTintedIconPicker.
  2. Set up didFinishPicking callback to handle the SFTintedItem struct.
  3. Present the picker

UIImageView with UIColor & SFSymbols

let config = SFTintedIconPickerConfiguration()
let picker = SFTintedIconPicker(configuration:config)
picker.didFinishPicking { [self, unowned picker] item, cancelled in
    if cancelled {
        picker.dismiss(animated: true, completion: nil)
        return
    }

    if let item = item {
        self.imageView.backgroundColor = item.itemColor.backgroundColor
        self.imageView.image = UIImage(systemName: item.itemSymbol, withConfiguration: UIImage.SymbolConfiguration(pointSize: 20))
        picker.dismiss(animated: true, completion: nil)
    }
}
present(picker, animated: true, completion: nil)

SFTintedIcon with SFTintedItem

var currentItem = SFTintedItem()

var config = SFTintedIconPickerConfiguration()
config.selectedItem = currentItem

let picker = SFTintedIconPicker(configuration:config)
picker.didFinishPicking { [self, unowned picker] item, cancelled in
    if cancelled {
        picker.dismiss(animated: true, completion: nil)
        return
    }

    if let item = item {
        self.currentItem = item
        self.iconView.refreshWithItem(item)
        picker.dismiss(animated: true, completion: nil)
    }
}
present(picker, animated: true, completion: nil)

Roadmap

  • SF Symbols Categories
  • SF Symbols Localization
  • Objective-C Support
  • Cross-platform

License

SFTintedIconPicker is released under the MIT license.
See LICENSE for details.

You might also like...
A very useful and unique iOS library to open image picker in just few lines of code.
A very useful and unique iOS library to open image picker in just few lines of code.

ImagePickerEasy A very simple solution to implement UIImagePickerController() in your application. Requirements Swift 4.2 and above Installation Image

FLImagePicker - A simple image picker supported multiple selection
FLImagePicker - A simple image picker supported multiple selection

FLImagePicker A simple image picker supported multiple selection. Features Multiple selection Gesture supported Dark mode Easy modification Installati

Cordova plugin to display a native color-picker dialog

Color Picker Plugin for Cordova (cordova-plugin-color-picker) Description This plugin allows you to display a color-picker native dialog in iOS and An

WLPhotoPicker - A multifunction photo picker for iOS

WLPhotoPicker Example To run the example project, clone the repo, and run pod in

A simple and customizable activity indicator.
A simple and customizable activity indicator.

日本語 KRActivityIndicatorView KRActivityIndicatorView is a simple and customizable activity indicator written in Swift. You can add KRActivityIndicatorV

DTPhotoViewerController - A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.
DTPhotoViewerController - A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer.

DTPhotoViewerController Example Demo video: https://youtu.be/aTLx4M4zsKk DTPhotoViewerController is very simple to use, if you want to display only on

Easy customizable avatar image asynchronously with progress bar animated
Easy customizable avatar image asynchronously with progress bar animated

JDSwiftAvatarProgress ##Objective-C JDAvatarProgress is available in Objective-C also, JDAvatarProgress Usage To run the example project, clone the re

PhotoEditor SDK: A fully customizable photo editor for your app.

About PhotoEditor SDK for iOS Our SDK provides tools for adding photo editing capabilities to your iOS application with a big variety of filters that

Simple UIView to interact with an Image view like scroll, zoom, pinch and crop.
Simple UIView to interact with an Image view like scroll, zoom, pinch and crop.

Welcome to Interactive Image View, a simple library that provides an easier way to interact with image view, like scroll, zoom and crop. In its core i

Owner
StephenFang
iOS Developer | Photographer
StephenFang
Highly customizable Action Sheet Controller with Assets Preview written in Swift

PPAssetsActionController Play with me ▶️ ?? If you want to play with me, just tap here and enjoy! ?? ?? Show me ?? Try me ?? The easiest way to try me

Pavel Pantus 72 Feb 4, 2022
FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor

FMPhotoPicker is a modern, simple and zero-dependency photo picker with an elegant and customizable image editor Quick demo Batch select/deselect Smoo

Cong Nguyen 648 Dec 27, 2022
Siri Shortcuts extension for calculating NN-based image hash.

NNHash Siri Shortcuts extension for calculating NN-based image hash. Based on nhcalc.

Yi Xie 3 Aug 9, 2021
📸 Instagram-like image picker & filters for iOS

YPImagePicker YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It is feature-rich and highly customizable to match

Yummypets 4k Dec 27, 2022
📸 iMessage-like, Image Picker Controller Provides custom features.

RAImagePicker Description RAImagePicker is a protocol-oriented framework that provides custom features from the built-in Image Picker Edit. Overview O

Rashed Al-Lahaseh 14 Aug 18, 2022
📷 multiple phassets picker for iOS lib. like a facebook

Written in Swift 5.0 TLPhotoPicker enables application to pick images and videos from multiple smart album in iOS, similar to the current facebook app

junhyi park 1.8k Jan 2, 2023
FacebookImagePicker is Facebook album photo picker written in Swift.

Features • Installation • Usage • Translation • License GBHFacebookImagePicker is Facebook's album photo picker written in Swift, built to provide a s

Florian Gabach 231 Dec 17, 2022
Image picker with custom crop rect for iOS written in Swift (Ported over from GKImagePicker)

WDImagePicker Ever wanted a custom crop area for the UIImagePickerController? Now you can have it with WDImagePicker. Just set your custom crop area a

Wu Di 96 Dec 19, 2022
Custom iOS camera and photo picker with editing capabilities

Overview Paparazzo is a component for picking and editing photos. Key Features ?? Taking photos using camera ?? Picking photos from user's photo libra

avito.tech 757 Jan 4, 2023
📹 Your next favorite image and video picker

Description We all love image pickers, don't we? You may already know of ImagePicker, the all in one solution for capturing pictures and selecting ima

HyperRedink 1.4k Dec 25, 2022