-
-
Save radiovisual/1ad438ecdb21478551ae to your computer and use it in GitHub Desktop.
Style the default "Loading" view of PFQueryTableViewController the "hard way" as the current API does not provide this feature.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)stylePFLoadingViewTheHardWay | |
{ | |
UIColor *labelTextColor = [UIColor whiteColor]; | |
UIColor *labelShadowColor = [UIColor darkGrayColor]; | |
UIActivityIndicatorViewStyle activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite; | |
// go through all of the subviews until you find a PFLoadingView subclass | |
for (UIView *subview in self.view.subviews) | |
{ | |
if ([subview class] == NSClassFromString(@"PFLoadingView")) | |
{ | |
// find the loading label and loading activity indicator inside the PFLoadingView subviews | |
for (UIView *loadingViewSubview in subview.subviews) { | |
if ([loadingViewSubview isKindOfClass:[UILabel class]]) | |
{ | |
UILabel *label = (UILabel *)loadingViewSubview; | |
{ | |
label.textColor = labelTextColor; | |
label.shadowColor = labelShadowColor; | |
} | |
} | |
if ([loadingViewSubview isKindOfClass:[UIActivityIndicatorView class]]) | |
{ | |
UIActivityIndicatorView *activityIndicatorView = (UIActivityIndicatorView *)loadingViewSubview; | |
activityIndicatorView.activityIndicatorViewStyle = activityIndicatorViewStyle; | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment