Giter Site home page Giter Site logo

barkinet / agcircularpicker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freedomcodes/agcircularpicker

0.0 2.0 0.0 128 KB

AGCircularPicker is helpful component for creating a controller aimed to manage any calculated parameter

Home Page: https://agilie.com

License: MIT License

Ruby 2.73% Swift 68.55% Objective-C 2.24% Shell 26.49%

agcircularpicker's Introduction

AGCircularPicker

Made by Agilie CI Status Version License Platform

We are pleased to offer you our new free lightweight plugin named AGCircularPicker.

AGCircularPicker is helpful for creating a controller aimed to manage any calculated parameter. For example, it can be used as a countdown timer or for keeping the score in the game interface.

AGCircularPicker can be customized to meet your individual requirements. The developer can set the number of the controllers and their design by selecting a color, gradient and other similar parameters. In addition, it’s possible to specify the transition type for showing controllers on the screen.

Installation

AGCircularPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "AGCircularPicker"

Demo

Volume Picker Demo Time Picker Demo

Example

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

Usage

import AGCircularPicker

AGCircularPickerView could be used either from Interface Builder by linking outlet or from the code.

The main requirement to let it work is to setup AGCircularPickerOption. Once it is set picker will automatically setup all required data.

public struct AGCircularPickerOption {

    var titleOption: AGCircularPickerTitleOption? = nil
    var valueOption: AGCircularPickerValueOption!
    var colorOption: AGCircularPickerColorOption = AGCircularPickerColorOption()

}

It consists of three option groups: AGCircularPickerTitleOption (defines title, it's color and font), AGCircularPickerValueOption (defines min and max values and number of rounds) and AGCircularPickerColorOption (defines gradient colors, gradient locations and angle)

AGCircularPickerValueOption is required whereas two others are optionals.

If AGCircularPickerTitleOption is empty control will have no title.

If AGCircularPickerColorOption is not set control will use default colors.

AGCircularPickerView has a delegate to notify about any changes

public protocol AGCircularPickerViewDelegate {

    func circularPickerViewDidChangeValue(_ value: Int, color: UIColor, index: Int)
    func circularPickerViewDidEndSetupWith(_ value: Int, color: UIColor, index: Int)
    func didBeginTracking(timePickerView: AGCircularPickerView)
    func didEndTracking(timePickerView: AGCircularPickerView)

}

Let's see how we can use it in practice. First we should link it in the Interface Builder

@IBOutlet weak var circularPickerView: AGCircularPickerView!

Then we should define required options and setup control with it and delegate if needed

override func viewDidLoad() {
    super.viewDidLoad()
    let valueOption = AGCircularPickerValueOption(minValue: 0, maxValue: 100)
    let titleOption = AGCircularPickerTitleOption(title: "volume")
    let option = AGCircularPickerOption(valueOption: valueOption, titleOption: titleOption)
    pickerView.setupPicker(delegate: self, option: option)
}

For more details prease see our example

Troubleshooting

Problems? Check the Issues block to find the solution or create an new issue that we will fix asap. Feel free to contribute.

Author

This iOS visual component is open-sourced by Agilie Team [email protected]

Contributors

Contact us

If you have any questions, suggestions or just need a help with web or mobile development, please email us at [email protected]. You can ask us anything from basic to complex questions.

License

AGCircularPicker is available under The MIT License (MIT) Copyright © 2017 Agilie Team

agcircularpicker's People

Contributors

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