Skip to content

Instantly share code, notes, and snippets.

@eddieespinal
Created May 4, 2015 18:05
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 eddieespinal/25584220d68a607fb888 to your computer and use it in GitHub Desktop.
Save eddieespinal/25584220d68a607fb888 to your computer and use it in GitHub Desktop.
Current Weather Season Objective-C
+ (NSString *)season
{
// Months 12, 01, 02
NSString *currentSeason = @"Winter";
NSDate *date = [[self alloc] init];
NSUInteger month = [date month];
if (month >=3 && month <= 5) {
currentSeason = @"Spring";
}
if (month >= 6 && month <= 8) {
currentSeason = @"Summer";
}
if (month >= 9 && month <= 11) {
currentSeason = @"Fall";
}
return currentSeason;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment