Latest 0.1.2
Homepage https://github.com/harushuu/SHDatePicker
License MIT
Platforms ios 8.0, requires ARC
Dependencies Masonry
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Screenshots

image

Installation

With CocoaPods, add this line to your Podfile.

pod 'SHDatePicker'

and run pod install, then you’re all done!

How to use

SHDatePicker *datePicker = [[SHDatePicker alloc] initWithCompleteHandle:^(NSDate *selectedDate, NSString *selectedDateString) {
    code... 
}];
[datePicker updateHiddenStatus];

Summary

A simple date picker.
You can custom minute interval and how many days will show.

First init and calculate default datasource only need 95ms. So do not worry about performance
DataSource only refresh after time interval

default init

// default dayCount is 7 days;
// default minuteInterval is 5 minutes;
// default firstMinuteInterval is 5 * 60 secend;

- (instancetype)initWithCompleteHandle:(SHDatePickerCompleteHandle)completeHandle;

custom init

- (instancetype)initWithDefaultDayCount:(NSInteger)dayCount 
                         minuteInterval:(NSInteger)minuteInterval 
                    firstMinuteInterval:(NSInteger)firstMinuteInterval 
                         customLanguage:(SHDateLanguageModel *)customLanguage 
                         completeHandle:(SHDatePickerCompleteHandle)completeHandle;

custom your local language

Defualt language will same to your local language (only support english or chinese). but you can custom like yourself.
If your language is english or chinese, you will not need setup all property, empty property will auto fill same to your local language.

@interface SHDateLanguageModel : NSObject

@property (nonatomic, strong) NSString *today;
@property (nonatomic, strong) NSString *tomorrow;
@property (nonatomic, strong) NSString *hour;
@property (nonatomic, strong) NSString *minute;

@property (nonatomic, strong) NSString *done;
@property (nonatomic, strong) NSString *cancel;

Requirements

  • iOS 8.0+
  • ARC

Author

@harushuu, [email protected]

License

English: SHDatePicker is available under the MIT license, see the LICENSE file for more information.

Latest podspec

{
    "name": "SHDatePicker",
    "version": "0.1.2",
    "summary": "A simple custom DatePicker.",
    "homepage": "https://github.com/harushuu/SHDatePicker",
    "screenshots": "https://github.com/harushuu/SHDatePicker/raw/master/Screenshots.gif",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "@harushuu": "hunter4n[email protected]"
    },
    "source": {
        "git": "https://github.com/harushuu/SHDatePicker.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "SHDatePicker/*",
    "frameworks": "UIKit",
    "dependencies": {
        "Masonry": [
            "~> 0.6.4"
        ]
    }
}

Pin It on Pinterest

Share This