0

最初に利用規約ビューを表示し、それを受け入れると、UIImage を使用して背景画像を追加した次のビューに移動するアプリを設計しています。アプリを開き、5 秒後にビューをユーザー ログインに変更しました。ストーリーボードなしでビュー ベースのアプリケーション テンプレートを使用し、ARC も有効にしました。

次のコードを使用しました。

利用規約の同意 [accept.h、accept.m、accept.xib]:

- (IBAction)AcceptPractTandC:(id)sender
{
    PractionerImage *PracImage = [[PractionerImage alloc] init];
    [self presentViewController:PracImage animated:YES completion:nil];
}

画像を 5 秒間表示し、次のビューを表示 [PractionerImage.h、PractionerImage.m、PractionerImage.xib]:

- (void)viewDidLoad
{
    [super viewDidLoad];
    count = 0;
    PracImage = [NSTimer scheduledTimerWithTimeInterval:(1.0/1.0) target:self selector:@selector(PracImageSkip) userInfo:nil repeats:YES];
}

- (void)PracImageSkip
{
    count += 1;
    if (count > 5) {
        ViewController *Intro = [[ViewController alloc]init];
        [self presentViewController:Intro animated:YES completion:nil];
    }
}

ViewController.m、ViewController.h、ViewController.xib ファイルにユーザーの詳細があります。

4

0 に答える 0