diff --git a/Limelight/ViewControllers/LoadingFrameViewController.h b/Limelight/ViewControllers/LoadingFrameViewController.h index febafdd..7aeef82 100644 --- a/Limelight/ViewControllers/LoadingFrameViewController.h +++ b/Limelight/ViewControllers/LoadingFrameViewController.h @@ -9,6 +9,6 @@ #import @interface LoadingFrameViewController : UIViewController -@property (weak, nonatomic) IBOutlet NSLayoutConstraint *loadingSpinner; +@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *loadingSpinner; @end diff --git a/Limelight/ViewControllers/LoadingFrameViewController.m b/Limelight/ViewControllers/LoadingFrameViewController.m index 10ffd3b..b76f15d 100644 --- a/Limelight/ViewControllers/LoadingFrameViewController.m +++ b/Limelight/ViewControllers/LoadingFrameViewController.m @@ -16,6 +16,8 @@ - (void)viewDidLoad { [super viewDidLoad]; + // center the loading spinner + self.loadingSpinner.center = CGPointMake(self.view.frame.size.width / 2, self.view.frame.size.height / 2); } - (void)didReceiveMemoryWarning { diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index 67ac909..8aca339 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -52,6 +52,7 @@ static NSArray* appList; _pairAlert = [[UIAlertView alloc] initWithTitle:@"Pairing Failed" message:message delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; [_pairAlert show]; [_discMan startDiscovery]; + [self hideLoadingFrame]; }); } @@ -61,6 +62,7 @@ static NSArray* appList; _pairAlert = [[UIAlertView alloc] initWithTitle:@"Pairing Succesful" message:@"Successfully paired to host" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; [_pairAlert show]; [_discMan startDiscovery]; + [self hideLoadingFrame]; }); } @@ -83,6 +85,7 @@ static NSArray* appList; } else { dispatch_async(dispatch_get_main_queue(), ^{ [self updateApps]; + [self hideLoadingFrame]; }); [_appManager stopRetrieving]; @@ -114,6 +117,7 @@ static NSArray* appList; - (void) hostClicked:(Host *)host { Log(LOG_D, @"Clicked host: %@", host.name); + [self showLoadingFrame]; _selectedHost = host; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ HttpManager* hMan = [[HttpManager alloc] initWithHost:host.address uniqueId:_uniqueId deviceName:deviceName cert:_cert]; @@ -187,6 +191,7 @@ static NSArray* appList; - (void) addHostClicked { Log(LOG_D, @"Clicked add host"); + [self showLoadingFrame]; UIAlertController* alertController = [UIAlertController alertControllerWithTitle:@"Host Address" message:@"Please enter a hostname or IP address" preferredStyle:UIAlertControllerStyleAlert]; [alertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]]; [alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction* action){ @@ -212,6 +217,7 @@ static NSArray* appList; }];}); }]]; [alertController addTextFieldWithConfigurationHandler:nil]; + [self hideLoadingFrame]; [self presentViewController:alertController animated:YES completion:nil]; } diff --git a/iPad.storyboard b/iPad.storyboard index 2ebcfa5..a1810b7 100644 --- a/iPad.storyboard +++ b/iPad.storyboard @@ -242,6 +242,9 @@ + + + diff --git a/iPhone.storyboard b/iPhone.storyboard index 3850866..e406a26 100644 --- a/iPhone.storyboard +++ b/iPhone.storyboard @@ -245,7 +245,7 @@ - +