Tutorial details

Creating a Tap Counter  | App Code for Sale | Preview

Creating a Tap Counter | iOS Tutorial

How to create a tap counter

Overview PAGE TOP

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

In this tutorial i will be showing you how to create a tap counter


  • 3 round rect buttons
  • 1 UILabel

Tap counter are mostly used in reaction games and are very useful for counting this example enables you to add taps, minus taps and zero the count all together

ViewController.h PAGE TOP

@interface ViewController :UIViewController {
int counter;
IBOutlet UILabel *count;

ViewController.h PAGE TOP

@implementation ViewController
-(IBAction)plus {
counter=counter + 1;
count.text = [NSString stringWithFormat:@"%i",counter];
-(IBAction)minus {
counter=counter - 1;
count.text = [NSString stringWithFormat:@"%i",counter];
-(IBAction)zero {
count.text = [NSString stringWithFormat:@"%i",counter];
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
count.text = @"0";
    [super viewDidLoad];

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.