Skip to content

Instantly share code, notes, and snippets.

@Tricertops
Last active September 2, 2015 11:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tricertops/ea723f64160b4c71c9bb to your computer and use it in GitHub Desktop.
Save Tricertops/ea723f64160b4c71c9bb to your computer and use it in GitHub Desktop.
Objective-C method that returns Emoji symbol of a clock for any given hour.
- (NSString *)clockForHour:(NSUInteger)hour {
NSArray *clocks = @[ @"πŸ•›", @"πŸ•", @"πŸ•‘", @"πŸ•’", @"πŸ•“", @"πŸ•”",
@"πŸ••", @"πŸ•–", @"πŸ•—", @"πŸ•˜", @"πŸ•™", @"πŸ•š" ];
NSUInteger index = hour % clocks.count;
return [clocks objectAtIndex:index];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment