Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Semi-modal view & DatePicker for IOS

branch: master

Merge pull request #15 from stuffmc/dev

Outlet to the toolbar, Option to specify the view the SemiModal is presented on, and currentLocale Date.
latest commit 26fd4e33e0
Nathan Reed authored February 27, 2013
Octocat-spinner-32 Demo Autorotate fixes for iOS6 October 17, 2012
Octocat-spinner-32 Source Using default date insteaf of US. Fixes #14 — yeah, makes more sense … February 27, 2013
Octocat-spinner-32 .gitignore Update ignore list, and new project files July 28, 2012
Octocat-spinner-32 License.txt Initial Commit October 18, 2010
Octocat-spinner-32 Readme.md Minor updates to Readme July 28, 2012
Readme.md

TDSemiModal

Include like this:

#import "TDSemiModal.h"

In order to show up your own modal view, just do this:

[self presentSemiModalViewController:newview];

And to hide:

[self dismissSemiModalViewController:newview];

A semi transparent 'cover' will be automatically put in to stop the user from interacting with the UI behind, so I recommend you set the background on your view to completely transparent.

Obviously you can create whatever semi-modal view you want, but a datepicker must be one of the most common usages, so I knocked up a class for that too.

DatePicker

This project also contains a datepicker view based off the TDSemiModal class.

The datepicker is quite simple to use - just create and display as before:

#import "TDDatePickerController.h"
TDDatePickerController* datePickerView = [[TDDatePickerController alloc]
                              initWithNibName:@"TDDatePickerController"
                              bundle:nil];
datePickerView.delegate = self;
[self presentSemiModalViewController:datePickerView];

Then you just need to catch the following actions in your delegate when the date is actually selected:

-(void)datePickerSetDate:(TDDatePickerController*)viewController;
-(void)datePickerClearDate:(TDDatePickerController*)viewController;
-(void)datePickerCancel:(TDDatePickerController*)viewController;
Something went wrong with that request. Please try again.