Note that there are some explanatory texts on larger screens.

plurals
  1. PONext button brings focus to next UITextField?
    primarykey
    data
    text
    <p>I have three UITextFields and I need the first to tab to the second when next is clicked and the second to tab to the third when next is clicked. And finally the third to hide the keyboard. And as a side question can the user hide the keyboard by clicking anywhere else on the screen on all of the text fields?</p> <p>Here is my code:</p> <pre><code>#import "ViewController.h" @interface ViewController () @end @implementation ViewController -(void) procrastinationNotificationSwitchOnOrOff { if (_procrastinationNotificationSwitch.on) { _notificationOnOffLabel.text = @"Procrastination Notification On"; self.notificationStatus = @"NOTIFICATION ON"; NSLog(self.notificationStatus); } else { _notificationOnOffLabel.text = @"Procrastination Notification Off"; self.notificationStatus = @"NOTIFICATION OFF"; NSLog(self.notificationStatus); } } -(void) presentMessage:(NSString *)message { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Class Stuff" message:message delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; [alert show]; } -(void) notificationStatus:(NSString *)stat { NSString *status = [NSString stringWithFormat:@"%@", stat]; } -(IBAction)addButton:(id)sender { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; dateFormatter.timeZone = [NSTimeZone defaultTimeZone]; dateFormatter.timeStyle = NSDateFormatterShortStyle; dateFormatter.dateStyle = NSDateFormatterShortStyle; NSString *dateTimeString = [dateFormatter stringFromDate: dateTimePicker.date]; NSLog(@"Alarm Set Button Tapped : %@", dateTimeString ); NSString *classNameString = self.className.text; NSLog(classNameString); NSString *assignmentTitleString = self.assignmentTitle.text; NSLog(assignmentTitleString); NSString *assignmentDescriptionString = self.assignmentDescription.text; NSLog(assignmentDescriptionString); NSString *totalStrings = [NSString stringWithFormat:@"Class Name: %@\r Assignment Title: %@ \rAssignment Description: %@ \rDue: %@ \r%@", classNameString, assignmentTitleString, assignmentDescriptionString, dateTimeString, self.notificationStatus]; NSLog(totalStrings); [self presentMessage:totalStrings]; } -(IBAction)returnKeyButton:(id)sender { [sender resignFirstResponder]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [_procrastinationNotificationSwitch addTarget:self action:@selector(procrastinationNotificationSwitchOnOrOff) forControlEvents:UIControlEventValueChanged]; self.notificationStatus = @"NOTIFICATION OFF"; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload