Unusual Controllers for Managing Various Characteristics
Our company keeps on creating plugins, templates and open-source libraries which can be useful to developers. Today, we are pleased to offer you a new free lightweight plugin aimed to help you create unusual and expressive controllers for managing various characteristics.
What is Picker?
Picker is a controller for setting and changing any calculated characteristic. For example, it can be used as a spectacular countdown timer or for keeping the score in the game interface for those who’d like to design it in the particularly colorful way.
This controller is easy-to-use, appealing and user-friendly. Any application will definitely gain by being supplemented with our AGCircularPicker plugin.
Customization
Our 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.
So, as you see, AGCircularPicker plugin can be adapted to any app and designed in accordance with its style.
How to use?
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 optional.
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 hould 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)
}
If you are interested in the AGCircularPicker plugin, welcome to this page to find its full description.