Coder Social home page Coder Social logo

sheetycolors's Introduction

Cocoapods platforms Cocoapods(https://cocoapods.org/pods/SheetyColors) Carthage compatible Build Status Twitter

SheetyColors is an action sheet styled color picker for iOS:

  • Based on UIAlertController: The SheetyColors API is based on UIKit's UIAlertController. Simply add buttons to it as you would for any other Action Sheet by defining UIAlertAction instances. Therefore, it nicely integrates with the look & feel of all other native system dialogs.
  • Fully configurable: You can choose between a variety of configurations such as a color model (RGB, HSB, or Grayscale), alpha component support, haptic feedback, and many more.
  • Intuitive UI: Each slider comes with a gradient that gives you an idea of how changing individual slider values affects the resulting color.

Example

To get a quick overview, you can checkout the example app on Appetize.io

To run the example project from Xcode, clone the repo, and run pod install from the Example directory first.

Installation

There are currently three different ways to integrate SheetyColors into your apps.

CocoaPods

use_frameworks!

target 'MyApp' do
  pod 'SheetyColors'
end

Carthage

github "chrs1885/SheetyColors"

Manually

Simply drop SheetyColors.xcodeproj into your project. Also make sure to add SheetyColors.framework to your app’s embedded frameworks found in the General tab of your main project.

Usage

Creating a SheetyColors picker is as easy as creating a normal .actionSheet styled UIAlertController. First, you need to import the library:

import SheetyColors

Next, simply create a SheetyColorsController instance and add some actions to it:

// Create a SheetyColors view with your configuration
let config = SheetyColorsConfig(alphaEnabled: true, initialColor: color, hapticFeedbackEnabled: true, title: "Create a color", type: .rgb)
let sheetyColors = SheetyColorsController(withConfig: config)

// Add a button to accept the selected color
let selectAction = UIAlertAction(title: "Save Color", style: .default, handler: { _ in
	self.color = sheetyColors.color
}
sheetyColors.addAction(selectAction)

// Add a cancel button
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
sheetyColors.addAction(cancelAction)

// Now, present it to the user
present(sheetyColors, animated: true, completion: nil)
        

Please check the documentation for further information on the API.

Contributions

We'd love to see you contributing to this project by proposing or adding features, reporting bugs, or spreading the word. Please have a quick look at our contribution guidelines.

License

SheetyColors is available under the MIT license. See the LICENSE file for more info.

sheetycolors's People

Contributors

chrs1885 avatar

Watchers

 avatar  avatar

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.