Browse Source

New API Handling Class!

v1.2.2
Abhishek Banthia 9 years ago
parent
commit
de0b888fe6
  1. 6
      Clocker.xcodeproj/project.pbxproj
  2. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  3. 19
      Clocker/API/CLAPI.h
  4. 82
      Clocker/API/CLAPI.m
  5. BIN
      Clocker/Images/ClockHands.gif
  6. BIN
      Clocker/Images/MenuBar.png
  7. BIN
      Clocker/Images/Untitled.png
  8. 4
      Clocker/Model/CLTimezoneData.h
  9. 50
      Clocker/Model/CLTimezoneData.m
  10. 355
      Clocker/Preferences/CLPreferencesViewController.m
  11. 21
      Media.xcassets/MenuBar.imageset/Contents.json
  12. BIN
      Media.xcassets/MenuBar.imageset/Untitled.png

6
Clocker.xcodeproj/project.pbxproj

@ -29,6 +29,7 @@
9A5951F51C1D3D81009C17AA /* CLTimezoneCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5951F41C1D3D81009C17AA /* CLTimezoneCellView.m */; };
9A5951FA1C1D5214009C17AA /* iVersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A5951F91C1D5214009C17AA /* iVersion.m */; };
9A5951FD1C1D592D009C17AA /* iVersion.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9A5951FC1C1D592D009C17AA /* iVersion.bundle */; };
9A63620A1C432F68004AD010 /* CLAPI.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A6362091C432F68004AD010 /* CLAPI.m */; };
9A8605AE1BEC148400A810A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605AD1BEC148400A810A4 /* main.m */; };
9A8605B31BEC14A600A810A4 /* ColoredButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B21BEC14A600A810A4 /* ColoredButton.m */; };
9A8605B61BEC14BE00A810A4 /* MenubarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A8605B41BEC14BE00A810A4 /* MenubarController.m */; };
@ -110,6 +111,8 @@
9A5951F91C1D5214009C17AA /* iVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = iVersion.m; path = "Clocker/Updated Version/iVersion.m"; sourceTree = "<group>"; };
9A5951FC1C1D592D009C17AA /* iVersion.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = iVersion.bundle; path = "Clocker/Updated Version/iVersion.bundle"; sourceTree = "<group>"; };
9A5B1A8D1BECDFB700A77C68 /* Clocker.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = Clocker.entitlements; path = Clocker/Clocker.entitlements; sourceTree = "<group>"; };
9A6362081C432F68004AD010 /* CLAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CLAPI.h; path = Clocker/API/CLAPI.h; sourceTree = "<group>"; };
9A6362091C432F68004AD010 /* CLAPI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CLAPI.m; path = Clocker/API/CLAPI.m; sourceTree = "<group>"; };
9A8605AD1BEC148400A810A4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Clocker/main.m; sourceTree = "<group>"; };
9A8605B21BEC14A600A810A4 /* ColoredButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ColoredButton.m; path = Clocker/ColoredButton.m; sourceTree = "<group>"; };
9A8605B41BEC14BE00A810A4 /* MenubarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MenubarController.m; path = Clocker/MenubarController.m; sourceTree = "<group>"; };
@ -195,6 +198,8 @@
children = (
9A5951BB1C1D0A8D009C17AA /* CommonStrings.m */,
9A5951BC1C1D0A8D009C17AA /* CommonStrings.h */,
9A6362081C432F68004AD010 /* CLAPI.h */,
9A6362091C432F68004AD010 /* CLAPI.m */,
);
name = Utilties;
sourceTree = "<group>";
@ -514,6 +519,7 @@
9A8605BF1BEC14F600A810A4 /* BackgroundView.m in Sources */,
9A87DAC51C358FA800A8CF3B /* DTConstants.m in Sources */,
9AB9357B1C1AD8F7001285A0 /* CLRatingCellView.m in Sources */,
9A63620A1C432F68004AD010 /* CLAPI.m in Sources */,
9A87DAC81C358FA800A8CF3B /* DTTimePeriodChain.m in Sources */,
9A87DAC71C358FA800A8CF3B /* DTTimePeriod.m in Sources */,
9A3247321C25FD3A00CF6B6E /* CLCustomSliderCell.m in Sources */,

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

19
Clocker/API/CLAPI.h

