Last active
May 7, 2017 20:13
-
-
Save jen2/11d3edeccc1c9b29588fdaeda751b125 to your computer and use it in GitHub Desktop.
Setting up implementation for cityButtonTapped: method in "Build a World Clock in Objective-C."
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
} | |
- (IBAction)cityButtonTapped:(UIButton *)sender { //Gets which button is tapped | |
switch (sender.tag) { | |
case 100: | |
self.timeZone = @"EST"; | |
self.selectedButton = self.nyc; | |
break; | |
case 101: | |
self.timeZone = @"CEST"; | |
self.selectedButton = self.paris; | |
break; | |
case 102: | |
self.timeZone = @"MSD"; | |
self.selectedButton = self.moscow; | |
break; | |
case 103: | |
self.timeZone = @"HKT"; | |
self.selectedButton = self.hongKong; | |
break; | |
case 104: | |
self.timeZone = @"HST"; | |
self.selectedButton = self.honolulu; | |
break; | |
case 105: | |
self.timeZone = @"PST"; | |
self.selectedButton = self.seattle; | |
break; | |
default: | |
self.timeZone = @"EST"; | |
self.selectedButton = self.nyc; | |
break; | |
} | |
[self setTappedCityTimer]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment