Skip to content

Instantly share code, notes, and snippets.

View penumbrasoftware's full-sized avatar

Peter Unger penumbrasoftware

View GitHub Profile
NSCalendar* calendar=[NSCalendar currentCalendar];
NSDateComponents* dateComps=[[NSDateComponents alloc] init];
[dateComps setYear:2014];
[dateComps setMonth:1];
[dateComps setDay:21];
NSDate* startDate=[calendar dateFromComponents:dateComps];
@penumbrasoftware
penumbrasoftware / Display A Web View IOS.h
Last active January 4, 2016 02:49
Display A Web View IOS
//.h file
@property (nonatomic, strong) IBOutlet UIWebView *webView;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Title goes here"
message:@"Message goes here?"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"other buttons go here, nil];
[alert show];
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
IAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title goes here" message:@"Message goes here." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[[UINavigationBar appearance] setBarTintColor:[UIColor yellowColor]];
[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:153.0/255.0 alpha:1.0]];