Latest 0.1.1
Homepage https://github.com/s1m-0n/NDCollapseDatePicker
License MIT
Platforms ios 7.0, requires ARC
Authors

[![CI Status](http://img.shields.io/travis/Simon Wicha/NDCollapsiveDatePicker.svg?style=flat)](https://travis-ci.org/Simon Wicha/NDCollapsiveDatePicker)
Version
License
Platform

Installation

NDCollapsiveDatePicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'NDCollapsiveDatePicker'

Usage

To run the example project, clone the repo, and run pod install from the NDCollapsiveDateViewDemo directory first.

Add delegate to protocol into your .h

#import <NDCollapsiveDatePicker/NDCollapsiveDateView.h>

@interface NDViewController : UIViewController <NDCollapsiveDateViewDelegate>

Use one of two init methods:

NDCollapsiveDateView collapsiveDateView = [[NDCollapsiveDateView alloc] initWithFrame:frame title:@"Date" andImage:[UIImage imageNamed:@"calendar"]];
[collapsiveDateView setShown:200.f andHiddenHeight:50];

Or use combined init method:

NDCollapsiveDateView collapsiveDateView = [[NDCollapsiveDateView alloc] initWithFrame:frame title:@"Date" andImage:UIImage imageNamed:@"calendar" hiddenHeight:50 andShownHeight:200.f];

Set delegate:

collapsiveDateView.delegate = self;

include delegate method:

-(void)datePickerViewDidCollapse:(NDCollapsiveDatePickerView *)datePickerView

Example how to get the selected date from NDCollapsiveDateView:

-(void)datePickerViewDidCollapse:(NDCollapsiveDatePickerView *)datePickerView {
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"dd-MM-yyyy"];
    NSString *stringDate = [dateFormatter stringFromDate:datePickerView.date];
    NSLog(@"selected date: %@",stringDate);
}

Feel free to customize the NDCollapsiveDateView

collapsiveDateView.backgroundColor = [UIColor whiteColor];
collapsiveDateView.layer.borderColor = [[UIColor blackColor] CGColor];
...

Screenshot

Animated gif of working NDCollapsiveDateView

Author

Simon Wicha | [email protected]

License

NDCollapsiveDatePicker is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NDCollapsiveDatePicker",
    "version": "0.1.1",
    "summary": "Pic your dates easily!",
    "description": "                       NDCollapsiveDatePicker is a customized UIPickerView embedded in a View that provides easy access to user selected dates. NDCollapsiveDatePicker's view itsself is highly customizable.n",
    "homepage": "https://github.com/s1m-0n/NDCollapseDatePicker",
    "license": "MIT",
    "authors": {
        "Simon Wicha": "[email protected]"
    },
    "source": {
        "git": "https://github.com/s1m-0n/NDCollapsiveDatePicker.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "resources": "NDCollapsiveDateView/Classes/*.{xib}",
    "source_files": "NDCollapsiveDateView/Classes/*.{h,m}",
    "resource_bundles": {
        "NDCollapsiveDatePicker": [
            "NDCollapsiveDateView/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This