Giter Site home page Giter Site logo

rakutou / hsdatepickerviewcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kamilpowalowski/hsdatepickerviewcontroller

0.0 1.0 0.0 1.05 MB

Customizable iOS view controller in Mailbox app style for picking date and time. https://twitter.com/kamilpowalowski

License: MIT License

Ruby 4.46% Objective-C 95.54%

hsdatepickerviewcontroller's Introduction

HSDatePickerViewController

HSDatePickerViewController is an iOS ViewController for date and time picking, based on awesome look&feel of Dropbox Mailbox application with some customization options.

HSDatePickerViewController screen HSDatePickerViewController screen

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.

hsdatepickerviewcontroller's People

Contributors

kamilpowalowski avatar d-32 avatar soberman avatar h1994st avatar

Watchers

Harimoto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.