diff --git a/Categories/UIKit/UICollectionView/UICollectionView+ARDynamicCacheHeightLayoutCell.h b/Categories/UIKit/UICollectionView/UICollectionView+ARDynamicCacheHeightLayoutCell.h new file mode 100644 index 0000000..f6a1b22 --- /dev/null +++ b/Categories/UIKit/UICollectionView/UICollectionView+ARDynamicCacheHeightLayoutCell.h @@ -0,0 +1,79 @@ +// The MIT License (MIT) +// +// Copyright (c) 2015 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +//https://github.com/AugustRush/UICollectionView-ARDynamicHeightLayoutCell +#import + +@interface UICollectionView (ARDynamicCacheHeightLayoutCell) + +/** + * caculate cell size + * + * @param identifier cell's reuse identifier + * @param indexPath indexPath + * @param configuration fill cell with you feed data + * + * @return the caculated cell's height + */ +- (CGSize)ar_sizeForCellWithIdentifier:(NSString *)identifier + indexPath:(NSIndexPath *)indexPath + configuration: + (void (^)(__kindof UICollectionViewCell *)) + configuration; + +/** + * caculate cell size with a fixed width + * + * @param identifier cell's reuse identifier + * @param indexPath indexPath + * @param fixedWidth your expect width + * @param configuration fill cell with you feed data + * + * @return the caculated cell's height + */ + +- (CGSize)ar_sizeForCellWithIdentifier:(NSString *)identifier + indexPath:(NSIndexPath *)indexPath + fixedWidth:(CGFloat)fixedWidth + configuration: + (void (^)(__kindof UICollectionViewCell *cell)) + configuration; + +/** + * caculate cell size with fixed height + * + * @param identifier cell's reuse identifier + * @param indexPath indexPath + * @param fixedWidth your expect height + * @param configuration fill cell with you feed data + * + * @return the caculated cell's height + */ + +- (CGSize)ar_sizeForCellWithIdentifier:(NSString *)identifier + indexPath:(NSIndexPath *)indexPath + fixedHeight:(CGFloat)fixedHeight + configuration: + (void (^)(__kindof UICollectionViewCell *cell)) + configuration; + +@end diff --git a/Categories/UIKit/UICollectionView/UICollectionView+ARDynamicCacheHeightLayoutCell.m b/Categories/UIKit/UICollectionView/UICollectionView+ARDynamicCacheHeightLayoutCell.m new file mode 100644 index 0000000..16d280b --- /dev/null +++ b/Categories/UIKit/UICollectionView/UICollectionView+ARDynamicCacheHeightLayoutCell.m @@ -0,0 +1,298 @@ +// The MIT License (MIT) +// +// Copyright (c) 2015 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +#import "UICollectionView+ARDynamicCacheHeightLayoutCell.h" +#import + +typedef NS_ENUM(NSUInteger, ARDynamicSizeCaculateType) { + ARDynamicSizeCaculateTypeSize = 0, + ARDynamicSizeCaculateTypeHeight, + ARDynamicSizeCaculateTypeWidth +}; + +#define ARLayoutCellInvalidateValue [NSValue valueWithCGSize:CGSizeZero] + +@implementation UICollectionView (ARDynamicCacheHeightLayoutCell) + ++ (void)load { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self swizzlingMethods]; + }); +} + ++ (void)swizzlingMethods { + SEL selectors[] = { + @selector(registerNib:forCellWithReuseIdentifier:), + @selector(registerClass:forCellWithReuseIdentifier:), + @selector(reloadData), + @selector(reloadSections:), + @selector(deleteSections:), + @selector(moveSection:toSection:), + @selector(reloadItemsAtIndexPaths:), + @selector(deleteItemsAtIndexPaths:), + @selector(moveItemAtIndexPath:toIndexPath:) + }; + + for (int i = 0; i < sizeof(selectors) / sizeof(SEL); i++) { + SEL originalSelector = selectors[i]; + SEL swizzledSelector = NSSelectorFromString([@"ar_" + stringByAppendingString:NSStringFromSelector(originalSelector)]); + + Method originalMethod = class_getInstanceMethod(self, originalSelector); + Method swizzledMethod = class_getInstanceMethod(self, swizzledSelector); + + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + +- (CGSize)ar_sizeForCellWithIdentifier:(NSString *)identifier + indexPath:(NSIndexPath *)indexPath + configuration: + (void (^)(__kindof UICollectionViewCell *)) + configuration { + return [self ar_sizeForCellWithIdentifier:identifier + indexPath:indexPath + fixedValue:0 + caculateType:ARDynamicSizeCaculateTypeSize + configuration:configuration]; +} + +- (CGSize)ar_sizeForCellWithIdentifier:(NSString *)identifier + indexPath:(NSIndexPath *)indexPath + fixedWidth:(CGFloat)fixedWidth + configuration: + (void (^)(__kindof UICollectionViewCell *)) + configuration { + return [self ar_sizeForCellWithIdentifier:identifier + indexPath:indexPath + fixedValue:fixedWidth + caculateType:ARDynamicSizeCaculateTypeWidth + configuration:configuration]; +} + +- (CGSize)ar_sizeForCellWithIdentifier:(NSString *)identifier + indexPath:(NSIndexPath *)indexPath + fixedHeight:(CGFloat)fixedHeight + configuration: + (void (^)(__kindof UICollectionViewCell *)) + configuration { + return [self ar_sizeForCellWithIdentifier:identifier + indexPath:indexPath + fixedValue:fixedHeight + caculateType:ARDynamicSizeCaculateTypeHeight + configuration:configuration]; +} + +- (CGSize)ar_sizeForCellWithIdentifier:(NSString *)identifier + indexPath:(NSIndexPath *)indexPath + fixedValue:(CGFloat)fixedValue + caculateType:(ARDynamicSizeCaculateType)caculateType + configuration: + (void (^)(__kindof UICollectionViewCell *)) + configuration { + BOOL hasCache = [self hasCacheAtIndexPath:indexPath]; + if (hasCache) { + if (![[self sizeCacheAtIndexPath:indexPath] + isEqualToValue:ARLayoutCellInvalidateValue]) { + return [[self sizeCacheAtIndexPath:indexPath] CGSizeValue]; + } + } + + // has no size chche + UICollectionViewCell *cell = + [self templeCaculateCellWithIdentifier:identifier]; + configuration(cell); + CGSize size = CGSizeMake(fixedValue, fixedValue); + if (caculateType != ARDynamicSizeCaculateTypeSize) { + NSLayoutAttribute attribute = caculateType == ARDynamicSizeCaculateTypeWidth + ? NSLayoutAttributeWidth + : NSLayoutAttributeHeight; + NSLayoutConstraint *tempConstraint = + [NSLayoutConstraint constraintWithItem:cell.contentView + attribute:attribute + relatedBy:NSLayoutRelationEqual + toItem:nil + attribute:NSLayoutAttributeNotAnAttribute + multiplier:1 + constant:fixedValue]; + [cell.contentView addConstraint:tempConstraint]; + size = [cell systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; + [cell.contentView removeConstraint:tempConstraint]; + } else { + size = [cell systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; + } + + NSMutableArray *sectionCache = [self sizeCache][indexPath.section]; + NSValue *sizeValue = [NSValue valueWithCGSize:size]; + if (hasCache) { + [sectionCache replaceObjectAtIndex:indexPath.row withObject:sizeValue]; + } else { + [sectionCache insertObject:sizeValue atIndex:indexPath.row]; + } + return size; +} + +#pragma mark - swizzled methods + +- (void)ar_registerClass:(Class)cellClass + forCellWithReuseIdentifier:(NSString *)identifier { + [self ar_registerClass:cellClass forCellWithReuseIdentifier:identifier]; + + id cell = [[cellClass alloc] initWithFrame:CGRectZero]; + NSMutableDictionary *templeCells = [self templeCells]; + templeCells[identifier] = cell; +} + +- (void)ar_registerNib:(UINib *)nib + forCellWithReuseIdentifier:(NSString *)identifier { + [self ar_registerNib:nib forCellWithReuseIdentifier:identifier]; + id cell = [[nib instantiateWithOwner:nil options:nil] lastObject]; + NSMutableDictionary *templeCells = [self templeCells]; + templeCells[identifier] = cell; +} + +#pragma mark - section changes + +- (void)ar_reloadSections:(NSIndexSet *)sections { + [sections enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { + [[self sizeCache] replaceObjectAtIndex:idx withObject:@[].mutableCopy]; + }]; + [self ar_reloadSections:sections]; +} + +- (void)ar_deleteSections:(NSIndexSet *)sections { + [sections enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { + [[self sizeCache] removeObjectAtIndex:idx]; + }]; + [self ar_deleteSections:sections]; +} + +- (void)ar_moveSection:(NSInteger)section toSection:(NSInteger)newSection { + [[self sizeCache] exchangeObjectAtIndex:section withObjectAtIndex:newSection]; + [self ar_moveSection:section toSection:newSection]; +} + +#pragma mark - item changes + +- (void)ar_deleteItemsAtIndexPaths:(NSArray *)indexPaths { + [indexPaths enumerateObjectsUsingBlock:^(NSIndexPath *obj, NSUInteger idx, + BOOL *stop) { + NSMutableArray *section = [self sizeCache][obj.section]; + [section removeObjectAtIndex:obj.row]; + }]; + [self ar_deleteItemsAtIndexPaths:indexPaths]; +} + +- (void)ar_reloadItemsAtIndexPaths:(NSArray *)indexPaths { + [indexPaths enumerateObjectsUsingBlock:^(NSIndexPath *obj, NSUInteger idx, + BOOL *stop) { + if ([self.sizeCache count] > obj.section) { + NSMutableArray *section = [self sizeCache][obj.section]; + section[obj.row] = ARLayoutCellInvalidateValue; + } + }]; + [self ar_reloadItemsAtIndexPaths:indexPaths]; +} + +- (void)ar_moveItemAtIndexPath:(NSIndexPath *)indexPath + toIndexPath:(NSIndexPath *)newIndexPath { + if ([self hasCacheAtIndexPath:indexPath] && + [self hasCacheAtIndexPath:newIndexPath]) { + NSValue *indexPathSizeValue = [self sizeCacheAtIndexPath:indexPath]; + NSValue *newIndexPathSizeValue = [self sizeCacheAtIndexPath:newIndexPath]; + + NSMutableArray *section1 = [self sizeCache][indexPath.section]; + NSMutableArray *section2 = [self sizeCache][newIndexPath.section]; + [section1 replaceObjectAtIndex:indexPath.row + withObject:newIndexPathSizeValue]; + [section2 replaceObjectAtIndex:newIndexPath.row + withObject:indexPathSizeValue]; + } + [self ar_moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; +} + +- (void)ar_reloadData { + [[self sizeCache] removeAllObjects]; + [self ar_reloadData]; +} + +#pragma mark - private methods + +- (NSMutableDictionary *)templeCells { + NSMutableDictionary *templeCells = objc_getAssociatedObject(self, _cmd); + if (templeCells == nil) { + templeCells = @{}.mutableCopy; + objc_setAssociatedObject(self, _cmd, templeCells, + OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return templeCells; +} + +- (id)templeCaculateCellWithIdentifier:(NSString *)identifier { + NSMutableDictionary *templeCells = [self templeCells]; + id cell = [templeCells objectForKey:identifier]; + if (cell == nil) { + NSDictionary *cellNibDict = [self valueForKey:@"_cellNibDict"]; + UINib *cellNIb = cellNibDict[identifier]; + cell = [[cellNIb instantiateWithOwner:nil options:nil] lastObject]; + templeCells[identifier] = cell; + } + + return cell; +} + +#pragma mark - cache methods + +- (NSMutableArray *)sizeCache { + NSMutableArray *cache = objc_getAssociatedObject(self, _cmd); + if (cache == nil) { + cache = @[].mutableCopy; + objc_setAssociatedObject(self, _cmd, cache, OBJC_ASSOCIATION_RETAIN); + } + return cache; +} + +- (BOOL)hasCacheAtIndexPath:(NSIndexPath *)indexPath { + BOOL hasCache = NO; + NSMutableArray *cacheArray = [self sizeCache]; + if (cacheArray.count > indexPath.section) { + if ([cacheArray[indexPath.section] count] > indexPath.row) { + hasCache = YES; + } + } else { + NSUInteger index = cacheArray.count; + for (; index < indexPath.section + 1; index++) { + [cacheArray addObject:@[].mutableCopy]; + } + } + + return hasCache; +} + +- (NSValue *)sizeCacheAtIndexPath:(NSIndexPath *)indexPath { + NSValue *sizeValue = [self sizeCache][indexPath.section][indexPath.row]; + return sizeValue; +} + +@end diff --git a/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.h b/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.h new file mode 100644 index 0000000..5b872fa --- /dev/null +++ b/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.h @@ -0,0 +1,13 @@ +// +// UICollectionViewDemoViewController.h +// IOS-Categories +// +// Created by Jakey on 16/3/14. +// Copyright © 2016年 www.skyfox.org. All rights reserved. +// + +#import "BaseViewController.h" + +@interface UICollectionViewDemoViewController : BaseViewController + +@end diff --git a/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.m b/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.m new file mode 100644 index 0000000..5841ae9 --- /dev/null +++ b/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.m @@ -0,0 +1,37 @@ +// +// UICollectionViewDemoViewController.m +// IOS-Categories +// +// Created by Jakey on 16/3/14. +// Copyright © 2016年 www.skyfox.org. All rights reserved. +// + +#import "UICollectionViewDemoViewController.h" + +@interface UICollectionViewDemoViewController () + +@end + +@implementation UICollectionViewDemoViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.xib b/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.xib new file mode 100644 index 0000000..d787a7a --- /dev/null +++ b/Demos/UIKit/UICollectionView/UICollectionViewDemoViewController.xib @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/IOS-Categories.xcodeproj/project.pbxproj b/IOS-Categories.xcodeproj/project.pbxproj index b9d4fc5..00e7408 100644 --- a/IOS-Categories.xcodeproj/project.pbxproj +++ b/IOS-Categories.xcodeproj/project.pbxproj @@ -322,6 +322,9 @@ A2C12BA81B1C284F00EAD198 /* UITextField+Select.m in Sources */ = {isa = PBXBuildFile; fileRef = A2C12BA71B1C284F00EAD198 /* UITextField+Select.m */; }; A2C12BAB1B1C286C00EAD198 /* UITextView+Select.m in Sources */ = {isa = PBXBuildFile; fileRef = A2C12BAA1B1C286C00EAD198 /* UITextView+Select.m */; }; A2C1ADCE1A58F35400E3BAFF /* UIImage+Orientation.m in Sources */ = {isa = PBXBuildFile; fileRef = A2C1ADCD1A58F35400E3BAFF /* UIImage+Orientation.m */; }; + A2C97D851C96576E00614B98 /* UICollectionViewDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2C97D831C96576E00614B98 /* UICollectionViewDemoViewController.m */; }; + A2C97D861C96576E00614B98 /* UICollectionViewDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A2C97D841C96576E00614B98 /* UICollectionViewDemoViewController.xib */; }; + A2C97D891C9657D300614B98 /* UICollectionView+ARDynamicCacheHeightLayoutCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2C97D881C9657D300614B98 /* UICollectionView+ARDynamicCacheHeightLayoutCell.m */; }; A2CFAEF51A56BD050004A282 /* NSString+Score.m in Sources */ = {isa = PBXBuildFile; fileRef = A2CFAEF41A56BD050004A282 /* NSString+Score.m */; }; A2CFAEF81A56D15C0004A282 /* UIColor+Modify.m in Sources */ = {isa = PBXBuildFile; fileRef = A2CFAEF71A56D15C0004A282 /* UIColor+Modify.m */; }; A2E305651BA927E10006BE4E /* NSURLRequest+ParamsFromDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = A2E305641BA927E10006BE4E /* NSURLRequest+ParamsFromDictionary.m */; }; @@ -949,6 +952,11 @@ A2C12BAA1B1C286C00EAD198 /* UITextView+Select.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITextView+Select.m"; sourceTree = ""; }; A2C1ADCC1A58F35400E3BAFF /* UIImage+Orientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Orientation.h"; sourceTree = ""; }; A2C1ADCD1A58F35400E3BAFF /* UIImage+Orientation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Orientation.m"; sourceTree = ""; }; + A2C97D821C96576E00614B98 /* UICollectionViewDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICollectionViewDemoViewController.h; sourceTree = ""; }; + A2C97D831C96576E00614B98 /* UICollectionViewDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICollectionViewDemoViewController.m; sourceTree = ""; }; + A2C97D841C96576E00614B98 /* UICollectionViewDemoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UICollectionViewDemoViewController.xib; sourceTree = ""; }; + A2C97D871C9657D300614B98 /* UICollectionView+ARDynamicCacheHeightLayoutCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UICollectionView+ARDynamicCacheHeightLayoutCell.h"; sourceTree = ""; }; + A2C97D881C9657D300614B98 /* UICollectionView+ARDynamicCacheHeightLayoutCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UICollectionView+ARDynamicCacheHeightLayoutCell.m"; sourceTree = ""; }; A2CFAEF31A56BD050004A282 /* NSString+Score.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Score.h"; sourceTree = ""; }; A2CFAEF41A56BD050004A282 /* NSString+Score.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Score.m"; sourceTree = ""; }; A2CFAEF61A56D15C0004A282 /* UIColor+Modify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+Modify.h"; sourceTree = ""; }; @@ -1500,6 +1508,7 @@ A22725F21A3E736D0061605B /* UIKit */ = { isa = PBXGroup; children = ( + A2C97D801C96573200614B98 /* UICollectionView */, A29EC2621B5279EC008ABB42 /* UIPopoverController */, A27E93151B381CBA0010C7EA /* UIFont */, A202D9AF1B10336500EAB199 /* UIApplication */, @@ -1849,6 +1858,7 @@ A281FB5B1AC8101F009040DA /* UIKit */ = { isa = PBXGroup; children = ( + A2C97D811C96575400614B98 /* UICollectionView */, A286CB631B5385E2008896C6 /* UIPopoverController */, A27E931F1B381E1B0010C7EA /* UIFont */, A202D9BC1B1038C000EAB199 /* UIBarButtonItem */, @@ -2697,6 +2707,25 @@ path = UIPopoverController; sourceTree = ""; }; + A2C97D801C96573200614B98 /* UICollectionView */ = { + isa = PBXGroup; + children = ( + A2C97D871C9657D300614B98 /* UICollectionView+ARDynamicCacheHeightLayoutCell.h */, + A2C97D881C9657D300614B98 /* UICollectionView+ARDynamicCacheHeightLayoutCell.m */, + ); + path = UICollectionView; + sourceTree = ""; + }; + A2C97D811C96575400614B98 /* UICollectionView */ = { + isa = PBXGroup; + children = ( + A2C97D821C96576E00614B98 /* UICollectionViewDemoViewController.h */, + A2C97D831C96576E00614B98 /* UICollectionViewDemoViewController.m */, + A2C97D841C96576E00614B98 /* UICollectionViewDemoViewController.xib */, + ); + path = UICollectionView; + sourceTree = ""; + }; A2E305621BA927C20006BE4E /* NSURLRequest */ = { isa = PBXGroup; children = ( @@ -3043,6 +3072,7 @@ A2958CDA1B35825F00D7AA0F /* CAMediaTimingFunctionDemoViewController.xib in Resources */, A281FBB81AC812C8009040DA /* NSURLDemoViewController.xib in Resources */, A281FBA41AC8127E009040DA /* NSObjectDemoViewController.xib in Resources */, + A2C97D861C96576E00614B98 /* UICollectionViewDemoViewController.xib in Resources */, A2EF56F41B21D1270005F730 /* NSNotificationCenterDemoViewController.xib in Resources */, A281FB8B1AC81217009040DA /* NSDataDemoViewController.xib in Resources */, A202D9C11B1038DB00EAB199 /* UIBarButtonItemDemoViewController.xib in Resources */, @@ -3215,6 +3245,7 @@ BCB79A0C1AFDF23500C12525 /* UIAlertView+Block.m in Sources */, A2893D971AC3E5FE00EFA90A /* UIButton+Indicator.m in Sources */, A281FB4A1AC80C31009040DA /* WebView+Debug.m in Sources */, + A2C97D851C96576E00614B98 /* UICollectionViewDemoViewController.m in Sources */, A281FBEF1AC8139D009040DA /* UITableViewCellDemoViewController.m in Sources */, A21CF1871B38F708006415E0 /* UINavigationBar+CustomHeight.m in Sources */, A2FD5B471A52636100555EA2 /* UIResponder+Chain.m in Sources */, @@ -3330,6 +3361,7 @@ A28BE3721A3EB31D005C4AC6 /* UIImageView+Addition.m in Sources */, BCB799F61AFDDAA500C12525 /* UIButton+BackgroundColor.m in Sources */, A2958D211B3598D700D7AA0F /* UIImageView+Letters.m in Sources */, + A2C97D891C9657D300614B98 /* UICollectionView+ARDynamicCacheHeightLayoutCell.m in Sources */, A202D99E1B0F919300EAB199 /* UIControl+Block.m in Sources */, A2958CBA1B357AEF00D7AA0F /* UIViewController+StoreKit.m in Sources */, A284C12A1AEBCB7F00D90ED5 /* NSIndexPath+Offset.m in Sources */, diff --git a/IOS-Categories/Controller/RootViewController.m b/IOS-Categories/Controller/RootViewController.m index d78afdd..00185b5 100644 --- a/IOS-Categories/Controller/RootViewController.m +++ b/IOS-Categories/Controller/RootViewController.m @@ -47,7 +47,9 @@ - (void)viewDidLoad { @"UIControl", @"UIApplication", @"UIBarButtonItem", - @"UIPopoverController" + @"UIPopoverController", + @"UICollectionView" + ], @"Foundation":@[@"NSArray", diff --git a/README.md b/README.md index cfe3b27..8e9a938 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ iOS中的各种Objective-C Category, a collection of useful Objective-C Categori * UIWebView * UIWindow * UIPopoverController +* UICollectionView ## QuartzCore * CALayer