Skip to content

Instantly share code, notes, and snippets.

@codingwithsara
Created November 9, 2018 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingwithsara/2558f827589d183bc010242d78198520 to your computer and use it in GitHub Desktop.
Save codingwithsara/2558f827589d183bc010242d78198520 to your computer and use it in GitHub Desktop.
[ iOS ] How to create a Stopwatch
//
// ViewController.h
// stopwatch
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
NSTimer *myTimer;
BOOL running;
int count;
}
@property (weak, nonatomic) IBOutlet UILabel *timerLabel;
@property (weak, nonatomic) IBOutlet UIButton *startBtn;
@property (weak, nonatomic) IBOutlet UIButton *resetBtn;
- (IBAction)startBtnPushed:(id)sender;
- (IBAction)resetBtnPushed:(id)sender;
- (void)updateTimer;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment