Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

simonkern/SKFloatPickerView

Repository files navigation

SKFloatPickerView

by Simon 'Simme' Kern (@simme) - www.simme.org

A subclass of UIPickerView that can be used for float input.

Usage

Add the and header SKFloatPickerView.h and implementation SKFlotPickerView.m files to your project. Add the SKFloatPickerViewDelegate Protocol to your ViewController or wherever you want to handle the user-input.

Init SKFloatPickerView with the following command:

 - (id)initWithInts:(int)aNumberOfIntegers andDecimals:(int)aNumberOfDecimals
		andNegativeNumbers:(BOOL)negativeNumbersAllowed

set the pickerViews property pickerViewDelegate to wherever you implemented the SKFloatPickerViewDelegate protocol. Add SKFloatPickerView to your view as a subview or present it in UIActionSheet.

How to use? - example

	SKFloatPickerView *pickerView = [[SKFloatPickerView alloc]initWithInts:2 andDecimals:2 andNegativeNumbers:YES];
	pickerView.pickerViewDelegate = self;
	[self.view.addsubview:pickerView];

Delegate method example

	- (void)pickerViewChangedValueTo:(float)newFloat
	{
	    self.floatLabel.text = [NSString stringWithFormat:@"%2.2f",newFloat];
	}

License

See LICENSE file. TL;DR: BSD License

About

A UIPickerView that can be used for float input

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published