Giter Club home page Giter Club logo

iconpicker's Introduction

IconPicker

Full SwiftUI icon picker

My Image My Image

Features

  • tapped icon runs a function passed from your app (the only required parameter)
  • 2 sets of icons - Emojis and SF Symbols
  • History pane with 24 last used icons
  • Pinned pane with your favourite icons (press long to add it to the pane)
  • Text search from both icons sets
  • Customize the following settings:
    • header can be any SwiftUI view
    • connector arrow position when IconPicker displayed in a popup and needed to be visually connected with the trigger
    • connector line color
    • search bar text

Installation

Installation through the Swift Package Manager (SPM): select your project (not the target) and then select the Swift Packages tab. Click + and type IconPicker - SPM should find the package on github.

Make sure to import IconPicker in every file where you use IconPicker.

    import IconPicker

Basic usage code example

import SwiftUI
import IconPicker

struct IconPickerPlayground: View {
    
    func setNewIcon(iconName: String) -> Void {
        print(iconName)
    }
    
    var body: some View {
                            IconPickerView(
                            iconTapAction: self.setNewIcon,
                            searchFieldTitle: "Custom Search Bar Text",
                            headerView: AnyView(Text("ANY TITLE").offset(x:5, y: 12)),
                            triggerSizeAndCoordinates: CGRect(x: 50.0, y: 350.0, width: 50.0, height: 0.0),
                            connectorColor: .orange
                        )
    }
}

The code above produces this view: My Image

All parameters code example

import SwiftUI
import IconPicker

struct IconPickerPlayground: View {
    
    func setNewIcon(iconName: String) -> Void {
        print(iconName)
    }
    
    var body: some View {
                            IconPickerView(
                            iconTapAction: self.setNewIcon,
                            searchFieldTitle: "Custom Search Bar Text",
                            headerView: AnyView(Text("ANY TITLE").offset(x:5, y: 12)),
                            triggerSizeAndCoordinates: CGRect(x: 50.0, y: 350.0, width: 50.0, height: 0.0),
                            connectorColor: .orange
                        )
    }
}

The code above produces this view: My Image

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.