The use of the warning box in iOS9. The user name and password can be entered to achieve page interaction, the following is the entire code of Viewcontroller. Previous errors have not been removed to alert themselves.
1 #import "ViewController.h"2 3 @interfaceViewcontroller ()4@property (nonatomic, retain) uitextfield* user;//User name Input box5@property (nonatomic, retain) uitextfield* pwd;//Password Entry box6 @end7 8 @implementationViewcontroller9 Ten- (void) Viewdidload { One [Super Viewdidload]; ASelf.button = [[UIButton alloc] Initwithframe:cgrectmake (0, -, [[UIScreen mainscreen] Bounds].size.width, -)]; -[Self.button Settitle:@"Jump"Forstate:uicontrolstatenormal]; - [Self.button Settitlecolor:[uicolor Blackcolor] forstate:uicontrolstatenormal]; the [Self.view AddSubview:self.button]; - [Self.button addtarget:self Action: @selector (ClickMe:) forcontrolevents:uicontroleventtouchupinside]; - - } +-(void) ClickMe: (ID) sender{ - + //Initialize the prompt box; AUialertcontroller *alert = [Uialertcontroller alertcontrollerwithtitle:@"Tips"Message@"Are you sure you want to unlock the lock"Preferredstyle:uialertcontrollerstylealert]; at[Alert addtextfieldwithconfigurationhandler:^ (Uitextfield *_nonnull TextField) { -Textfield.placeholder =@"Please enter user name"; - //UIView *myuserview = [[UIView alloc]initwithframe:cgrectmake (n , A, +)]; - //Myuserview.backgroundcolor = [Uicolor redcolor]; - //Self.user = [self createtextfield:@ "Please enter user name" - //Withframe:cgrectmake (a); in //[Myuserview AddSubview:self.user]; - }]; to[Alert addtextfieldwithconfigurationhandler:^ (Uitextfield *_nonnull TextField) { +Textfield.placeholder =@"Please enter your password"; - //self.pwd = [self createtextfield:@ "Please enter password" the //Withframe:cgrectmake (a); * }]; $[Alert addaction:[uialertaction Actionwithtitle:@"Cancel"Style:uialertactionstyledefault handler:^ (Uialertaction *_nonnull Action) {Panax Notoginseng //Click on the button's response event; -NSLog (@"Cancel Prompt"); the }]]; +[Alert addaction:[uialertaction Actionwithtitle:@"Yes"Style:uialertactionstyledefault handler:^ (Uialertaction *_nonnull Action) { A //Click on the button's response event; theNSLog (@"Confirm Prompt"); + }]]; - //popup prompt box; $[Self Presentviewcontroller:alert animated:trueCompletion:nil]; $ - } - //-(uitextfield*) Createtextfield: (nsstring*) Placeholder withframe: (CGRect) Frame { the //uitextfield* field = [[Uitextfield alloc] initwithframe:frame]; - //field.placeholder = placeholder;Wuyi //field.securetextentry = YES; the // //Field.backgroundcolor = [Uicolor redcolor]; - //field.contentverticalalignment = uicontrolcontentverticalalignmentcenter; Wu // - //return field; About //} $- (void) didreceivememorywarning { - [Super didreceivememorywarning]; - //Dispose of any resources the can be recreated. - } A + @endView Code
IOS9 Warning Box