All Projects → gabrieloc → PadControl

gabrieloc / PadControl

Licence: MIT license
A UIControl subclass for two-dimension directional input

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Labels

Projects that are alternatives of or similar to PadControl

UIGradientSlider
GradientSlider is a UIControl subclass which is similar to UISlider, but with a linear gradient coloring the slider’s track. Useful for creating color pickers. Initially fork of https://github.com/jonhull/GradientSlider rewritten to Obj-C
Stars: ✭ 28 (-52.54%)
Mutual labels:  uicontrol
Lgbutton
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.
Stars: ✭ 2,216 (+3655.93%)
Mutual labels:  uicontrol
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+2815.25%)
Mutual labels:  uicontrol
Selector-Closure
A light way to convert objc target-action style to closure
Stars: ✭ 14 (-76.27%)
Mutual labels:  uicontrol
ContainerView
Using Container View in iOS with Swift
Stars: ✭ 34 (-42.37%)
Mutual labels:  uicontrol
ALRadioButtons
RadioButtons for iOS. Inherited from UIControl, support 2 native styles, fully customizable.
Stars: ✭ 65 (+10.17%)
Mutual labels:  uicontrol
UltraWeekCalendar
UltraWeekCalendar - Clean UI to select day through weeks
Stars: ✭ 29 (-50.85%)
Mutual labels:  uicontrol
LiveFader
@IBDesignable Horizontal or vertical UIControl subclass that can start from bottom or middle of the control.
Stars: ✭ 21 (-64.41%)
Mutual labels:  uicontrol
SKTogglesControl
SKTogglesControl is a customizable multiple toggle UIControl based on SVSegmentedControl
Stars: ✭ 29 (-50.85%)
Mutual labels:  uicontrol

PadControl

Carthage compatible

A UIControl subclass for two-dimension directional input. Supports customization of color and other cosmetic attributes. To use with Carthage, add the following to your Cartfile:

github "gabrieloc/PadControl"

If you prefer not using Carthage, simply copy PadControl.swift into your project.

Example Usage

Create an instance of PadControl by providing direction information (PadDirections). To create a unidirectional pad in your View Controller:

override func viewDidLoad() {
	super.viewDidLoad

	let pad = PadControl(directions: [.up])
	pad.addTarget(self, action: #selector(padUpdated), for: .valueChanged)
	view.addSubview(pad)
}

@objc func padUpdated(sender: PadControl) {
	let value = sender.value(forDirection: .up)
	// value is a a Double from 0 - 1
}

Passing different directions allows for a variety of uni or bidirectional inputs to be created. For example: X axis Y axis Both axis corner

To view all of these examples, refer to the app target in the main .xcodeproj entitled PadControl Example.

FYI

PadControl is used by SCARAB, a free quadcopter controller for iOS. If you are interested in building quadcopter software, SCARAB is also powered by QuadKit, a framework for communicating with generic quadcopters.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].