This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Menu" | |
message:@"Select a menu" | |
preferredStyle:UIAlertControllerStyleAlert]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
//todo | |
}]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[self presentViewController:alertView animated:YES completion:^{ | |
NSLog(@"alertView shown!"); | |
}]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showSimpleAlert { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Alert!" | |
message:@"This is an Alert." | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showAlertWithTwoButtons { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Alert!" | |
message:@"This is an Alert." | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showAlertWithTextField { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Menu" | |
message:@"Select a menu" | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addTextFieldWithConfigurationHandler:^(UITextField *textField) { | |
//Customize the textField | |
textField.placeholder = @"User name"; | |
textField.textColor = [UIColor whiteColor]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showAlertWithTwoTextField { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"Menu" | |
message:@"Select a menu" | |
preferredStyle:UIAlertControllerStyleAlert]; | |
[alertView addTextFieldWithConfigurationHandler:^(UITextField *textField) { | |
textField.placeholder = @"User name"; | |
textField.textColor = [UIColor whiteColor]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)showActionSheetWithTwoButtons { | |
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"ActionSheet!" | |
message:@"This is an ActionSheet." | |
preferredStyle:UIAlertControllerStyleActionSheet]; | |
[alertView addAction:[UIAlertAction actionWithTitle:@"ok" | |
style:UIAlertActionStyleDefault | |
handler:^(UIAlertAction *action) { | |
NSLog(@"action - %@", action.title); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary *playerVars = @{@"playsinline" : @1,}; | |
if([self.mYTPlayerView loadWithVideoId:@"M7lc1UVf-VE" playerVars:playerVars]) | |
{ | |
self.mYTPlayerView.delegate = self; | |
} | |
else | |
{ | |
NSLog(@"failed loading player"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)play:(id)sender | |
{ | |
if(self.mYTPlayerView.playerState != kYTPlayerStatePlaying){ | |
[self.mYTPlayerView playVideo]; | |
} | |
} |
OlderNewer