I'm creating a project so that I have two view controllers, connected by a modal segue with an identifier "login_success".
In the primary view controller, I have a text field that takes the input of whatever the user types, and a button to perform the segue.
In the next controller, I have a label that is supposed to print out whatever the user typed.
My code:
DICViewController.h (First View Controller):
#import <UIKit/UIKit.h>
@interface DICViewController : UIViewController <UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *txtUsername;
- (IBAction)sigininClicked:(id)sender;
- (IBAction)backgroundTap:(id)sender;
@end
DICViewController.m:
#import "NewViewController.h"
@interface DICViewController ()
@end
@implementation DICViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)sigininClicked:(id)sender {
{
[self performSegueWithIdentifier:@"login_success" sender:self];
}
}
- (IBAction)backgroundTap:(id)sender {
[self.view endEditing:YES];
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
@end
NewsViewController.h (The other view controller):
#import <UIKit/UIKit.h>
@interface NewViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *steamId; //my label
@end
NewsViewController.m:
No code was added here.
Thanks in advance to anyone that can help.
Again, I would like to be able to set the text in the label equal to the text the user types in the text field.