Latest | 1.0.4 |
---|---|
Homepage | https://github.com/EmilYo/HSDatePickerViewController |
License | MIT |
Platforms | ios 8.0, requires ARC |
HSDatePickerViewController
is an iOS ViewController for date and time picking, based on awesome look&feel of Dropbox Mailbox application with some customization options.
Usage
Use CocoaPods
pod 'HSDatePickerViewController', '~> 1.0'
or add sources from HSDatePickerViewControllerDemo/HSDatePickerViewController
subfolder to your project.
Import main header:
#import "HSDatePickerViewController.h"
When needed, create HSDatePickerViewController
object:
HSDatePickerViewController *hsdpvc = [[HSDatePickerViewController alloc] init];
present it as modal view controller:
[self presentViewController:hsdpvc animated:YES completion:nil];
To get returning values, you must conform to the protocol HSDatePickerViewControllerDelegate
:
@protocol HSDatePickerViewControllerDelegate <NSObject>
- (void)hsDatePickerPickedDate:(NSDate *)date;
@optional
- (void)hsDatePickerWillDismissWithQuitMethod:(HSDatePickerQuitMethod)method;
- (void)hsDatePickerDidDismissWithQuitMethod:(HSDatePickerQuitMethod)method;
@end
Also, before presenting HSDatePickerViewController
, you can change default values of some properties (check HSDatePickerViewController.h
file for longer description):
@property (nonatomic, assign, getter=shouldDismissOnCancelTouch) BOOL dismissOnCancelTouch;
@property (nonatomic, assign) HSDatePickerMinutesStep minuteStep;
@property (nonatomic, strong) UIColor *mainColor;
@property (nonatomic, strong) NSDate *date;
@property (nonatomic, strong) NSDate *minDate;
@property (nonatomic, strong) NSDate *maxDate;
@property (nonatomic, strong) NSDateFormatter *dateFormatter;
@property (nonatomic, strong) NSDateFormatter *monthAndYearLabelDateFormater;
@property (nonatomic, strong) NSString *confirmButtonTitle;
@property (nonatomic, strong) NSString *backButtonTitle;
Licence (MIT)
Copyright (c) 2015 Kamil Powałowski @kamilpowalowski
For whole licence see LICENCE file.
Latest podspec
{ "name": "HSDatePickerViewController", "version": "1.0.4", "summary": "Customizable iOS view controller in Mailbox app style for picking date and time.", "description": "`HSDatePickerViewController` is an iOS ViewController for date and time picking, based on awesome look&feel of Dropbox [Mailbox](http://www.mailboxapp.com/) application with some customization options.nnDevelopers can change color of component, picker values formaters, default button texts and minut step.", "homepage": "https://github.com/EmilYo/HSDatePickerViewController", "screenshots": [ "https://raw.githubusercontent.com/EmilYo/HSDatePickerViewController/master/screen1.png", "https://raw.githubusercontent.com/EmilYo/HSDatePickerViewController/master/screen2.png" ], "license": { "type": "MIT", "file": "LICENSE" }, "authors": "Kamil Powau0142owski", "social_media_url": "http://twitter.com/kamilpowalowski", "platforms": { "ios": "8.0" }, "source": { "git": "https://github.com/EmilYo/HSDatePickerViewController.git", "tag": "v1.0.4" }, "source_files": [ "Classes", "HSDatePickerViewControllerDemo/HSDatePickerViewController/*.{h,m}" ], "resources": "HSDatePickerViewControllerDemo/HSDatePickerViewController/HSDatePickerViewController.xib", "requires_arc": true }
Fri, 04 Mar 2016 21:06:03 +0000