https://github.com/xcodebuild/uitimefield
A iOS time input inspired by Android's timer app
https://github.com/xcodebuild/uitimefield
Last synced: about 2 months ago
JSON representation
A iOS time input inspired by Android's timer app
- Host: GitHub
- URL: https://github.com/xcodebuild/uitimefield
- Owner: xcodebuild
- License: mit
- Created: 2015-05-23T01:44:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-24T04:56:38.000Z (over 10 years ago)
- Last Synced: 2025-03-30T09:21:29.976Z (10 months ago)
- Language: Objective-C
- Homepage:
- Size: 188 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://cocoapods.org/?q=UITimeField)
[](https://raw.githubusercontent.com/CodeFalling/UITimeField/master/LICENSE)
[]()
[](https://travis-ci.org/CodeFalling/UITimeField)
# UITimeField
A iOS time input inspire by Android's timer app
# Preview

# Install
## Manual
Copy or use git module to import
```
├── UITimeField
│ ├── UITimeField.h
│ └── UITimeField.m
```
## CocoaPods
```
platform :ios
pod 'UITimeField','1.1.1'
```
# How to use
```objective-c
#import "UITimeField.h"
```
```objective-c
UITimeField *_timeField = [[UITimeField alloc] initWithFrame:CGRectMake(20, 20, 260, 160)];
_timeField.hourUnit=@"h";
_timeField.minuteUnit=@"m";
_timeField.secondUnit=@"s";
[self.view addSubview:_timeField];
```
Or add Custom View with `UITimeField` in your storyboard.
- You can use `_timeField.hour`,`_timeField.minute`,`_timeField.second` to get time.
- You can use `refresh` to let it refresh UI data
- You can use `setInput:(NSString *)timeStr` to set input string.(**notice that timeStr.length must <= 6)
**Notice** that `hour` bigger than 24 and `minute`/`second` bigger than 60 is **allowed**(Just like android timer's behaviour)