可视化编程之xib
#import "LoginViewController.h"
@interface LoginViewController ()
@end
@implementation LoginViewController
- (IBAction)click:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
#import "RootViewController.h"
#import "LoginViewController.h"
//1、关联控件
//2、关联事件
//3、关联代理
//4、关联手势
@interface RootViewController ()
@property (strong, nonatomic) IBOutlet UILabel *UesrNameLabel;
@property (strong, nonatomic) IBOutlet UILabel *PasswordLabel;
@property (strong, nonatomic) IBOutlet UITextField *textOne;
@property (strong, nonatomic) IBOutlet UITextField *textTwo;
@end
@implementation RootViewController
- (IBAction)login:(UIButton *)sender {
NSLog(@"登录");
[self.view endEditing:YES];
}
- (IBAction)Touch:(UITapGestureRecognizer *)sender {
[self.view endEditing:YES];
}
- (IBAction)regist {
NSLog(@"注册");
[self.view endEditing:YES];
LoginViewController *loginVC = [[LoginViewController alloc] initWithNibName:nil bundle:nil];
[self presentViewController:loginVC animated:YES completion:nil];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self.view endEditing:YES];
// Do any additional setup after loading the view from its nib.
}