私は新しく、いくつかの簡単なタスクを理解しようとしています。
私は2つのビューコントローラーを持っています。
1つ目はログイン画面です。
2つのフィールドとログインボタンがあります。
ユーザーがユーザー名とパスワードを正しく入力した場合は、次のビューに移動するだけです。
今、ログインボタンをクリックすると、2番目の画面に移動します。
ユーザー名とパスワード(ハードコーディング可能)をどのように認証できるのか疑問に思っていました。正しくない場合は、次の画面に進まないでください。正しい場合は、次の画面に進みます。
簡単なことは知っていますが、どういうわけか何も見つかりません。
ヘッダーファイル#import
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *userNameField;
@property (weak, nonatomic) IBOutlet UITextField *passwordField;
- (IBAction)LoginButton:(id)sender;
- (IBAction)backgroundClick:(id)sender;
@end
メインファイル
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize userNameField, passwordField;
- (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)LoginButton:(id)sender {
}
- (IBAction)backgroundClick:(id)sender {
[userNameField resignFirstResponder];
[passwordField resignFirstResponder];
}
@end