Tutorial details

Delay Actions | App Code for Sale | Preview

Delay Actions | iOS Tutorial

How to delay actions

Overview PAGE TOP

Reference: http://www.geekylemon.com/WEBPROTECT-xcodedelayactions.htm

In this tutorial i will be showing you how to delay actions


  • 2 UILabels
  • 1 round rect button

Delaying action in you apps is very useful enabling you to hide content in your apps before revealing it to your user or create splash screens switching views to you main view after a certain period of time

ViewController.h PAGE TOP

@interface ViewController :UIViewController {
IBOutlet UILabel *label1;
IBOutlet UILabel *label2;

ViewController.m PAGE TOP

#import "secondview.h"
@implementation ViewController
-(IBAction)pushme {
label1.text = @"In 5 seconds the second label will be displayed";
    [self performSelector:@selector(delay1) withObject:nil afterDelay:5.0];
-(void)delay1 {
label2.text = @"In 5 seconds the view will switch";
    [self performSelector:@selector(delay2) withObject:nil afterDelay:5.0];
-(void)delay2 {    
secondview *second = [[secondview alloc] initWithNibName:nil bundle:nil];
    [self presentModalViewController:second animated:YES];    

Reference PAGE TOP


0 Comments Leave a comment

Please login in order to leave a comment.

Newest first

to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.