diff --git a/Podfile b/Podfile index ce799ff..e7b4860 100644 --- a/Podfile +++ b/Podfile @@ -5,8 +5,8 @@ pod "Streamlyne-Cocoa-SDK", :git => 'git@github.com:Streamlyne/Cocoa-SDK.git' pod 'PKRevealController' pod 'MBProgressHUD', '~> 0.8' # Misc +pod 'PromiseKit', '<= 0.9.14' pod 'CocoaLumberjack' -pod 'PromiseKit' pod 'ReactiveCocoa' pod 'TestFlightSDK' pod 'FontAwesomeIconFactory' diff --git a/Podfile.lock b/Podfile.lock index 3a7b6c9..63c473a 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -92,7 +92,7 @@ DEPENDENCIES: - FontAwesomeIconFactory - MBProgressHUD (~> 0.8) - PKRevealController - - PromiseKit + - PromiseKit (<= 0.9.14) - ReactiveCocoa - Streamlyne-Cocoa-SDK (from `git@github.com:Streamlyne/Cocoa-SDK.git`) - TestFlightSDK diff --git a/Streamlyne/Controllers/SLMetricsSheetViewController.m b/Streamlyne/Controllers/SLMetricsSheetViewController.m index f9a34a5..5335e84 100644 --- a/Streamlyne/Controllers/SLMetricsSheetViewController.m +++ b/Streamlyne/Controllers/SLMetricsSheetViewController.m @@ -64,18 +64,28 @@ - (void)didReceiveMemoryWarning - (void) handleRefresh:(UIRefreshControl *)refreshControl { - // Request - [self.refreshControl beginRefreshing]; - [self.attributeCollection reloadRecord] - //[SLAttributeCollection findById:attributeCollection.nid] - .then(^(SLAttributeCollection *record) { - NSLog(@"attributeCollection: %@", record); - self.attributeCollection = record; - [self.tableView reloadData]; - [self.refreshControl endRefreshing]; - }) - .catch(^(NSError *error) { - DDLogInfo(@"Error: %@", error); + dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){ + + // Request + [self.refreshControl beginRefreshing]; + [self.attributeCollection reloadRecord] + //[SLAttributeCollection findById:attributeCollection.nid] + .then(^(SLAttributeCollection *record) { + NSLog(@"attributeCollection: %@", record); + self.attributeCollection = record; + [self.tableView reloadData]; + [self.refreshControl endRefreshing]; + }) + .catch(^(NSError *error) { + DDLogInfo(@"Error: %@", error); + }); + + + //Background Thread + dispatch_async(dispatch_get_main_queue(), ^(void){ + //Run UI Updates + }); + }); } diff --git a/Streamlyne/Storyboards/iPad/Metrics_iPad.storyboard b/Streamlyne/Storyboards/iPad/Metrics_iPad.storyboard index d1188d3..996c0f4 100644 --- a/Streamlyne/Storyboards/iPad/Metrics_iPad.storyboard +++ b/Streamlyne/Storyboards/iPad/Metrics_iPad.storyboard @@ -99,13 +99,13 @@ -