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
// UICollectionView Objective-C example | |
- (void)viewWillAppear:(BOOL)animated { | |
[super viewWillAppear:animated]; | |
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject]; | |
if (selectedIndexPath != nil) { | |
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator; | |
if (coordinator != nil) { | |
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) { |
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
- (CGSize)intrinsicContentSize { | |
__block CGFloat minX = CGFLOAT_MAX; | |
__block CGFloat maxX = CGFLOAT_MIN; | |
__block CGFloat minY = CGFLOAT_MAX; | |
__block CGFloat maxY = CGFLOAT_MIN; | |
[[self subviews] enumerateObjectsUsingBlock:^(UIView *subview, NSUInteger idx, BOOL *stop) { | |
// Ignore _UILayoutGuide | |
if (![subview conformsToProtocol:@protocol(UILayoutSupport)]) { | |
// We could use CGRectGet(Min|Max)(X|Y) using the subview.frame, but subview.frame is undefined when a transform is applied. This calculation is transform-friendly. |
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")) |