@ -0,0 +1,19 @@
//
// CLAPI.h
// Clocker
//
// Created by Abhishek Banthia on 1/10/16.
//
//
#import <Foundation/Foundation.h>
@interface CLAPI : NSObject
+ (void)dataTaskWithServicePath:(NSString *)path
bySender:(id)sender
withCompletionBlock:(void (^)(NSError *error, NSDictionary *dictionary))completionBlock;
+ (BOOL)isUserConnectedToInternet;
@end

82
Clocker/API/CLAPI.m

@ -0,0 +1,82 @@
//
// CLAPI.m
// Clocker
//
// Created by Abhishek Banthia on 1/10/16.
//
//
#import "CLAPI.h"
#import "Reachability.h"
@implementation CLAPI
+ (void)dataTaskWithServicePath:(NSString *)path
bySender:(id)sender
withCompletionBlock:(void (^)(NSError *error, NSDictionary *dictionary))completionBlock
{
__block NSDictionary *responseDictionary = [NSDictionary dictionary];
NSView *currentView = [sender view];
NSURLSessionConfiguration *sessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
sessionConfig.timeoutIntervalForRequest = 20;
NSURLSession *session = [NSURLSession sessionWithConfiguration:sessionConfig];
NSError *error;
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@", path]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
[request setHTTPMethod:@"GET"];
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSURLSessionDataTask *dataTask = [session
dataTaskWithRequest:request
completionHandler:^(NSData *data,
NSURLResponse *response,
NSError *error)
{
/*Check if any error. If nil then proceed*/
if (error == nil)
{
NSHTTPURLResponse *httpResp = (NSHTTPURLResponse*) response;
if (httpResp.statusCode == 200)
{
responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
completionBlock(error, responseDictionary);
}
}
/*Error is not nil. Show error*/
else
{
completionBlock(error, nil);
}
}];
[dataTask resume];
}
+ (BOOL)isUserConnectedToInternet
{
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [reachability currentReachabilityStatus];
if (networkStatus == NotReachable)
{
return NO;
}
return YES;
}
@end

BIN
Clocker/Images/ClockHands.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
Clocker/Images/MenuBar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
Clocker/Images/Untitled.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

4
Clocker/Model/CLTimezoneData.h

@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
@interface CLTimezoneData : NSObject
@interface CLTimezoneData : NSObject<NSCoding>
@property (strong, nonatomic) NSString *customLabel;
@property (strong, nonatomic) NSString *formattedAddress;
@ -17,4 +17,6 @@
@property (strong, nonatomic) NSString *sunsetTime;
@property (strong, nonatomic) NSString *timezoneID;
- (BOOL)saveObjectToPreferences:(CLTimezoneData *)object;
@end

50
Clocker/Model/CLTimezoneData.m

@ -15,4 +15,54 @@
}
- (BOOL)saveObjectToPreferences:(CLTimezoneData *)object
{
NSData *encodedObject = [NSKeyedArchiver archivedDataWithRootObject:object];
NSMutableArray *array = [NSMutableArray new];
[array addObject:encodedObject];
[[NSUserDefaults standardUserDefaults] setObject:array forKey:@"checking"];
[self getCustomObject];
return YES;
}
- (void)getCustomObject
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *encodedObject = [defaults objectForKey:@"checking"];
CLTimezoneData *object = [NSKeyedUnarchiver unarchiveObjectWithData:encodedObject[0]];
NSLog(@"Object:%@", object.place_id);
}
- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeObject:self.place_id forKey:@"place_id"];
[coder encodeObject:self.formattedAddress forKey:@"formattedAddress"];
[coder encodeObject:self.customLabel forKey:@"customLabel"];
[coder encodeObject:self.sunriseTime forKey:@"sunriseTime"];
[coder encodeObject:self.sunsetTime forKey:@"sunsetTime"];
[coder encodeObject:self.timezoneID forKey:@"timezoneID"];
}
- (instancetype)initWithCoder:(NSCoder *)coder
{
if (self == [super init])
{
self.place_id = [coder decodeObjectForKey:@"place_id"];
self.formattedAddress = [coder decodeObjectForKey:@"formattedAddress"];
self.customLabel = [coder decodeObjectForKey:@"customLabel"];
self.sunsetTime = [coder decodeObjectForKey:@"sunsetTime"];
self.sunriseTime = [coder decodeObjectForKey:@"sunriseTime"];
self.timezoneID = [coder decodeObjectForKey:@"timezoneID"];
}
return self;
}
@end

355
Clocker/Preferences/CLPreferencesViewController.m

@ -12,8 +12,9 @@
#import "ApplicationDelegate.h"
#import <QuartzCore/QuartzCore.h>
#import "CommonStrings.h"
#import "Reachability.h"
#import <Parse/Parse.h>
#import "CLAPI.h"
NSString *const CLSearchPredicateKey = @"SELF CONTAINS[cd]%@";
NSString *const CLPreferencesViewNibIdentifier = @"PreferencesWindow";
@ -353,7 +354,10 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
return YES;
}
-(NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id<NSDraggingInfo>)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)dropOperation
-(NSDragOperation)tableView:(NSTableView *)tableView
validateDrop:(id<NSDraggingInfo>)info
proposedRow:(NSInteger)row
proposedDropOperation:(NSTableViewDropOperation)dropOperation
{
return NSDragOperationEvery;
}
@ -371,11 +375,7 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
self.placeholderLabel.hidden = NO;
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [reachability currentReachabilityStatus];
if (networkStatus == NotReachable)
{
if (![CLAPI isUserConnectedToInternet]) {
self.placeholderLabel.placeholderString = CLNoInternetConnectivityError;
return;
}
@ -389,97 +389,67 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
NSString *urlString = [NSString stringWithFormat:CLLocationSearchURL, searchString];
NSURL *url = [NSURL URLWithString:urlString];
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
request.HTTPMethod = @"GET";
[request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request addValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSError *error = nil;
if (!error) {
self.dataTask= [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (!error) {
NSHTTPURLResponse *httpResp = (NSHTTPURLResponse*) response;
if (httpResp.statusCode == 200) {
dispatch_async(dispatch_get_main_queue(), ^{
self.placeholderLabel.placeholderString = CLEmptyString;
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:data
options:kNilOptions
error:nil];
if ([json[@"status"] isEqualToString:@"ZERO_RESULTS"]) {
self.placeholderLabel.placeholderString = @"No results! 😔 Try entering the exact name.";
self.activityInProgress = NO;
return;
}
for (NSDictionary *dictionary in json[@"results"])
{
NSDictionary *latLang = [[dictionary objectForKey:@"geometry"] objectForKey:@"location"];
NSString *latitude = latLang[@"lat"];
NSString *longitude = latLang[@"lng"];
NSString *formattedAddress = [dictionary objectForKey:@"formatted_address"];
NSDictionary *totalPackage = @{@"latitude":latitude,
@"longitude" : longitude,
CLTimezoneName:formattedAddress,
CLCustomLabel: CLEmptyString,
CLTimezoneID : CLEmptyString,
CLPlaceIdentifier : dictionary[CLPlaceIdentifier]};
[self.filteredArray addObject:totalPackage];
}
self.activityInProgress = NO;
[self.availableTimezoneTableView reloadData];
});
}
else
{
dispatch_async(dispatch_get_main_queue(), ^{
self.placeholderLabel.placeholderString = [error.localizedDescription isEqualToString:@"The Internet connection appears to be offline."] ?
CLNoInternetConnectivityError : CLTryAgainMessage;
self.activityInProgress = NO;
});
}
}
}];
[self.dataTask resume];
}
[CLAPI dataTaskWithServicePath:urlString
bySender:self
withCompletionBlock:^(NSError *error, NSDictionary *json) {
dispatch_async(dispatch_get_main_queue(), ^{
if (error)
{
self.placeholderLabel.placeholderString = [error.localizedDescription isEqualToString:@"The Internet connection appears to be offline."] ?
CLNoInternetConnectivityError : CLTryAgainMessage;
self.activityInProgress = NO;
return;
}
self.placeholderLabel.placeholderString = CLEmptyString;
if ([json[@"status"] isEqualToString:@"ZERO_RESULTS"]) {
self.placeholderLabel.placeholderString = @"No results! 😔 Try entering the exact name.";
self.activityInProgress = NO;
return;
}
for (NSDictionary *dictionary in json[@"results"])
{
NSDictionary *latLang = [[dictionary objectForKey:@"geometry"] objectForKey:@"location"];
NSString *latitude = latLang[@"lat"];
NSString *longitude = latLang[@"lng"];
NSString *formattedAddress = [dictionary objectForKey:@"formatted_address"];
NSDictionary *totalPackage = @{@"latitude":latitude,
@"longitude" : longitude,
CLTimezoneName:formattedAddress,
CLCustomLabel: CLEmptyString,
CLTimezoneID : CLEmptyString,
CLPlaceIdentifier : dictionary[CLPlaceIdentifier]};
[self.filteredArray addObject:totalPackage];
}
self.activityInProgress = NO;
[self.availableTimezoneTableView reloadData];
});
}];
}
- (void)getTimeZoneForLatitude:(NSString *)latitude andLongitude:(NSString *)longitude
{
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [reachability currentReachabilityStatus];
if (networkStatus == NotReachable)
{
{
if (![CLAPI isUserConnectedToInternet]) {
dispatch_async(dispatch_get_main_queue(), ^{
self.placeholderLabel.placeholderString = CLNoInternetConnectivityError;
self.activityInProgress = NO;
self.filteredArray = [NSMutableArray array];
[self.availableTimezoneTableView reloadData];
self.placeholderLabel.placeholderString = CLNoInternetConnectivityError;
self.activityInProgress = NO;
self.filteredArray = [NSMutableArray array];
[self.availableTimezoneTableView reloadData];
});
return;
}
self.searchField.placeholderString = @"Fetching data might take some time!";
@ -489,120 +459,97 @@ NSString *const CLTryAgainMessage = @"Try again, maybe?";
NSString *urlString = [NSString stringWithFormat:@"http://api.geonames.org/timezoneJSON?lat=%@&lng=%@&username=abhishaker17", latitude, longitude];
NSURL *url = [NSURL URLWithString:urlString];
NSURLSessionConfiguration *config = [NSURLSessionConfiguration defaultSessionConfiguration];
NSURLSession *session = [NSURLSession sessionWithConfiguration:config];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
request.HTTPMethod = @"GET";
[request addValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[request addValue:@"application/json" forHTTPHeaderField:@"Accept"];
NSError *error = nil;
if (!error) {
self.dataTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (!error) {
NSHTTPURLResponse *httpResp = (NSHTTPURLResponse*) response;
if (httpResp.statusCode == 200) {
dispatch_async(dispatch_get_main_queue(), ^{
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:data
options:kNilOptions
error:nil];
if (json.count == 0) {
self.activityInProgress = NO;
self.placeholderLabel.placeholderString = @"No results found! ! 😔 Try Again?";
return;
}
if ([json[@"status"][@"message"] isEqualToString:@"the hourly limit of 2000 credits for abhishaker17 has been exceeded. Please throttle your requests or use the commercial service."])
{
self.activityInProgress = NO;
self.placeholderLabel.placeholderString = @"API limit reached. Try again in an hour.?";
self.searchField.placeholderString = @"We rely on free APIs which have limits.";
return;
}
NSString *filteredAddress = [self.filteredArray[self.availableTimezoneTableView.selectedRow] objectForKey:CLTimezoneName];
NSRange range = [filteredAddress rangeOfString:@","];
if (range.location != NSNotFound)
{
filteredAddress = [[self.filteredArray[self.availableTimezoneTableView.selectedRow] objectForKey:CLTimezoneName ] substringWithRange:NSMakeRange(0, range.location)];
}
NSMutableDictionary *newTimezone = [NSMutableDictionary dictionary];
if (json[@"sunrise"]) {
[newTimezone setObject:json[@"sunrise"] forKey:@"sunriseTime"];
}
if (json[@"sunset"]) {
[newTimezone setObject:json[@"sunset"] forKey:@"sunsetTime"];
}
[newTimezone setObject:json[@"timezoneId"] forKey:CLTimezoneID];
[newTimezone setObject:filteredAddress forKey:CLTimezoneName];
[newTimezone setObject:self.filteredArray[self.availableTimezoneTableView.selectedRow][CLPlaceIdentifier] forKey:CLPlaceIdentifier];
[newTimezone setObject:latitude forKey:@"latitude"];
[newTimezone setObject:longitude forKey:@"longitude"];
[newTimezone setObject:CLEmptyString forKey:@"nextUpdate"];
[newTimezone setObject:CLEmptyString forKey:CLCustomLabel];
NSArray *defaultPreference = [[NSUserDefaults standardUserDefaults] objectForKey:CLDefaultPreferenceKey];
if (defaultPreference == nil)
{
defaultPreference = [[NSMutableArray alloc] init];
}
NSMutableArray *newArray = [[NSMutableArray alloc] initWithArray:defaultPreference];
[newArray addObject:newTimezone];
[[NSUserDefaults standardUserDefaults] setObject:newArray forKey:CLDefaultPreferenceKey];
self.filteredArray = [NSMutableArray array];
[self.availableTimezoneTableView reloadData];
[self refereshTimezoneTableView];
[self refreshMainTableview];
[self.timezonePanel close];
self.placeholderLabel.placeholderString = CLEmptyString;
self.searchField.placeholderString = @"Enter a city, state or country name";
self.availableTimezoneTableView.hidden = NO;
self.activityInProgress = NO;
});
}
}
else
{
self.placeholderLabel.placeholderString = [error.localizedDescription isEqualToString:@"The Internet connection appears to be offline."] ?
CLNoInternetConnectivityError : CLTryAgainMessage;
[CLAPI dataTaskWithServicePath:urlString
bySender:self
withCompletionBlock:^(NSError *error, NSDictionary *json) {
if (!error)
{
dispatch_async(dispatch_get_main_queue(), ^{
self.activityInProgress = NO;
}
}];
[self.dataTask resume];
}
if (json.count == 0) {
self.activityInProgress = NO;
self.placeholderLabel.placeholderString = @"No results found! ! 😔 Try Again?";
return;
}
if ([json[@"status"][@"message"] isEqualToString:@"the hourly limit of 2000 credits for abhishaker17 has been exceeded. Please throttle your requests or use the commercial service."])
{
self.activityInProgress = NO;
self.placeholderLabel.placeholderString = @"API limit reached. Try again in an hour.?";
self.searchField.placeholderString = @"We rely on free APIs which have limits.";
return;
}
NSString *filteredAddress = [self.filteredArray[self.availableTimezoneTableView.selectedRow] objectForKey:CLTimezoneName];
NSRange range = [filteredAddress rangeOfString:@","];
if (range.location != NSNotFound)
{
filteredAddress = [[self.filteredArray[self.availableTimezoneTableView.selectedRow] objectForKey:CLTimezoneName ] substringWithRange:NSMakeRange(0, range.location)];
}
NSMutableDictionary *newTimezone = [NSMutableDictionary dictionary];
if (json[@"sunrise"]) {
[newTimezone setObject:json[@"sunrise"] forKey:@"sunriseTime"];
}
if (json[@"sunset"]) {
[newTimezone setObject:json[@"sunset"] forKey:@"sunsetTime"];
}
[newTimezone setObject:json[@"timezoneId"] forKey:CLTimezoneID];
[newTimezone setObject:filteredAddress forKey:CLTimezoneName];
[newTimezone setObject:self.filteredArray[self.availableTimezoneTableView.selectedRow][CLPlaceIdentifier] forKey:CLPlaceIdentifier];
[newTimezone setObject:latitude forKey:@"latitude"];
[newTimezone setObject:longitude forKey:@"longitude"];
[newTimezone setObject:CLEmptyString forKey:@"nextUpdate"];
[newTimezone setObject:CLEmptyString forKey:CLCustomLabel];
NSArray *defaultPreference = [[NSUserDefaults standardUserDefaults] objectForKey:CLDefaultPreferenceKey];
if (defaultPreference == nil)
{
defaultPreference = [[NSMutableArray alloc] init];
}
NSMutableArray *newArray = [[NSMutableArray alloc] initWithArray:defaultPreference];
[newArray addObject:newTimezone];
[[NSUserDefaults standardUserDefaults] setObject:newArray forKey:CLDefaultPreferenceKey];
self.filteredArray = [NSMutableArray array];
[self.availableTimezoneTableView reloadData];
[self refereshTimezoneTableView];
[self refreshMainTableview];
[self.timezonePanel close];
self.placeholderLabel.placeholderString = CLEmptyString;
self.searchField.placeholderString = @"Enter a city, state or country name";
self.availableTimezoneTableView.hidden = NO;
self.activityInProgress = NO;
});
}
else
{
self.placeholderLabel.placeholderString = [error.localizedDescription isEqualToString:@"The Internet connection appears to be offline."] ?
CLNoInternetConnectivityError : CLTryAgainMessage;
self.activityInProgress = NO;
}
}];
}
@end

21
Media.xcassets/MenuBar.imageset/Contents.json vendored

@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Untitled.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

BIN
Media.xcassets/MenuBar.imageset/Untitled.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Loading…
Cancel
Save