Created
August 21, 2012 15:34
-
-
Save chrisvoss/3416639 to your computer and use it in GitHub Desktop.
Style PFLoadingView in PFQueryTableViewController subclass
This file contains hidden or 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
The same function in Swift is something like this: