

Nextrek
@ 67
Nextrek / iOS / Emmanuele Rossi / Trivagolando / Trivagolando / ExtraVC.m
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
// // ExtraVC.m // Trivagolando // // Created by Fabrizio on 07/10/13. // Copyright (c) 2013 Nextrek. All rights reserved. // #import "ExtraVC.h" #import "ExtraReaderVC.h" @interface ExtraVC () { UITextField *alertTextField; } @end @implementation ExtraVC - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { } return self; } - (void)viewDidLoad { [super viewDidLoad]; } #pragma mark - Memory Management - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } #pragma mark - IBActions - (IBAction)fireBtnPressed { [self showAlert:@"Rime" message:@"Per Trivagolare adeguatamente un po' di rime per la mente." tag:999]; } - (void) showAlert:(NSString*)aTitle message:(NSString*)aMessage tag:(int)aTag { UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle: aTitle message:aMessage.length == 0 ? @" " : aMessage delegate:self cancelButtonTitle:@"Annulla" otherButtonTitles:@"OK", nil]; myAlertView.tag = aTag; if(myAlertView.tag != 999) { if(IOS_7) { myAlertView.alertViewStyle = UIAlertViewStylePlainTextInput; alertTextField = [myAlertView textFieldAtIndex:0]; [alertTextField becomeFirstResponder]; } else { alertTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 130.0, 260.0, 25.0)]; [alertTextField setBackgroundColor:[UIColor whiteColor]]; [alertTextField setSecureTextEntry:NO]; [myAlertView addSubview:alertTextField]; [alertTextField becomeFirstResponder]; } } [myAlertView show]; } #pragma mark Alert view method - (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { [alertTextField resignFirstResponder]; if(actionSheet.tag == 999) { if(buttonIndex != 0) { DATAMANAGER.isAllFound = NO; [DATAMANAGER saveExtraState]; [self showAlert:@"Completa le rime - 1" message:@"Di tanti anelli, che ti credi, è la parola di DIGREDI, che lega senza pena la sua sorte a una... \n\n\n" tag:1]; } else { DATAMANAGER.isAllFound = NO; [DATAMANAGER saveExtraState]; } } else if(actionSheet.tag == 1 && buttonIndex != 0){ if([[alertTextField.text lowercaseString] isEqualToString:@"catena"]) { [self showAlert:@"Completa le rime - 2" message:@"Come PEV sembra il treno, se non arriva stai sereno, pare essere un baluardo mentre è solo un po' in.... \n\n\n" tag:2]; } else { DATAMANAGER.isAllFound = NO; [DATAMANAGER saveExtraState]; UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Rima errata, ritenta" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [myAlertView show]; } } else if(actionSheet.tag == 2 && buttonIndex != 0){ if([[alertTextField.text lowercaseString] isEqualToString:@"ritardo"]) { DATAMANAGER.isAllFound = NO; [DATAMANAGER saveExtraState]; [self showAlert:@"Completa le rime - 3" message:@"Del RE ROGA non c'è traccia non si conosce la sua faccia. Per capire chi comanda devi fare una... \n\n\n" tag:3]; } else { DATAMANAGER.isAllFound = NO; [DATAMANAGER saveExtraState]; UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Rima errata, ritenta" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [myAlertView show]; } } else if(actionSheet.tag == 3 && buttonIndex != 0){ if([[alertTextField.text lowercaseString] isEqualToString:@"domanda"]) { DATAMANAGER.isAllFound = YES; [DATAMANAGER saveExtraState]; ExtraReaderVC *extraReaderVC = [[ExtraReaderVC alloc]initWithNibName:@"ExtraReaderVC" bundle:nil]; [self.navigationController pushViewController:extraReaderVC animated:YES]; } else { DATAMANAGER.isAllFound = NO; [DATAMANAGER saveExtraState]; UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Rima errata, ritenta" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [myAlertView show]; } } } @end |
Commits for Nextrek/iOS/Emmanuele Rossi/Trivagolando/Trivagolando/ExtraVC.m
Revision | Author | Commited | Message |
---|---|---|---|
67 |
![]() |
Thu 23 Jan, 2014 14:31:55 +0000 | Emmanuele Rossi apps |