Repository: forkingdog/UITableView-FDTemplateLayoutCell
Branch: master
Commit: c624e4db4c6b
Files: 41
Total size: 137.3 KB
Directory structure:
gitextract_z1fhkhrn/
├── .gitignore
├── Classes/
│ ├── UITableView+FDIndexPathHeightCache.h
│ ├── UITableView+FDIndexPathHeightCache.m
│ ├── UITableView+FDKeyedHeightCache.h
│ ├── UITableView+FDKeyedHeightCache.m
│ ├── UITableView+FDTemplateLayoutCell.h
│ ├── UITableView+FDTemplateLayoutCell.m
│ ├── UITableView+FDTemplateLayoutCellDebug.h
│ └── UITableView+FDTemplateLayoutCellDebug.m
├── Demo/
│ ├── Demo/
│ │ ├── Base.lproj/
│ │ │ ├── LaunchScreen.xib
│ │ │ └── Main.storyboard
│ │ ├── FDAppDelegate.h
│ │ ├── FDAppDelegate.m
│ │ ├── FDFeedCell.h
│ │ ├── FDFeedCell.m
│ │ ├── FDFeedEntity.h
│ │ ├── FDFeedEntity.m
│ │ ├── FDFeedViewController.h
│ │ ├── FDFeedViewController.m
│ │ ├── Images.xcassets/
│ │ │ ├── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ ├── breaddoge.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── doge.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── forkingdog.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── phil.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── sark.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── sinojerk.imageset/
│ │ │ │ └── Contents.json
│ │ │ └── sunnyxx.imageset/
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── data.json
│ │ └── main.m
│ └── Demo.xcodeproj/
│ ├── project.pbxproj
│ └── project.xcworkspace/
│ └── contents.xcworkspacedata
├── FDTemplateCell.xcworkspace/
│ ├── contents.xcworkspacedata
│ └── xcshareddata/
│ └── FDTemplateCell.xcscmblueprint
├── FDTemplateLayoutCell/
│ ├── FDTemplateLayoutCell.xcodeproj/
│ │ ├── project.pbxproj
│ │ └── xcshareddata/
│ │ └── xcschemes/
│ │ └── FDTemplateLayoutCell.xcscheme
│ └── FDTemplateLayoutcell/
│ ├── FDTemplateLayoutCell.h
│ └── Info.plist
├── LICENSE
├── README.md
└── UITableView+FDTemplateLayoutCell.podspec
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
#Pods/
================================================
FILE: Classes/UITableView+FDIndexPathHeightCache.h
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 <UIKit/UIKit.h>
@interface FDIndexPathHeightCache : NSObject
// Enable automatically if you're using index path driven height cache
@property (nonatomic, assign) BOOL automaticallyInvalidateEnabled;
// Height cache
- (BOOL)existsHeightAtIndexPath:(NSIndexPath *)indexPath;
- (void)cacheHeight:(CGFloat)height byIndexPath:(NSIndexPath *)indexPath;
- (CGFloat)heightForIndexPath:(NSIndexPath *)indexPath;
- (void)invalidateHeightAtIndexPath:(NSIndexPath *)indexPath;
- (void)invalidateAllHeightCache;
@end
@interface UITableView (FDIndexPathHeightCache)
/// Height cache by index path. Generally, you don't need to use it directly.
@property (nonatomic, strong, readonly) FDIndexPathHeightCache *fd_indexPathHeightCache;
@end
@interface UITableView (FDIndexPathHeightCacheInvalidation)
/// Call this method when you want to reload data but don't want to invalidate
/// all height cache by index path, for example, load more data at the bottom of
/// table view.
- (void)fd_reloadDataWithoutInvalidateIndexPathHeightCache;
@end
================================================
FILE: Classes/UITableView+FDIndexPathHeightCache.m
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 "UITableView+FDIndexPathHeightCache.h"
#import <objc/runtime.h>
typedef NSMutableArray<NSMutableArray<NSNumber *> *> FDIndexPathHeightsBySection;
@interface FDIndexPathHeightCache ()
@property (nonatomic, strong) FDIndexPathHeightsBySection *heightsBySectionForPortrait;
@property (nonatomic, strong) FDIndexPathHeightsBySection *heightsBySectionForLandscape;
@end
@implementation FDIndexPathHeightCache
- (instancetype)init {
self = [super init];
if (self) {
_heightsBySectionForPortrait = [NSMutableArray array];
_heightsBySectionForLandscape = [NSMutableArray array];
}
return self;
}
- (FDIndexPathHeightsBySection *)heightsBySectionForCurrentOrientation {
return UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation) ? self.heightsBySectionForPortrait: self.heightsBySectionForLandscape;
}
- (void)enumerateAllOrientationsUsingBlock:(void (^)(FDIndexPathHeightsBySection *heightsBySection))block {
block(self.heightsBySectionForPortrait);
block(self.heightsBySectionForLandscape);
}
- (BOOL)existsHeightAtIndexPath:(NSIndexPath *)indexPath {
[self buildCachesAtIndexPathsIfNeeded:@[indexPath]];
NSNumber *number = self.heightsBySectionForCurrentOrientation[indexPath.section][indexPath.row];
return ![number isEqualToNumber:@-1];
}
- (void)cacheHeight:(CGFloat)height byIndexPath:(NSIndexPath *)indexPath {
self.automaticallyInvalidateEnabled = YES;
[self buildCachesAtIndexPathsIfNeeded:@[indexPath]];
self.heightsBySectionForCurrentOrientation[indexPath.section][indexPath.row] = @(height);
}
- (CGFloat)heightForIndexPath:(NSIndexPath *)indexPath {
[self buildCachesAtIndexPathsIfNeeded:@[indexPath]];
NSNumber *number = self.heightsBySectionForCurrentOrientation[indexPath.section][indexPath.row];
#if CGFLOAT_IS_DOUBLE
return number.doubleValue;
#else
return number.floatValue;
#endif
}
- (void)invalidateHeightAtIndexPath:(NSIndexPath *)indexPath {
[self buildCachesAtIndexPathsIfNeeded:@[indexPath]];
[self enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
heightsBySection[indexPath.section][indexPath.row] = @-1;
}];
}
- (void)invalidateAllHeightCache {
[self enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection removeAllObjects];
}];
}
- (void)buildCachesAtIndexPathsIfNeeded:(NSArray *)indexPaths {
// Build every section array or row array which is smaller than given index path.
[indexPaths enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) {
[self buildSectionsIfNeeded:indexPath.section];
[self buildRowsIfNeeded:indexPath.row inExistSection:indexPath.section];
}];
}
- (void)buildSectionsIfNeeded:(NSInteger)targetSection {
[self enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
for (NSInteger section = 0; section <= targetSection; ++section) {
if (section >= heightsBySection.count) {
heightsBySection[section] = [NSMutableArray array];
}
}
}];
}
- (void)buildRowsIfNeeded:(NSInteger)targetRow inExistSection:(NSInteger)section {
[self enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
NSMutableArray<NSNumber *> *heightsByRow = heightsBySection[section];
for (NSInteger row = 0; row <= targetRow; ++row) {
if (row >= heightsByRow.count) {
heightsByRow[row] = @-1;
}
}
}];
}
@end
@implementation UITableView (FDIndexPathHeightCache)
- (FDIndexPathHeightCache *)fd_indexPathHeightCache {
FDIndexPathHeightCache *cache = objc_getAssociatedObject(self, _cmd);
if (!cache) {
cache = [FDIndexPathHeightCache new];
objc_setAssociatedObject(self, _cmd, cache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
return cache;
}
@end
// We just forward primary call, in crash report, top most method in stack maybe FD's,
// but it's really not our bug, you should check whether your table view's data source and
// displaying cells are not matched when reloading.
static void __FD_TEMPLATE_LAYOUT_CELL_PRIMARY_CALL_IF_CRASH_NOT_OUR_BUG__(void (^callout)(void)) {
callout();
}
#define FDPrimaryCall(...) do {__FD_TEMPLATE_LAYOUT_CELL_PRIMARY_CALL_IF_CRASH_NOT_OUR_BUG__(^{__VA_ARGS__});} while(0)
@implementation UITableView (FDIndexPathHeightCacheInvalidation)
- (void)fd_reloadDataWithoutInvalidateIndexPathHeightCache {
FDPrimaryCall([self fd_reloadData];);
}
+ (void)load {
// All methods that trigger height cache's invalidation
SEL selectors[] = {
@selector(reloadData),
@selector(insertSections:withRowAnimation:),
@selector(deleteSections:withRowAnimation:),
@selector(reloadSections:withRowAnimation:),
@selector(moveSection:toSection:),
@selector(insertRowsAtIndexPaths:withRowAnimation:),
@selector(deleteRowsAtIndexPaths:withRowAnimation:),
@selector(reloadRowsAtIndexPaths:withRowAnimation:),
@selector(moveRowAtIndexPath:toIndexPath:)
};
for (NSUInteger index = 0; index < sizeof(selectors) / sizeof(SEL); ++index) {
SEL originalSelector = selectors[index];
SEL swizzledSelector = NSSelectorFromString([@"fd_" stringByAppendingString:NSStringFromSelector(originalSelector)]);
Method originalMethod = class_getInstanceMethod(self, originalSelector);
Method swizzledMethod = class_getInstanceMethod(self, swizzledSelector);
method_exchangeImplementations(originalMethod, swizzledMethod);
}
}
- (void)fd_reloadData {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection removeAllObjects];
}];
}
FDPrimaryCall([self fd_reloadData];);
}
- (void)fd_insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[sections enumerateIndexesUsingBlock:^(NSUInteger section, BOOL *stop) {
[self.fd_indexPathHeightCache buildSectionsIfNeeded:section];
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection insertObject:[NSMutableArray array] atIndex:section];
}];
}];
}
FDPrimaryCall([self fd_insertSections:sections withRowAnimation:animation];);
}
- (void)fd_deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[sections enumerateIndexesUsingBlock:^(NSUInteger section, BOOL *stop) {
[self.fd_indexPathHeightCache buildSectionsIfNeeded:section];
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection removeObjectAtIndex:section];
}];
}];
}
FDPrimaryCall([self fd_deleteSections:sections withRowAnimation:animation];);
}
- (void)fd_reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[sections enumerateIndexesUsingBlock: ^(NSUInteger section, BOOL *stop) {
[self.fd_indexPathHeightCache buildSectionsIfNeeded:section];
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection[section] removeAllObjects];
}];
}];
}
FDPrimaryCall([self fd_reloadSections:sections withRowAnimation:animation];);
}
- (void)fd_moveSection:(NSInteger)section toSection:(NSInteger)newSection {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[self.fd_indexPathHeightCache buildSectionsIfNeeded:section];
[self.fd_indexPathHeightCache buildSectionsIfNeeded:newSection];
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection exchangeObjectAtIndex:section withObjectAtIndex:newSection];
}];
}
FDPrimaryCall([self fd_moveSection:section toSection:newSection];);
}
- (void)fd_insertRowsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[self.fd_indexPathHeightCache buildCachesAtIndexPathsIfNeeded:indexPaths];
[indexPaths enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) {
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection[indexPath.section] insertObject:@-1 atIndex:indexPath.row];
}];
}];
}
FDPrimaryCall([self fd_insertRowsAtIndexPaths:indexPaths withRowAnimation:animation];);
}
- (void)fd_deleteRowsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[self.fd_indexPathHeightCache buildCachesAtIndexPathsIfNeeded:indexPaths];
NSMutableDictionary<NSNumber *, NSMutableIndexSet *> *mutableIndexSetsToRemove = [NSMutableDictionary dictionary];
[indexPaths enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) {
NSMutableIndexSet *mutableIndexSet = mutableIndexSetsToRemove[@(indexPath.section)];
if (!mutableIndexSet) {
mutableIndexSet = [NSMutableIndexSet indexSet];
mutableIndexSetsToRemove[@(indexPath.section)] = mutableIndexSet;
}
[mutableIndexSet addIndex:indexPath.row];
}];
[mutableIndexSetsToRemove enumerateKeysAndObjectsUsingBlock:^(NSNumber *key, NSIndexSet *indexSet, BOOL *stop) {
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
[heightsBySection[key.integerValue] removeObjectsAtIndexes:indexSet];
}];
}];
}
FDPrimaryCall([self fd_deleteRowsAtIndexPaths:indexPaths withRowAnimation:animation];);
}
- (void)fd_reloadRowsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[self.fd_indexPathHeightCache buildCachesAtIndexPathsIfNeeded:indexPaths];
[indexPaths enumerateObjectsUsingBlock:^(NSIndexPath *indexPath, NSUInteger idx, BOOL *stop) {
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
heightsBySection[indexPath.section][indexPath.row] = @-1;
}];
}];
}
FDPrimaryCall([self fd_reloadRowsAtIndexPaths:indexPaths withRowAnimation:animation];);
}
- (void)fd_moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath {
if (self.fd_indexPathHeightCache.automaticallyInvalidateEnabled) {
[self.fd_indexPathHeightCache buildCachesAtIndexPathsIfNeeded:@[sourceIndexPath, destinationIndexPath]];
[self.fd_indexPathHeightCache enumerateAllOrientationsUsingBlock:^(FDIndexPathHeightsBySection *heightsBySection) {
NSMutableArray<NSNumber *> *sourceRows = heightsBySection[sourceIndexPath.section];
NSMutableArray<NSNumber *> *destinationRows = heightsBySection[destinationIndexPath.section];
NSNumber *sourceValue = sourceRows[sourceIndexPath.row];
NSNumber *destinationValue = destinationRows[destinationIndexPath.row];
sourceRows[sourceIndexPath.row] = destinationValue;
destinationRows[destinationIndexPath.row] = sourceValue;
}];
}
FDPrimaryCall([self fd_moveRowAtIndexPath:sourceIndexPath toIndexPath:destinationIndexPath];);
}
@end
================================================
FILE: Classes/UITableView+FDKeyedHeightCache.h
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 <UIKit/UIKit.h>
@interface FDKeyedHeightCache : NSObject
- (BOOL)existsHeightForKey:(id<NSCopying>)key;
- (void)cacheHeight:(CGFloat)height byKey:(id<NSCopying>)key;
- (CGFloat)heightForKey:(id<NSCopying>)key;
// Invalidation
- (void)invalidateHeightForKey:(id<NSCopying>)key;
- (void)invalidateAllHeightCache;
@end
@interface UITableView (FDKeyedHeightCache)
/// Height cache by key. Generally, you don't need to use it directly.
@property (nonatomic, strong, readonly) FDKeyedHeightCache *fd_keyedHeightCache;
@end
================================================
FILE: Classes/UITableView+FDKeyedHeightCache.m
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 "UITableView+FDKeyedHeightCache.h"
#import <objc/runtime.h>
@interface FDKeyedHeightCache ()
@property (nonatomic, strong) NSMutableDictionary<id<NSCopying>, NSNumber *> *mutableHeightsByKeyForPortrait;
@property (nonatomic, strong) NSMutableDictionary<id<NSCopying>, NSNumber *> *mutableHeightsByKeyForLandscape;
@end
@implementation FDKeyedHeightCache
- (instancetype)init {
self = [super init];
if (self) {
_mutableHeightsByKeyForPortrait = [NSMutableDictionary dictionary];
_mutableHeightsByKeyForLandscape = [NSMutableDictionary dictionary];
}
return self;
}
- (NSMutableDictionary<id<NSCopying>, NSNumber *> *)mutableHeightsByKeyForCurrentOrientation {
return UIDeviceOrientationIsPortrait([UIDevice currentDevice].orientation) ? self.mutableHeightsByKeyForPortrait: self.mutableHeightsByKeyForLandscape;
}
- (BOOL)existsHeightForKey:(id<NSCopying>)key {
NSNumber *number = self.mutableHeightsByKeyForCurrentOrientation[key];
return number && ![number isEqualToNumber:@-1];
}
- (void)cacheHeight:(CGFloat)height byKey:(id<NSCopying>)key {
self.mutableHeightsByKeyForCurrentOrientation[key] = @(height);
}
- (CGFloat)heightForKey:(id<NSCopying>)key {
#if CGFLOAT_IS_DOUBLE
return [self.mutableHeightsByKeyForCurrentOrientation[key] doubleValue];
#else
return [self.mutableHeightsByKeyForCurrentOrientation[key] floatValue];
#endif
}
- (void)invalidateHeightForKey:(id<NSCopying>)key {
[self.mutableHeightsByKeyForPortrait removeObjectForKey:key];
[self.mutableHeightsByKeyForLandscape removeObjectForKey:key];
}
- (void)invalidateAllHeightCache {
[self.mutableHeightsByKeyForPortrait removeAllObjects];
[self.mutableHeightsByKeyForLandscape removeAllObjects];
}
@end
@implementation UITableView (FDKeyedHeightCache)
- (FDKeyedHeightCache *)fd_keyedHeightCache {
FDKeyedHeightCache *cache = objc_getAssociatedObject(self, _cmd);
if (!cache) {
cache = [FDKeyedHeightCache new];
objc_setAssociatedObject(self, _cmd, cache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
return cache;
}
@end
================================================
FILE: Classes/UITableView+FDTemplateLayoutCell.h
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 <UIKit/UIKit.h>
#import "UITableView+FDKeyedHeightCache.h"
#import "UITableView+FDIndexPathHeightCache.h"
#import "UITableView+FDTemplateLayoutCellDebug.h"
@interface UITableView (FDTemplateLayoutCell)
/// Access to internal template layout cell for given reuse identifier.
/// Generally, you don't need to know these template layout cells.
///
/// @param identifier Reuse identifier for cell which must be registered.
///
- (__kindof UITableViewCell *)fd_templateCellForReuseIdentifier:(NSString *)identifier;
/// Returns height of cell of type specifed by a reuse identifier and configured
/// by the configuration block.
///
/// The cell would be layed out on a fixed-width, vertically expanding basis with
/// respect to its dynamic content, using auto layout. Thus, it is imperative that
/// the cell was set up to be self-satisfied, i.e. its content always determines
/// its height given the width is equal to the tableview's.
///
/// @param identifier A string identifier for retrieving and maintaining template
/// cells with system's "-dequeueReusableCellWithIdentifier:" call.
/// @param configuration An optional block for configuring and providing content
/// to the template cell. The configuration should be minimal for scrolling
/// performance yet sufficient for calculating cell's height.
///
- (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier configuration:(void (^)(id cell))configuration;
/// This method does what "-fd_heightForCellWithIdentifier:configuration" does, and
/// calculated height will be cached by its index path, returns a cached height
/// when needed. Therefore lots of extra height calculations could be saved.
///
/// No need to worry about invalidating cached heights when data source changes, it
/// will be done automatically when you call "-reloadData" or any method that triggers
/// UITableView's reloading.
///
/// @param indexPath where this cell's height cache belongs.
///
- (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier cacheByIndexPath:(NSIndexPath *)indexPath configuration:(void (^)(id cell))configuration;
/// This method caches height by your model entity's identifier.
/// If your model's changed, call "-invalidateHeightForKey:(id <NSCopying>)key" to
/// invalidate cache and re-calculate, it's much cheaper and effective than "cacheByIndexPath".
///
/// @param key model entity's identifier whose data configures a cell.
///
- (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier cacheByKey:(id<NSCopying>)key configuration:(void (^)(id cell))configuration;
@end
@interface UITableView (FDTemplateLayoutHeaderFooterView)
/// Returns header or footer view's height that registered in table view with reuse identifier.
///
/// Use it after calling "-[UITableView registerNib/Class:forHeaderFooterViewReuseIdentifier]",
/// same with "-fd_heightForCellWithIdentifier:configuration:", it will call "-sizeThatFits:" for
/// subclass of UITableViewHeaderFooterView which is not using Auto Layout.
///
- (CGFloat)fd_heightForHeaderFooterViewWithIdentifier:(NSString *)identifier configuration:(void (^)(id headerFooterView))configuration;
@end
@interface UITableViewCell (FDTemplateLayoutCell)
/// Indicate this is a template layout cell for calculation only.
/// You may need this when there are non-UI side effects when configure a cell.
/// Like:
/// - (void)configureCell:(FooCell *)cell atIndexPath:(NSIndexPath *)indexPath {
/// cell.entity = [self entityAtIndexPath:indexPath];
/// if (!cell.fd_isTemplateLayoutCell) {
/// [self notifySomething]; // non-UI side effects
/// }
/// }
///
@property (nonatomic, assign) BOOL fd_isTemplateLayoutCell;
/// Enable to enforce this template layout cell to use "frame layout" rather than "auto layout",
/// and will ask cell's height by calling "-sizeThatFits:", so you must override this method.
/// Use this property only when you want to manually control this template layout cell's height
/// calculation mode, default to NO.
///
@property (nonatomic, assign) BOOL fd_enforceFrameLayout;
@end
================================================
FILE: Classes/UITableView+FDTemplateLayoutCell.m
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 "UITableView+FDTemplateLayoutCell.h"
#import <objc/runtime.h>
@implementation UITableView (FDTemplateLayoutCell)
- (CGFloat)fd_systemFittingHeightForConfiguratedCell:(UITableViewCell *)cell {
CGFloat contentViewWidth = CGRectGetWidth(self.frame);
CGRect cellBounds = cell.bounds;
cellBounds.size.width = contentViewWidth;
cell.bounds = cellBounds;
CGFloat rightSystemViewsWidth = 0.0;
for (UIView *view in self.subviews) {
if ([view isKindOfClass:NSClassFromString(@"UITableViewIndex")]) {
rightSystemViewsWidth = CGRectGetWidth(view.frame);
break;
}
}
// If a cell has accessory view or system accessory type, its content view's width is smaller
// than cell's by some fixed values.
if (cell.accessoryView) {
rightSystemViewsWidth += 16 + CGRectGetWidth(cell.accessoryView.frame);
} else {
static const CGFloat systemAccessoryWidths[] = {
[UITableViewCellAccessoryNone] = 0,
[UITableViewCellAccessoryDisclosureIndicator] = 34,
[UITableViewCellAccessoryDetailDisclosureButton] = 68,
[UITableViewCellAccessoryCheckmark] = 40,
[UITableViewCellAccessoryDetailButton] = 48
};
rightSystemViewsWidth += systemAccessoryWidths[cell.accessoryType];
}
if ([UIScreen mainScreen].scale >= 3 && [UIScreen mainScreen].bounds.size.width >= 414) {
rightSystemViewsWidth += 4;
}
contentViewWidth -= rightSystemViewsWidth;
// If not using auto layout, you have to override "-sizeThatFits:" to provide a fitting size by yourself.
// This is the same height calculation passes used in iOS8 self-sizing cell's implementation.
//
// 1. Try "- systemLayoutSizeFittingSize:" first. (skip this step if 'fd_enforceFrameLayout' set to YES.)
// 2. Warning once if step 1 still returns 0 when using AutoLayout
// 3. Try "- sizeThatFits:" if step 1 returns 0
// 4. Use a valid height or default row height (44) if not exist one
CGFloat fittingHeight = 0;
if (!cell.fd_enforceFrameLayout && contentViewWidth > 0) {
// Add a hard width constraint to make dynamic content views (like labels) expand vertically instead
// of growing horizontally, in a flow-layout manner.
NSLayoutConstraint *widthFenceConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:contentViewWidth];
// [bug fix] after iOS 10.3, Auto Layout engine will add an additional 0 width constraint onto cell's content view, to avoid that, we add constraints to content view's left, right, top and bottom.
static BOOL isSystemVersionEqualOrGreaterThen10_2 = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
isSystemVersionEqualOrGreaterThen10_2 = [UIDevice.currentDevice.systemVersion compare:@"10.2" options:NSNumericSearch] != NSOrderedAscending;
});
NSArray<NSLayoutConstraint *> *edgeConstraints;
if (isSystemVersionEqualOrGreaterThen10_2) {
// To avoid confilicts, make width constraint softer than required (1000)
widthFenceConstraint.priority = UILayoutPriorityRequired - 1;
// Build edge constraints
NSLayoutConstraint *leftConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
NSLayoutConstraint *rightConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeRight multiplier:1.0 constant:-rightSystemViewsWidth];
NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
NSLayoutConstraint *bottomConstraint = [NSLayoutConstraint constraintWithItem:cell.contentView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:cell attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
edgeConstraints = @[leftConstraint, rightConstraint, topConstraint, bottomConstraint];
[cell addConstraints:edgeConstraints];
}
[cell.contentView addConstraint:widthFenceConstraint];
// Auto layout engine does its math
fittingHeight = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
// Clean-ups
[cell.contentView removeConstraint:widthFenceConstraint];
if (isSystemVersionEqualOrGreaterThen10_2) {
[cell removeConstraints:edgeConstraints];
}
[self fd_debugLog:[NSString stringWithFormat:@"calculate using system fitting size (AutoLayout) - %@", @(fittingHeight)]];
}
if (fittingHeight == 0) {
#if DEBUG
// Warn if using AutoLayout but get zero height.
if (cell.contentView.constraints.count > 0) {
if (!objc_getAssociatedObject(self, _cmd)) {
NSLog(@"[FDTemplateLayoutCell] Warning once only: Cannot get a proper cell height (now 0) from '- systemFittingSize:'(AutoLayout). You should check how constraints are built in cell, making it into 'self-sizing' cell.");
objc_setAssociatedObject(self, _cmd, @YES, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
}
#endif
// Try '- sizeThatFits:' for frame layout.
// Note: fitting height should not include separator view.
fittingHeight = [cell sizeThatFits:CGSizeMake(contentViewWidth, 0)].height;
[self fd_debugLog:[NSString stringWithFormat:@"calculate using sizeThatFits - %@", @(fittingHeight)]];
}
// Still zero height after all above.
if (fittingHeight == 0) {
// Use default row height.
fittingHeight = 44;
}
// Add 1px extra space for separator line if needed, simulating default UITableViewCell.
if (self.separatorStyle != UITableViewCellSeparatorStyleNone) {
fittingHeight += 1.0 / [UIScreen mainScreen].scale;
}
return fittingHeight;
}
- (__kindof UITableViewCell *)fd_templateCellForReuseIdentifier:(NSString *)identifier {
NSAssert(identifier.length > 0, @"Expect a valid identifier - %@", identifier);
NSMutableDictionary<NSString *, UITableViewCell *> *templateCellsByIdentifiers = objc_getAssociatedObject(self, _cmd);
if (!templateCellsByIdentifiers) {
templateCellsByIdentifiers = @{}.mutableCopy;
objc_setAssociatedObject(self, _cmd, templateCellsByIdentifiers, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
UITableViewCell *templateCell = templateCellsByIdentifiers[identifier];
if (!templateCell) {
templateCell = [self dequeueReusableCellWithIdentifier:identifier];
NSAssert(templateCell != nil, @"Cell must be registered to table view for identifier - %@", identifier);
templateCell.fd_isTemplateLayoutCell = YES;
templateCell.contentView.translatesAutoresizingMaskIntoConstraints = NO;
templateCellsByIdentifiers[identifier] = templateCell;
[self fd_debugLog:[NSString stringWithFormat:@"layout cell created - %@", identifier]];
}
return templateCell;
}
- (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier configuration:(void (^)(id cell))configuration {
if (!identifier) {
return 0;
}
UITableViewCell *templateLayoutCell = [self fd_templateCellForReuseIdentifier:identifier];
// Manually calls to ensure consistent behavior with actual cells. (that are displayed on screen)
[templateLayoutCell prepareForReuse];
// Customize and provide content for our template cell.
if (configuration) {
configuration(templateLayoutCell);
}
return [self fd_systemFittingHeightForConfiguratedCell:templateLayoutCell];
}
- (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier cacheByIndexPath:(NSIndexPath *)indexPath configuration:(void (^)(id cell))configuration {
if (!identifier || !indexPath) {
return 0;
}
// Hit cache
if ([self.fd_indexPathHeightCache existsHeightAtIndexPath:indexPath]) {
[self fd_debugLog:[NSString stringWithFormat:@"hit cache by index path[%@:%@] - %@", @(indexPath.section), @(indexPath.row), @([self.fd_indexPathHeightCache heightForIndexPath:indexPath])]];
return [self.fd_indexPathHeightCache heightForIndexPath:indexPath];
}
CGFloat height = [self fd_heightForCellWithIdentifier:identifier configuration:configuration];
[self.fd_indexPathHeightCache cacheHeight:height byIndexPath:indexPath];
[self fd_debugLog:[NSString stringWithFormat: @"cached by index path[%@:%@] - %@", @(indexPath.section), @(indexPath.row), @(height)]];
return height;
}
- (CGFloat)fd_heightForCellWithIdentifier:(NSString *)identifier cacheByKey:(id<NSCopying>)key configuration:(void (^)(id cell))configuration {
if (!identifier || !key) {
return 0;
}
// Hit cache
if ([self.fd_keyedHeightCache existsHeightForKey:key]) {
CGFloat cachedHeight = [self.fd_keyedHeightCache heightForKey:key];
[self fd_debugLog:[NSString stringWithFormat:@"hit cache by key[%@] - %@", key, @(cachedHeight)]];
return cachedHeight;
}
CGFloat height = [self fd_heightForCellWithIdentifier:identifier configuration:configuration];
[self.fd_keyedHeightCache cacheHeight:height byKey:key];
[self fd_debugLog:[NSString stringWithFormat:@"cached by key[%@] - %@", key, @(height)]];
return height;
}
@end
@implementation UITableView (FDTemplateLayoutHeaderFooterView)
- (__kindof UITableViewHeaderFooterView *)fd_templateHeaderFooterViewForReuseIdentifier:(NSString *)identifier {
NSAssert(identifier.length > 0, @"Expect a valid identifier - %@", identifier);
NSMutableDictionary<NSString *, UITableViewHeaderFooterView *> *templateHeaderFooterViews = objc_getAssociatedObject(self, _cmd);
if (!templateHeaderFooterViews) {
templateHeaderFooterViews = @{}.mutableCopy;
objc_setAssociatedObject(self, _cmd, templateHeaderFooterViews, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
UITableViewHeaderFooterView *templateHeaderFooterView = templateHeaderFooterViews[identifier];
if (!templateHeaderFooterView) {
templateHeaderFooterView = [self dequeueReusableHeaderFooterViewWithIdentifier:identifier];
NSAssert(templateHeaderFooterView != nil, @"HeaderFooterView must be registered to table view for identifier - %@", identifier);
templateHeaderFooterView.contentView.translatesAutoresizingMaskIntoConstraints = NO;
templateHeaderFooterViews[identifier] = templateHeaderFooterView;
[self fd_debugLog:[NSString stringWithFormat:@"layout header footer view created - %@", identifier]];
}
return templateHeaderFooterView;
}
- (CGFloat)fd_heightForHeaderFooterViewWithIdentifier:(NSString *)identifier configuration:(void (^)(id))configuration {
UITableViewHeaderFooterView *templateHeaderFooterView = [self fd_templateHeaderFooterViewForReuseIdentifier:identifier];
NSLayoutConstraint *widthFenceConstraint = [NSLayoutConstraint constraintWithItem:templateHeaderFooterView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:CGRectGetWidth(self.frame)];
[templateHeaderFooterView addConstraint:widthFenceConstraint];
CGFloat fittingHeight = [templateHeaderFooterView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
[templateHeaderFooterView removeConstraint:widthFenceConstraint];
if (fittingHeight == 0) {
fittingHeight = [templateHeaderFooterView sizeThatFits:CGSizeMake(CGRectGetWidth(self.frame), 0)].height;
}
return fittingHeight;
}
@end
@implementation UITableViewCell (FDTemplateLayoutCell)
- (BOOL)fd_isTemplateLayoutCell {
return [objc_getAssociatedObject(self, _cmd) boolValue];
}
- (void)setFd_isTemplateLayoutCell:(BOOL)isTemplateLayoutCell {
objc_setAssociatedObject(self, @selector(fd_isTemplateLayoutCell), @(isTemplateLayoutCell), OBJC_ASSOCIATION_RETAIN);
}
- (BOOL)fd_enforceFrameLayout {
return [objc_getAssociatedObject(self, _cmd) boolValue];
}
- (void)setFd_enforceFrameLayout:(BOOL)enforceFrameLayout {
objc_setAssociatedObject(self, @selector(fd_enforceFrameLayout), @(enforceFrameLayout), OBJC_ASSOCIATION_RETAIN);
}
@end
================================================
FILE: Classes/UITableView+FDTemplateLayoutCellDebug.h
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 <UIKit/UIKit.h>
@interface UITableView (FDTemplateLayoutCellDebug)
/// Helps to debug or inspect what is this "FDTemplateLayoutCell" extention doing,
/// turning on to print logs when "creating", "calculating", "precaching" or "hitting cache".
///
/// Default to NO, log by NSLog.
///
@property (nonatomic, assign) BOOL fd_debugLogEnabled;
/// Debug log controlled by "fd_debugLogEnabled".
- (void)fd_debugLog:(NSString *)message;
@end
================================================
FILE: Classes/UITableView+FDTemplateLayoutCellDebug.m
================================================
// The MIT License (MIT)
//
// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )
//
// 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 "UITableView+FDTemplateLayoutCellDebug.h"
#import <objc/runtime.h>
@implementation UITableView (FDTemplateLayoutCellDebug)
- (BOOL)fd_debugLogEnabled {
return [objc_getAssociatedObject(self, _cmd) boolValue];
}
- (void)setFd_debugLogEnabled:(BOOL)debugLogEnabled {
objc_setAssociatedObject(self, @selector(fd_debugLogEnabled), @(debugLogEnabled), OBJC_ASSOCIATION_RETAIN);
}
- (void)fd_debugLog:(NSString *)message {
if (self.fd_debugLogEnabled) {
NSLog(@"** FDTemplateLayoutCell ** %@", message);
}
}
@end
================================================
FILE: Demo/Demo/Base.lproj/LaunchScreen.xib
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015年 forkingdog. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Demo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
================================================
FILE: Demo/Demo/Base.lproj/Main.storyboard
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D13b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="r7f-yG-t96">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--Feed-->
<scene sceneID="CXG-0P-w4N">
<objects>
<tableViewController id="wMf-oo-bbR" customClass="FDFeedViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" allowsSelection="NO" allowsSelectionDuringEditing="YES" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" id="Mq8-ij-HGX">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="calibratedRGB"/>
<view key="tableHeaderView" contentMode="scaleToFill" id="8oB-Sh-6TW" userLabel="Header">
<rect key="frame" x="0.0" y="64" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="keJ-kn-yV4">
<rect key="frame" x="-16.5" y="8" width="353" height="29"/>
<segments>
<segment title="No Cache"/>
<segment title="IndexPath Cache"/>
<segment title="Key Cache"/>
</segments>
<color key="tintColor" red="0.0" green="0.0" blue="0.49803921569999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</segmentedControl>
</subviews>
<constraints>
<constraint firstAttribute="centerY" secondItem="keJ-kn-yV4" secondAttribute="centerY" id="Car-o0-MCP"/>
<constraint firstAttribute="centerX" secondItem="keJ-kn-yV4" secondAttribute="centerX" id="zzq-bc-oS0"/>
</constraints>
</view>
<view key="tableFooterView" contentMode="scaleToFill" id="uRY-oW-AdT" userLabel="Hidden Footer">
<rect key="frame" x="0.0" y="357.5" width="320" height="0.0"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="FDFeedCell" rowHeight="170" id="V3A-UH-8aT" customClass="FDFeedCell">
<rect key="frame" x="0.0" y="157.5" width="320" height="170"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="V3A-UH-8aT" id="Suq-mf-KCp">
<rect key="frame" x="0.0" y="0.0" width="320" height="169.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Multi-line Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tg1-La-Nh1">
<rect key="frame" x="16" y="10" width="294" height="19.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.0" green="0.0" blue="0.49803921568627452" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" text="Username" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1tg-gd-k5u">
<rect key="frame" x="16" y="149" width="62" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Multi-line Content" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="0.0" translatesAutoresizingMaskIntoConstraints="NO" id="F8s-lN-hFv">
<rect key="frame" x="16" y="35" width="294" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Time" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GxO-0u-IkK">
<rect key="frame" x="280" y="150" width="30" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.54880242598684215" green="0.66666666666666663" blue="0.89463404605263153" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView opaque="NO" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" placeholderIntrinsicWidth="143" placeholderIntrinsicHeight="80.5" translatesAutoresizingMaskIntoConstraints="NO" id="trr-NJ-bGq">
<rect key="frame" x="16" y="60" width="143" height="80.5"/>
</imageView>
</subviews>
<constraints>
<constraint firstItem="1tg-gd-k5u" firstAttribute="top" secondItem="trr-NJ-bGq" secondAttribute="bottom" constant="8" id="2NB-z2-hSZ"/>
<constraint firstItem="Tg1-La-Nh1" firstAttribute="leading" secondItem="1tg-gd-k5u" secondAttribute="leading" id="J7S-pp-Pf7"/>
<constraint firstItem="trr-NJ-bGq" firstAttribute="top" secondItem="F8s-lN-hFv" secondAttribute="bottom" constant="8" id="Ok4-12-fjD"/>
<constraint firstItem="Tg1-La-Nh1" firstAttribute="top" secondItem="Suq-mf-KCp" secondAttribute="top" constant="10" id="Y7X-Mo-9rK"/>
<constraint firstItem="trr-NJ-bGq" firstAttribute="leading" secondItem="Tg1-La-Nh1" secondAttribute="leading" id="ZSl-YZ-AQU"/>
<constraint firstItem="GxO-0u-IkK" firstAttribute="baseline" secondItem="1tg-gd-k5u" secondAttribute="baseline" id="be9-RO-hVQ"/>
<constraint firstItem="F8s-lN-hFv" firstAttribute="top" secondItem="Tg1-La-Nh1" secondAttribute="bottom" constant="6" id="e9l-Cs-vMc"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="trr-NJ-bGq" secondAttribute="trailing" constant="16" id="jV7-t4-Ovd"/>
<constraint firstAttribute="bottom" secondItem="1tg-gd-k5u" secondAttribute="bottom" constant="4" id="jmA-4S-4d9"/>
<constraint firstItem="Tg1-La-Nh1" firstAttribute="leading" secondItem="F8s-lN-hFv" secondAttribute="leading" id="npU-Th-QCa"/>
<constraint firstAttribute="trailing" secondItem="GxO-0u-IkK" secondAttribute="trailing" constant="10" id="taI-fU-bhv"/>
<constraint firstAttribute="trailing" secondItem="Tg1-La-Nh1" secondAttribute="trailing" constant="10" id="wOJ-Vb-cdi"/>
<constraint firstAttribute="trailing" secondItem="F8s-lN-hFv" secondAttribute="trailing" constant="10" id="xjf-G9-dRV"/>
<constraint firstItem="Tg1-La-Nh1" firstAttribute="leading" secondItem="Suq-mf-KCp" secondAttribute="leading" constant="16" id="yrC-au-hrh"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="contentImageView" destination="trr-NJ-bGq" id="n5j-tS-uz7"/>
<outlet property="contentLabel" destination="F8s-lN-hFv" id="MbN-Ex-26E"/>
<outlet property="timeLabel" destination="GxO-0u-IkK" id="7Zi-Vj-IGR"/>
<outlet property="titleLabel" destination="Tg1-La-Nh1" id="DJu-Wf-DBt"/>
<outlet property="usernameLabel" destination="1tg-gd-k5u" id="nDA-d7-5cC"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="wMf-oo-bbR" id="Tml-iv-CyM"/>
<outlet property="delegate" destination="wMf-oo-bbR" id="yAQ-XQ-D0H"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Feed" id="hlU-OK-IJs">
<barButtonItem key="rightBarButtonItem" title="Actions" id="F7H-Qg-wdS" userLabel="Action">
<color key="tintColor" red="0.0" green="0.0" blue="0.49803921568627452" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<action selector="rightNavigationItemAction:" destination="wMf-oo-bbR" id="IQI-m8-aHs"/>
</connections>
</barButtonItem>
</navigationItem>
<refreshControl key="refreshControl" opaque="NO" multipleTouchEnabled="YES" contentMode="center" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" id="g7J-46-moD">
<autoresizingMask key="autoresizingMask"/>
<connections>
<action selector="refreshControlAction:" destination="wMf-oo-bbR" eventType="valueChanged" id="xPs-oH-YPI"/>
</connections>
</refreshControl>
<connections>
<outlet property="cacheModeSegmentControl" destination="keJ-kn-yV4" id="eeM-FW-U6e"/>
</connections>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="otr-cP-Co7" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="464" y="221"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="3XP-rg-r8F">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="r7f-yG-t96" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="Pxp-zn-uEI">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<textAttributes key="titleTextAttributes">
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<color key="textColor" red="0.0" green="0.0" blue="0.49803921568627452" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<offsetWrapper key="textShadowOffset" horizontal="0.0" vertical="0.0"/>
</textAttributes>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="wMf-oo-bbR" kind="relationship" relationship="rootViewController" id="v2H-Pn-mCM"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="duI-xm-dzE" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="71" y="221"/>
</scene>
</scenes>
</document>
================================================
FILE: Demo/Demo/FDAppDelegate.h
================================================
//
// AppDelegate.h
// Demo
//
// Created by sunnyxx on 15/4/16.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FDAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
================================================
FILE: Demo/Demo/FDAppDelegate.m
================================================
//
// AppDelegate.m
// Demo
//
// Created by sunnyxx on 15/4/16.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import "FDAppDelegate.h"
@implementation FDAppDelegate
@end
================================================
FILE: Demo/Demo/FDFeedCell.h
================================================
//
// FDFeedCell.h
// Demo
//
// Created by sunnyxx on 15/4/17.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "FDFeedEntity.h"
@interface FDFeedCell : UITableViewCell
@property (nonatomic, strong) FDFeedEntity *entity;
@end
================================================
FILE: Demo/Demo/FDFeedCell.m
================================================
//
// FDFeedCell.m
// Demo
//
// Created by sunnyxx on 15/4/17.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import "FDFeedCell.h"
@interface FDFeedCell ()
@property (nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (nonatomic, weak) IBOutlet UILabel *contentLabel;
@property (nonatomic, weak) IBOutlet UIImageView *contentImageView;
@property (nonatomic, weak) IBOutlet UILabel *usernameLabel;
@property (nonatomic, weak) IBOutlet UILabel *timeLabel;
@end
@implementation FDFeedCell
- (void)awakeFromNib
{
[super awakeFromNib];
// Fix the bug in iOS7 - initial constraints warning
self.contentView.bounds = [UIScreen mainScreen].bounds;
}
- (void)setEntity:(FDFeedEntity *)entity
{
_entity = entity;
self.titleLabel.text = entity.title;
self.contentLabel.text = entity.content;
self.contentImageView.image = entity.imageName.length > 0 ? [UIImage imageNamed:entity.imageName] : nil;
self.usernameLabel.text = entity.username;
self.timeLabel.text = entity.time;
}
// If you are not using auto layout, override this method, enable it by setting
// "fd_enforceFrameLayout" to YES.
- (CGSize)sizeThatFits:(CGSize)size {
CGFloat totalHeight = 0;
totalHeight += [self.titleLabel sizeThatFits:size].height;
totalHeight += [self.contentLabel sizeThatFits:size].height;
totalHeight += [self.contentImageView sizeThatFits:size].height;
totalHeight += [self.usernameLabel sizeThatFits:size].height;
totalHeight += 40; // margins
return CGSizeMake(size.width, totalHeight);
}
@end
================================================
FILE: Demo/Demo/FDFeedEntity.h
================================================
//
// FDFeedEntity.h
// Demo
//
// Created by sunnyxx on 15/4/16.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface FDFeedEntity : NSObject
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
@property (nonatomic, copy, readonly) NSString *identifier;
@property (nonatomic, copy, readonly) NSString *title;
@property (nonatomic, copy, readonly) NSString *content;
@property (nonatomic, copy, readonly) NSString *username;
@property (nonatomic, copy, readonly) NSString *time;
@property (nonatomic, copy, readonly) NSString *imageName;
@end
================================================
FILE: Demo/Demo/FDFeedEntity.m
================================================
//
// FDFeedEntity.m
// Demo
//
// Created by sunnyxx on 15/4/16.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import "FDFeedEntity.h"
@implementation FDFeedEntity
- (instancetype)initWithDictionary:(NSDictionary *)dictionary
{
self = super.init;
if (self) {
_identifier = [self uniqueIdentifier];
_title = dictionary[@"title"];
_content = dictionary[@"content"];
_username = dictionary[@"username"];
_time = dictionary[@"time"];
_imageName = dictionary[@"imageName"];
}
return self;
}
- (NSString *)uniqueIdentifier
{
static NSInteger counter = 0;
return [NSString stringWithFormat:@"unique-id-%@", @(counter++)];
}
@end
================================================
FILE: Demo/Demo/FDFeedViewController.h
================================================
//
// FDFeedViewController.h
// Demo
//
// Created by sunnyxx on 15/4/16.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FDFeedViewController : UITableViewController
@end
================================================
FILE: Demo/Demo/FDFeedViewController.m
================================================
//
// FDFeedViewController.m
// Demo
//
// Created by sunnyxx on 15/4/16.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import "FDFeedViewController.h"
#import "UITableView+FDTemplateLayoutCell.h"
#import "FDFeedEntity.h"
#import "FDFeedCell.h"
typedef NS_ENUM(NSInteger, FDSimulatedCacheMode) {
FDSimulatedCacheModeNone = 0,
FDSimulatedCacheModeCacheByIndexPath,
FDSimulatedCacheModeCacheByKey
};
@interface FDFeedViewController () <UIActionSheetDelegate>
@property (nonatomic, copy) NSArray *prototypeEntitiesFromJSON;
@property (nonatomic, strong) NSMutableArray *feedEntitySections; // 2d array
@property (nonatomic, weak) IBOutlet UISegmentedControl *cacheModeSegmentControl;
@end
@implementation FDFeedViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.fd_debugLogEnabled = YES;
// Cache by index path initial
self.cacheModeSegmentControl.selectedSegmentIndex = 1;
[self buildTestDataThen:^{
self.feedEntitySections = @[].mutableCopy;
[self.feedEntitySections addObject:self.prototypeEntitiesFromJSON.mutableCopy];
[self.tableView reloadData];
}];
}
- (void)buildTestDataThen:(void (^)(void))then {
// Simulate an async request
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// Data from `data.json`
NSString *dataFilePath = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:dataFilePath];
NSDictionary *rootDict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
NSArray *feedDicts = rootDict[@"feed"];
// Convert to `FDFeedEntity`
NSMutableArray *entities = @[].mutableCopy;
[feedDicts enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[entities addObject:[[FDFeedEntity alloc] initWithDictionary:obj]];
}];
self.prototypeEntitiesFromJSON = entities;
// Callback
dispatch_async(dispatch_get_main_queue(), ^{
!then ?: then();
});
});
}
#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return self.feedEntitySections.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.feedEntitySections[section] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
FDFeedCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FDFeedCell"];
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
- (void)configureCell:(FDFeedCell *)cell atIndexPath:(NSIndexPath *)indexPath {
cell.fd_enforceFrameLayout = NO; // Enable to use "-sizeThatFits:"
if (indexPath.row % 2 == 0) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
cell.entity = self.feedEntitySections[indexPath.section][indexPath.row];
}
- (NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return @[@"A",@"B",@"C",@"D"];
}
#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
FDSimulatedCacheMode mode = self.cacheModeSegmentControl.selectedSegmentIndex;
switch (mode) {
case FDSimulatedCacheModeNone:
return [tableView fd_heightForCellWithIdentifier:@"FDFeedCell" configuration:^(FDFeedCell *cell) {
[self configureCell:cell atIndexPath:indexPath];
}];
case FDSimulatedCacheModeCacheByIndexPath:
return [tableView fd_heightForCellWithIdentifier:@"FDFeedCell" cacheByIndexPath:indexPath configuration:^(FDFeedCell *cell) {
[self configureCell:cell atIndexPath:indexPath];
}];
case FDSimulatedCacheModeCacheByKey: {
FDFeedEntity *entity = self.feedEntitySections[indexPath.section][indexPath.row];
return [tableView fd_heightForCellWithIdentifier:@"FDFeedCell" cacheByKey:entity.identifier configuration:^(FDFeedCell *cell) {
[self configureCell:cell atIndexPath:indexPath];
}];
};
default:
break;
}
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSMutableArray *mutableEntities = self.feedEntitySections[indexPath.section];
[mutableEntities removeObjectAtIndex:indexPath.row];
[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
#pragma mark - Actions
- (IBAction)refreshControlAction:(UIRefreshControl *)sender {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.feedEntitySections removeAllObjects];
[self.feedEntitySections addObject:self.prototypeEntitiesFromJSON.mutableCopy];
[self.tableView reloadData];
[sender endRefreshing];
});
}
- (IBAction)rightNavigationItemAction:(id)sender {
[[[UIActionSheet alloc]
initWithTitle:@"Actions"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:
@"Insert a row",
@"Insert a section",
@"Delete a section", nil]
showInView:self.view];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
SEL selectors[] = {
@selector(insertRow),
@selector(insertSection),
@selector(deleteSection)
};
if (buttonIndex < sizeof(selectors) / sizeof(SEL)) {
void(*imp)(id, SEL) = (typeof(imp))[self methodForSelector:selectors[buttonIndex]];
imp(self, selectors[buttonIndex]);
}
}
- (FDFeedEntity *)randomEntity {
NSUInteger randomNumber = arc4random_uniform((int32_t)self.prototypeEntitiesFromJSON.count);
FDFeedEntity *randomEntity = self.prototypeEntitiesFromJSON[randomNumber];
return randomEntity;
}
- (void)insertRow {
if (self.feedEntitySections.count == 0) {
[self insertSection];
} else {
[self.feedEntitySections[0] insertObject:self.randomEntity atIndex:0];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
- (void)insertSection {
[self.feedEntitySections insertObject:@[self.randomEntity].mutableCopy atIndex:0];
[self.tableView insertSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
}
- (void)deleteSection {
if (self.feedEntitySections.count > 0) {
[self.feedEntitySections removeObjectAtIndex:0];
[self.tableView deleteSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
@end
================================================
FILE: Demo/Demo/Images.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Images.xcassets/breaddoge.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "dogebread.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Images.xcassets/doge.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "doge@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Images.xcassets/forkingdog.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "forkingdog@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Images.xcassets/phil.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "phil.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Images.xcassets/sark.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "sark@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Images.xcassets/sinojerk.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "彪哥副本.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Images.xcassets/sunnyxx.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "下载.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: Demo/Demo/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.forkingdog.templatelayoutcell.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
================================================
FILE: Demo/Demo/data.json
================================================
{
"feed": [
{
"title": "Hello world",
"content": "This is forkingdog team. Here's our logo?\nGithub: \"forkingdog\"",
"username": "forkingdog",
"time": "2015.04.10",
"imageName": "forkingdog"
},
{
"title": "Team member - sunnyxx",
"content": "Working at Baidu, Zhidao iOS team, weibo: @我就叫Sunny怎么了",
"username": "sunnyxx",
"time": "2015.04.11",
"imageName": "sunnyxx"
},
{
"title": "Team member - SinoJerk",
"content": "Zhidao iOS team, Daifu Tang (aka 彪哥)",
"username": "sinojerk",
"time": "2015.04.15",
"imageName": "sinojerk"
},
{
"title": "Team member - Phil",
"content": "Zhidao iOS team, Jiaqi Guo, Github: philcn",
"username": "phil",
"time": "2015.04.15",
"imageName": "phil"
},
{
"title": "William Shakespeare",
"content": "Good name in man and woman, dear my lord, is the immediate jewel of their souls: Who steals my purse steals trash; ’tis something, nothing. (Othello 3.3) ",
"username": "sunnyxx",
"time": "2015.04.12",
"imageName": "breaddoge"
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "Good name in man and woman, dear my lord, is the immediate jewel of their souls: Who steals my purse steals trash; ’tis something, nothing. (Othello 3.3) ",
"username": "sunnyxx",
"time": "2015.04.12",
"imageName": "breaddoge"
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "Hello world",
"content": "This is forkingdog team. Here's our logo?\nGithub: \"forkingdog\"",
"username": "forkingdog",
"time": "2015.04.10",
"imageName": "forkingdog"
},
{
"title": "Team member - sunnyxx",
"content": "Working at Baidu, Zhidao iOS team, weibo: @我就叫Sunny怎么了",
"username": "sunnyxx",
"time": "2015.04.11",
"imageName": "sunnyxx"
},
{
"title": "Team member - SinoJerk",
"content": "Zhidao iOS team, Daifu Tang (aka 彪哥)",
"username": "sinojerk",
"time": "2015.04.15",
"imageName": "sinojerk"
},
{
"title": "Team member - Phil",
"content": "Zhidao iOS team, Jiaqi Guo, Github: philcn",
"username": "phil",
"time": "2015.04.15",
"imageName": "phil"
},
{
"title": "William Shakespeare",
"content": "Good name in man and woman, dear my lord, is the immediate jewel of their souls: Who steals my purse steals trash; ’tis something, nothing. (Othello 3.3) ",
"username": "sunnyxx",
"time": "2015.04.12",
"imageName": "breaddoge"
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "Good name in man and woman, dear my lord, is the immediate jewel of their souls: Who steals my purse steals trash; ’tis something, nothing. (Othello 3.3) ",
"username": "sunnyxx",
"time": "2015.04.12",
"imageName": "breaddoge"
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},{
"title": "Hello world",
"content": "This is forkingdog team. Here's our logo?\nGithub: \"forkingdog\"",
"username": "forkingdog",
"time": "2015.04.10",
"imageName": "forkingdog"
},
{
"title": "Team member - sunnyxx",
"content": "Working at Baidu, Zhidao iOS team, weibo: @我就叫Sunny怎么了",
"username": "sunnyxx",
"time": "2015.04.11",
"imageName": "sunnyxx"
},
{
"title": "Team member - SinoJerk",
"content": "Zhidao iOS team, Daifu Tang (aka 彪哥)",
"username": "sinojerk",
"time": "2015.04.15",
"imageName": "sinojerk"
},
{
"title": "Team member - Phil",
"content": "Zhidao iOS team, Jiaqi Guo, Github: philcn",
"username": "phil",
"time": "2015.04.15",
"imageName": "phil"
},
{
"title": "William Shakespeare",
"content": "Good name in man and woman, dear my lord, is the immediate jewel of their souls: Who steals my purse steals trash; ’tis something, nothing. (Othello 3.3) ",
"username": "sunnyxx",
"time": "2015.04.12",
"imageName": "breaddoge"
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "Good name in man and woman, dear my lord, is the immediate jewel of their souls: Who steals my purse steals trash; ’tis something, nothing. (Othello 3.3) ",
"username": "sunnyxx",
"time": "2015.04.12",
"imageName": "breaddoge"
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
},
{
"title": "William Shakespeare",
"content": "To be, or not to be —that is the question, Whether'tis nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them. To die —to sleep",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": ""
},
{
"title": "Sark's bad guy (gay)",
"content": "",
"username": "sunnyxx",
"time": "2015.04.16",
"imageName": "sark"
},
{
"title": "",
"content": "Things base and vile, holding no quantity, love can transpose to from and dignity: love looks not with the eyes, but with mind. (A Midsummer Night’s Dream 1.1)",
"username": "sunnyxx",
"time": "2015.04.17",
"imageName": ""
}
]
}
================================================
FILE: Demo/Demo/main.m
================================================
//
// main.m
// Demo
//
// Created by sunnyxx on 15/4/16.
// Copyright (c) 2015年 forkingdog. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "FDAppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([FDAppDelegate class]));
}
}
================================================
FILE: Demo/Demo.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
485DB89B1BAFFF8900CEAE33 /* UITableView+FDKeyedHeightCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 485DB89A1BAFFF8900CEAE33 /* UITableView+FDKeyedHeightCache.m */; settings = {ASSET_TAGS = (); }; };
485DB89E1BB0004300CEAE33 /* UITableView+FDIndexPathHeightCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 485DB89D1BB0004300CEAE33 /* UITableView+FDIndexPathHeightCache.m */; settings = {ASSET_TAGS = (); }; };
488EECB71ADFEDC6004EAA71 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 488EECB61ADFEDC6004EAA71 /* main.m */; };
488EECBA1ADFEDC6004EAA71 /* FDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 488EECB91ADFEDC6004EAA71 /* FDAppDelegate.m */; };
488EECC01ADFEDC6004EAA71 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 488EECBE1ADFEDC6004EAA71 /* Main.storyboard */; };
488EECC21ADFEDC6004EAA71 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 488EECC11ADFEDC6004EAA71 /* Images.xcassets */; };
488EECC51ADFEDC6004EAA71 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 488EECC31ADFEDC6004EAA71 /* LaunchScreen.xib */; };
488EECE01ADFF7A5004EAA71 /* FDFeedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 488EECDF1ADFF7A5004EAA71 /* FDFeedViewController.m */; };
488EECE31ADFF884004EAA71 /* FDFeedEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 488EECE21ADFF884004EAA71 /* FDFeedEntity.m */; };
48954A261B5102E200EFD15D /* UITableView+FDTemplateLayoutCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 48954A1F1B5102E200EFD15D /* UITableView+FDTemplateLayoutCell.m */; };
48954A271B5102E200EFD15D /* UITableView+FDTemplateLayoutCellDebug.m in Sources */ = {isa = PBXBuildFile; fileRef = 48954A211B5102E200EFD15D /* UITableView+FDTemplateLayoutCellDebug.m */; };
4897E5DD1ADFFBBD00E87B5F /* data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4897E5DC1ADFFBBD00E87B5F /* data.json */; };
4897E5E01AE090B900E87B5F /* FDFeedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4897E5DF1AE090B900E87B5F /* FDFeedCell.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
485DB8991BAFFF8900CEAE33 /* UITableView+FDKeyedHeightCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDKeyedHeightCache.h"; sourceTree = "<group>"; };
485DB89A1BAFFF8900CEAE33 /* UITableView+FDKeyedHeightCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDKeyedHeightCache.m"; sourceTree = "<group>"; };
485DB89C1BB0004300CEAE33 /* UITableView+FDIndexPathHeightCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDIndexPathHeightCache.h"; sourceTree = "<group>"; };
485DB89D1BB0004300CEAE33 /* UITableView+FDIndexPathHeightCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDIndexPathHeightCache.m"; sourceTree = "<group>"; };
488EECB11ADFEDC6004EAA71 /* Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
488EECB51ADFEDC6004EAA71 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
488EECB61ADFEDC6004EAA71 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
488EECB81ADFEDC6004EAA71 /* FDAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FDAppDelegate.h; sourceTree = "<group>"; };
488EECB91ADFEDC6004EAA71 /* FDAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FDAppDelegate.m; sourceTree = "<group>"; };
488EECBF1ADFEDC6004EAA71 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
488EECC11ADFEDC6004EAA71 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
488EECC41ADFEDC6004EAA71 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
488EECDE1ADFF7A5004EAA71 /* FDFeedViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FDFeedViewController.h; sourceTree = "<group>"; };
488EECDF1ADFF7A5004EAA71 /* FDFeedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FDFeedViewController.m; sourceTree = "<group>"; };
488EECE11ADFF884004EAA71 /* FDFeedEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FDFeedEntity.h; sourceTree = "<group>"; };
488EECE21ADFF884004EAA71 /* FDFeedEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FDFeedEntity.m; sourceTree = "<group>"; };
48954A1E1B5102E200EFD15D /* UITableView+FDTemplateLayoutCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDTemplateLayoutCell.h"; sourceTree = "<group>"; };
48954A1F1B5102E200EFD15D /* UITableView+FDTemplateLayoutCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDTemplateLayoutCell.m"; sourceTree = "<group>"; };
48954A201B5102E200EFD15D /* UITableView+FDTemplateLayoutCellDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDTemplateLayoutCellDebug.h"; sourceTree = "<group>"; };
48954A211B5102E200EFD15D /* UITableView+FDTemplateLayoutCellDebug.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDTemplateLayoutCellDebug.m"; sourceTree = "<group>"; };
4897E5DC1ADFFBBD00E87B5F /* data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = data.json; sourceTree = "<group>"; };
4897E5DE1AE090B900E87B5F /* FDFeedCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FDFeedCell.h; sourceTree = "<group>"; };
4897E5DF1AE090B900E87B5F /* FDFeedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FDFeedCell.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
488EECAE1ADFEDC6004EAA71 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
488EECA81ADFEDC6004EAA71 = {
isa = PBXGroup;
children = (
488EECB31ADFEDC6004EAA71 /* Demo */,
488EECB21ADFEDC6004EAA71 /* Products */,
);
sourceTree = "<group>";
};
488EECB21ADFEDC6004EAA71 /* Products */ = {
isa = PBXGroup;
children = (
488EECB11ADFEDC6004EAA71 /* Demo.app */,
);
name = Products;
sourceTree = "<group>";
};
488EECB31ADFEDC6004EAA71 /* Demo */ = {
isa = PBXGroup;
children = (
48954A191B5102E200EFD15D /* Classes */,
488EECEA1ADFF905004EAA71 /* Feed */,
488EECC11ADFEDC6004EAA71 /* Images.xcassets */,
488EECC31ADFEDC6004EAA71 /* LaunchScreen.xib */,
488EECB41ADFEDC6004EAA71 /* Supporting Files */,
);
path = Demo;
sourceTree = "<group>";
};
488EECB41ADFEDC6004EAA71 /* Supporting Files */ = {
isa = PBXGroup;
children = (
488EECB51ADFEDC6004EAA71 /* Info.plist */,
488EECB61ADFEDC6004EAA71 /* main.m */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
488EECEA1ADFF905004EAA71 /* Feed */ = {
isa = PBXGroup;
children = (
488EECE11ADFF884004EAA71 /* FDFeedEntity.h */,
488EECE21ADFF884004EAA71 /* FDFeedEntity.m */,
488EECB81ADFEDC6004EAA71 /* FDAppDelegate.h */,
488EECB91ADFEDC6004EAA71 /* FDAppDelegate.m */,
488EECDE1ADFF7A5004EAA71 /* FDFeedViewController.h */,
488EECDF1ADFF7A5004EAA71 /* FDFeedViewController.m */,
4897E5DE1AE090B900E87B5F /* FDFeedCell.h */,
4897E5DF1AE090B900E87B5F /* FDFeedCell.m */,
488EECBE1ADFEDC6004EAA71 /* Main.storyboard */,
4897E5DC1ADFFBBD00E87B5F /* data.json */,
);
name = Feed;
sourceTree = "<group>";
};
48954A191B5102E200EFD15D /* Classes */ = {
isa = PBXGroup;
children = (
48954A1E1B5102E200EFD15D /* UITableView+FDTemplateLayoutCell.h */,
48954A1F1B5102E200EFD15D /* UITableView+FDTemplateLayoutCell.m */,
485DB8991BAFFF8900CEAE33 /* UITableView+FDKeyedHeightCache.h */,
485DB89A1BAFFF8900CEAE33 /* UITableView+FDKeyedHeightCache.m */,
485DB89C1BB0004300CEAE33 /* UITableView+FDIndexPathHeightCache.h */,
485DB89D1BB0004300CEAE33 /* UITableView+FDIndexPathHeightCache.m */,
48954A201B5102E200EFD15D /* UITableView+FDTemplateLayoutCellDebug.h */,
48954A211B5102E200EFD15D /* UITableView+FDTemplateLayoutCellDebug.m */,
);
name = Classes;
path = ../../Classes;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
488EECB01ADFEDC6004EAA71 /* Demo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 488EECD41ADFEDC6004EAA71 /* Build configuration list for PBXNativeTarget "Demo" */;
buildPhases = (
488EECAD1ADFEDC6004EAA71 /* Sources */,
488EECAE1ADFEDC6004EAA71 /* Frameworks */,
488EECAF1ADFEDC6004EAA71 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Demo;
productName = Demo;
productReference = 488EECB11ADFEDC6004EAA71 /* Demo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
488EECA91ADFEDC6004EAA71 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
ORGANIZATIONNAME = forkingdog;
TargetAttributes = {
488EECB01ADFEDC6004EAA71 = {
CreatedOnToolsVersion = 6.3;
};
};
};
buildConfigurationList = 488EECAC1ADFEDC6004EAA71 /* Build configuration list for PBXProject "Demo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 488EECA81ADFEDC6004EAA71;
productRefGroup = 488EECB21ADFEDC6004EAA71 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
488EECB01ADFEDC6004EAA71 /* Demo */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
488EECAF1ADFEDC6004EAA71 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
488EECC01ADFEDC6004EAA71 /* Main.storyboard in Resources */,
488EECC51ADFEDC6004EAA71 /* LaunchScreen.xib in Resources */,
488EECC21ADFEDC6004EAA71 /* Images.xcassets in Resources */,
4897E5DD1ADFFBBD00E87B5F /* data.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
488EECAD1ADFEDC6004EAA71 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
488EECBA1ADFEDC6004EAA71 /* FDAppDelegate.m in Sources */,
48954A261B5102E200EFD15D /* UITableView+FDTemplateLayoutCell.m in Sources */,
48954A271B5102E200EFD15D /* UITableView+FDTemplateLayoutCellDebug.m in Sources */,
488EECE01ADFF7A5004EAA71 /* FDFeedViewController.m in Sources */,
4897E5E01AE090B900E87B5F /* FDFeedCell.m in Sources */,
488EECB71ADFEDC6004EAA71 /* main.m in Sources */,
485DB89B1BAFFF8900CEAE33 /* UITableView+FDKeyedHeightCache.m in Sources */,
485DB89E1BB0004300CEAE33 /* UITableView+FDIndexPathHeightCache.m in Sources */,
488EECE31ADFF884004EAA71 /* FDFeedEntity.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
488EECBE1ADFEDC6004EAA71 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
488EECBF1ADFEDC6004EAA71 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
488EECC31ADFEDC6004EAA71 /* LaunchScreen.xib */ = {
isa = PBXVariantGroup;
children = (
488EECC41ADFEDC6004EAA71 /* Base */,
);
name = LaunchScreen.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
488EECD21ADFEDC6004EAA71 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
488EECD31ADFEDC6004EAA71 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
488EECD51ADFEDC6004EAA71 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Demo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
488EECD61ADFEDC6004EAA71 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Demo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
488EECAC1ADFEDC6004EAA71 /* Build configuration list for PBXProject "Demo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
488EECD21ADFEDC6004EAA71 /* Debug */,
488EECD31ADFEDC6004EAA71 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
488EECD41ADFEDC6004EAA71 /* Build configuration list for PBXNativeTarget "Demo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
488EECD51ADFEDC6004EAA71 /* Debug */,
488EECD61ADFEDC6004EAA71 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 488EECA91ADFEDC6004EAA71 /* Project object */;
}
================================================
FILE: Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
================================================
FILE: FDTemplateCell.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:FDTemplateLayoutCell/FDTemplateLayoutCell.xcodeproj">
</FileRef>
<FileRef
location = "group:Demo/Demo.xcodeproj">
</FileRef>
</Workspace>
================================================
FILE: FDTemplateCell.xcworkspace/xcshareddata/FDTemplateCell.xcscmblueprint
================================================
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "45232C3CDBDF9DB333979E103A0429BCEB54D2EF",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"32d7d9b4-ffb1-4469-8922-27dbf3d99605++9332" : 0,
"45232C3CDBDF9DB333979E103A0429BCEB54D2EF" : 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "6569ED7F-B9F6-4B04-BF61-CB6FDE03BD78",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"32d7d9b4-ffb1-4469-8922-27dbf3d99605++9332" : "svn\/iknow",
"45232C3CDBDF9DB333979E103A0429BCEB54D2EF" : "UITableView-FDTemplateLayoutCell"
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "FDTemplateCell",
"DVTSourceControlWorkspaceBlueprintVersion" : 204,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "FDTemplateCell.xcworkspace",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/svn.baidu.com\/app\/search\/iknow",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "32d7d9b4-ffb1-4469-8922-27dbf3d99605++9332"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/forkingdog\/UITableView-FDTemplateLayoutCell.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "45232C3CDBDF9DB333979E103A0429BCEB54D2EF"
}
]
}
================================================
FILE: FDTemplateLayoutCell/FDTemplateLayoutCell.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
485022131C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 4850220D1C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
485022141C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 4850220E1C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.m */; };
485022151C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 4850220F1C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.h */; settings = {ATTRIBUTES = (Public, ); }; };
485022161C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.m in Sources */ = {isa = PBXBuildFile; fileRef = 485022101C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.m */; };
485022171C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 485022111C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.h */; settings = {ATTRIBUTES = (Public, ); }; };
485022181C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.m in Sources */ = {isa = PBXBuildFile; fileRef = 485022121C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.m */; };
E19608D11BAD53AF00BDCBBE /* FDTemplateLayoutCell.h in Headers */ = {isa = PBXBuildFile; fileRef = E19608D01BAD53AF00BDCBBE /* FDTemplateLayoutCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
E19608E01BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.h in Headers */ = {isa = PBXBuildFile; fileRef = E19608DE1BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
E19608E11BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E19608DF1BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
4850220D1C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDIndexPathHeightCache.h"; sourceTree = "<group>"; };
4850220E1C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDIndexPathHeightCache.m"; sourceTree = "<group>"; };
4850220F1C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDKeyedHeightCache.h"; sourceTree = "<group>"; };
485022101C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDKeyedHeightCache.m"; sourceTree = "<group>"; };
485022111C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDTemplateLayoutCellDebug.h"; sourceTree = "<group>"; };
485022121C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDTemplateLayoutCellDebug.m"; sourceTree = "<group>"; };
E19608CD1BAD53AF00BDCBBE /* FDTemplateLayoutCell.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FDTemplateLayoutCell.framework; sourceTree = BUILT_PRODUCTS_DIR; };
E19608D01BAD53AF00BDCBBE /* FDTemplateLayoutCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FDTemplateLayoutCell.h; sourceTree = "<group>"; };
E19608D21BAD53AF00BDCBBE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E19608DE1BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITableView+FDTemplateLayoutCell.h"; sourceTree = "<group>"; };
E19608DF1BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITableView+FDTemplateLayoutCell.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
E19608C91BAD53AF00BDCBBE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
E19608C31BAD53AE00BDCBBE = {
isa = PBXGroup;
children = (
E19608DD1BAD54EB00BDCBBE /* Classes */,
E19608CF1BAD53AF00BDCBBE /* FDTemplateLayoutCell */,
E19608CE1BAD53AF00BDCBBE /* Products */,
);
sourceTree = "<group>";
};
E19608CE1BAD53AF00BDCBBE /* Products */ = {
isa = PBXGroup;
children = (
E19608CD1BAD53AF00BDCBBE /* FDTemplateLayoutCell.framework */,
);
name = Products;
sourceTree = "<group>";
};
E19608CF1BAD53AF00BDCBBE /* FDTemplateLayoutCell */ = {
isa = PBXGroup;
children = (
E19608D01BAD53AF00BDCBBE /* FDTemplateLayoutCell.h */,
E19608D21BAD53AF00BDCBBE /* Info.plist */,
);
path = FDTemplateLayoutCell;
sourceTree = "<group>";
};
E19608DD1BAD54EB00BDCBBE /* Classes */ = {
isa = PBXGroup;
children = (
4850220D1C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.h */,
4850220E1C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.m */,
4850220F1C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.h */,
485022101C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.m */,
485022111C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.h */,
485022121C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.m */,
E19608DE1BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.h */,
E19608DF1BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.m */,
);
name = Classes;
path = ../Classes;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
E19608CA1BAD53AF00BDCBBE /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
E19608E01BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.h in Headers */,
E19608D11BAD53AF00BDCBBE /* FDTemplateLayoutCell.h in Headers */,
485022171C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.h in Headers */,
485022151C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.h in Headers */,
485022131C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
E19608CC1BAD53AF00BDCBBE /* FDTemplateLayoutCell */ = {
isa = PBXNativeTarget;
buildConfigurationList = E19608D51BAD53AF00BDCBBE /* Build configuration list for PBXNativeTarget "FDTemplateLayoutCell" */;
buildPhases = (
E19608C81BAD53AF00BDCBBE /* Sources */,
E19608C91BAD53AF00BDCBBE /* Frameworks */,
E19608CA1BAD53AF00BDCBBE /* Headers */,
E19608CB1BAD53AF00BDCBBE /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FDTemplateLayoutCell;
productName = FDTemplateLayoutCell;
productReference = E19608CD1BAD53AF00BDCBBE /* FDTemplateLayoutCell.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
E19608C41BAD53AE00BDCBBE /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0700;
TargetAttributes = {
E19608CC1BAD53AF00BDCBBE = {
CreatedOnToolsVersion = 7.0;
};
};
};
buildConfigurationList = E19608C71BAD53AE00BDCBBE /* Build configuration list for PBXProject "FDTemplateLayoutCell" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = E19608C31BAD53AE00BDCBBE;
productRefGroup = E19608CE1BAD53AF00BDCBBE /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
E19608CC1BAD53AF00BDCBBE /* FDTemplateLayoutCell */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
E19608CB1BAD53AF00BDCBBE /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
E19608C81BAD53AF00BDCBBE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
485022161C3A86EC00BD389E /* UITableView+FDKeyedHeightCache.m in Sources */,
485022181C3A86EC00BD389E /* UITableView+FDTemplateLayoutCellDebug.m in Sources */,
E19608E11BAD54EB00BDCBBE /* UITableView+FDTemplateLayoutCell.m in Sources */,
485022141C3A86EC00BD389E /* UITableView+FDIndexPathHeightCache.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
E19608D31BAD53AF00BDCBBE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
E19608D41BAD53AF00BDCBBE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
E19608D61BAD53AF00BDCBBE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = FDTemplateLayoutCell/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.forkingdog.templatelayoutcell.FDTemplateLayoutCell;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
E19608D71BAD53AF00BDCBBE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = FDTemplateLayoutCell/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.forkingdog.templatelayoutcell.FDTemplateLayoutCell;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
E19608C71BAD53AE00BDCBBE /* Build configuration list for PBXProject "FDTemplateLayoutCell" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E19608D31BAD53AF00BDCBBE /* Debug */,
E19608D41BAD53AF00BDCBBE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
E19608D51BAD53AF00BDCBBE /* Build configuration list for PBXNativeTarget "FDTemplateLayoutCell" */ = {
isa = XCConfigurationList;
buildConfigurations = (
E19608D61BAD53AF00BDCBBE /* Debug */,
E19608D71BAD53AF00BDCBBE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = E19608C41BAD53AE00BDCBBE /* Project object */;
}
================================================
FILE: FDTemplateLayoutCell/FDTemplateLayoutCell.xcodeproj/xcshareddata/xcschemes/FDTemplateLayoutCell.xcscheme
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E19608CC1BAD53AF00BDCBBE"
BuildableName = "FDTemplateLayoutCell.framework"
BlueprintName = "FDTemplateLayoutCell"
ReferencedContainer = "container:FDTemplateLayoutCell.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E19608CC1BAD53AF00BDCBBE"
BuildableName = "FDTemplateLayoutCell.framework"
BlueprintName = "FDTemplateLayoutCell"
ReferencedContainer = "container:FDTemplateLayoutCell.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E19608CC1BAD53AF00BDCBBE"
BuildableName = "FDTemplateLayoutCell.framework"
BlueprintName = "FDTemplateLayoutCell"
ReferencedContainer = "container:FDTemplateLayoutCell.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
================================================
FILE: FDTemplateLayoutCell/FDTemplateLayoutcell/FDTemplateLayoutCell.h
================================================
//
// FDTemplateLayoutCell.h
// FDTemplateLayoutCell
//
// Created by ospreyren on 9/19/15.
//
//
#import <UIKit/UIKit.h>
//! Project version number for FDTemplateLayoutCell.
FOUNDATION_EXPORT double FDTemplateLayoutCellVersionNumber;
//! Project version string for FDTemplateLayoutCell.
FOUNDATION_EXPORT const unsigned char FDTemplateLayoutCellVersionString[];
#import <FDTemplateLayoutCell/UITableView+FDTemplateLayoutCell.h>
================================================
FILE: FDTemplateLayoutCell/FDTemplateLayoutcell/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
================================================
FILE: LICENSE
================================================
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.
================================================
FILE: README.md
================================================
# UITableView-FDTemplateLayoutCell
<img src="https://cloud.githubusercontent.com/assets/219689/7244961/4209de32-e816-11e4-87bc-b161c442d348.png" width="640">
## Overview
Template auto layout cell for **automatically** UITableViewCell height calculating.

## Basic usage
If you have a **self-satisfied** cell, then all you have to do is:
``` objc
#import "UITableView+FDTemplateLayoutCell.h"
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return [tableView fd_heightForCellWithIdentifier:@"reuse identifer" configuration:^(id cell) {
// Configure this cell with data, same as what you've done in "-tableView:cellForRowAtIndexPath:"
// Like:
// cell.entity = self.feedEntities[indexPath.row];
}];
}
```
## Height Caching API
Since iOS8, `-tableView:heightForRowAtIndexPath:` will be called more times than we expect, we can feel these extra calculations when scrolling. So we provide another API with cache by index path:
``` objc
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return [tableView fd_heightForCellWithIdentifier:@"identifer" cacheByIndexPath:indexPath configuration:^(id cell) {
// configurations
}];
}
```
Or, if your entity has an unique identifier, use cache by key API:
``` objc
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
Entity *entity = self.entities[indexPath.row];
return [tableView fd_heightForCellWithIdentifier:@"identifer" cacheByKey:entity.uid configuration:^(id cell) {
// configurations
}];
}
```
## Frame layout mode
`FDTemplateLayoutCell` offers 2 modes for asking cell's height.
1. Auto layout mode using "-systemLayoutSizeFittingSize:"
2. Frame layout mode using "-sizeThatFits:"
Generally, no need to care about modes, it will **automatically** choose a proper mode by whether you have set auto layout constrants on cell's content view. If you want to enforce frame layout mode, enable this property in your cell's configuration block:
``` objc
cell.fd_enforceFrameLayout = YES;
```
And if you're using frame layout mode, you must override `-sizeThatFits:` in your customized cell and return content view's height (separator excluded)
```
- (CGSize)sizeThatFits:(CGSize)size {
return CGSizeMake(size.width, A+B+C+D+E+....);
}
```
## Debug log
Debug log helps to debug or inspect what is this "FDTemplateLayoutCell" extention doing, turning on to print logs when "calculating", "precaching" or "hitting cache".Default to "NO", log by "NSLog".
``` objc
self.tableView.fd_debugLogEnabled = YES;
```
It will print like this:
``` objc
** FDTemplateLayoutCell ** layout cell created - FDFeedCell
** FDTemplateLayoutCell ** calculate - [0:0] 233.5
** FDTemplateLayoutCell ** calculate - [0:1] 155.5
** FDTemplateLayoutCell ** calculate - [0:2] 258
** FDTemplateLayoutCell ** calculate - [0:3] 284
** FDTemplateLayoutCell ** precached - [0:3] 284
** FDTemplateLayoutCell ** calculate - [0:4] 278.5
** FDTemplateLayoutCell ** precached - [0:4] 278.5
** FDTemplateLayoutCell ** hit cache - [0:3] 284
** FDTemplateLayoutCell ** hit cache - [0:4] 278.5
** FDTemplateLayoutCell ** hit cache - [0:5] 156
** FDTemplateLayoutCell ** hit cache - [0:6] 165
```
## About self-satisfied cell
a fully **self-satisfied** cell is constrainted by auto layout and each edge("top", "left", "bottom", "right") has at least one layout constraint against it. It's the same concept introduced as "self-sizing cell" in iOS8 using auto layout.
A bad one :( - missing right and bottom

A good one :)

## Notes
A template layout cell is created by `-dequeueReusableCellWithIdentifier:` method, it means that you MUST have registered this cell reuse identifier by one of:
- A prototype cell of UITableView in storyboard.
- Use `-registerNib:forCellReuseIdentifier:`
- Use `-registerClass:forCellReuseIdentifier:`
## 如果你在天朝
可以看这篇中文博客:
[http://blog.sunnyxx.com/2015/05/17/cell-height-calculation/](http://blog.sunnyxx.com/2015/05/17/cell-height-calculation/)
## Installation
Latest version: **1.6**
```
pod search UITableView+FDTemplateLayoutCell
```
If you cannot search out the latest version, try:
```
pod setup
```
## Release Notes
We recommend to use the latest release in cocoapods.
- 1.6
fix bug in iOS 10
- 1.4
Refactor, add "cacheByKey" mode, bug fixed
- 1.3
Frame layout mode, handle cell's accessory view/type
- 1.2
Precache and auto cache invalidation
- 1.1
Height cache
- 1.0
Basic automatically height calculation
## License
MIT
================================================
FILE: UITableView+FDTemplateLayoutCell.podspec
================================================
Pod::Spec.new do |s|
s.name = "UITableView+FDTemplateLayoutCell"
s.version = "1.6"
s.summary = "Template auto layout cell for automatically UITableViewCell height calculate, cache and precache"
s.description = "Template auto layout cell for automatically UITableViewCell height calculate, cache and precache. Requires a `self-satisfied` UITableViewCell, using system's `- systemLayoutSizeFittingSize:`, provides heights caching."
s.homepage = "https://github.com/forkingdog/UITableView-FDTemplateLayoutCell"
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.license = { :type => "MIT", :file => "LICENSE" }
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.author = { "forkingdog group" => "https://github.com/forkingdog" }
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.platform = :ios, "6.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.source = { :git => "https://github.com/forkingdog/UITableView-FDTemplateLayoutCell.git", :tag => s.version.to_s }
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.source_files = "Classes/*.{h,m}"
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.requires_arc = true
end
gitextract_z1fhkhrn/ ├── .gitignore ├── Classes/ │ ├── UITableView+FDIndexPathHeightCache.h │ ├── UITableView+FDIndexPathHeightCache.m │ ├── UITableView+FDKeyedHeightCache.h │ ├── UITableView+FDKeyedHeightCache.m │ ├── UITableView+FDTemplateLayoutCell.h │ ├── UITableView+FDTemplateLayoutCell.m │ ├── UITableView+FDTemplateLayoutCellDebug.h │ └── UITableView+FDTemplateLayoutCellDebug.m ├── Demo/ │ ├── Demo/ │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.xib │ │ │ └── Main.storyboard │ │ ├── FDAppDelegate.h │ │ ├── FDAppDelegate.m │ │ ├── FDFeedCell.h │ │ ├── FDFeedCell.m │ │ ├── FDFeedEntity.h │ │ ├── FDFeedEntity.m │ │ ├── FDFeedViewController.h │ │ ├── FDFeedViewController.m │ │ ├── Images.xcassets/ │ │ │ ├── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── breaddoge.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── doge.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── forkingdog.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── phil.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── sark.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── sinojerk.imageset/ │ │ │ │ └── Contents.json │ │ │ └── sunnyxx.imageset/ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── data.json │ │ └── main.m │ └── Demo.xcodeproj/ │ ├── project.pbxproj │ └── project.xcworkspace/ │ └── contents.xcworkspacedata ├── FDTemplateCell.xcworkspace/ │ ├── contents.xcworkspacedata │ └── xcshareddata/ │ └── FDTemplateCell.xcscmblueprint ├── FDTemplateLayoutCell/ │ ├── FDTemplateLayoutCell.xcodeproj/ │ │ ├── project.pbxproj │ │ └── xcshareddata/ │ │ └── xcschemes/ │ │ └── FDTemplateLayoutCell.xcscheme │ └── FDTemplateLayoutcell/ │ ├── FDTemplateLayoutCell.h │ └── Info.plist ├── LICENSE ├── README.md └── UITableView+FDTemplateLayoutCell.podspec
Condensed preview — 41 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (152K chars).
[
{
"path": ".gitignore",
"chars": 494,
"preview": "# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!defau"
},
{
"path": "Classes/UITableView+FDIndexPathHeightCache.h",
"chars": 2215,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Classes/UITableView+FDIndexPathHeightCache.m",
"chars": 13575,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Classes/UITableView+FDKeyedHeightCache.h",
"chars": 1706,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Classes/UITableView+FDKeyedHeightCache.m",
"chars": 3285,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Classes/UITableView+FDTemplateLayoutCell.h",
"chars": 5288,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Classes/UITableView+FDTemplateLayoutCell.m",
"chars": 14121,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Classes/UITableView+FDTemplateLayoutCellDebug.h",
"chars": 1624,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Classes/UITableView+FDTemplateLayoutCellDebug.m",
"chars": 1720,
"preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog )\n//\n// Permission is "
},
{
"path": "Demo/Demo/Base.lproj/LaunchScreen.xib",
"chars": 3700,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" versi"
},
{
"path": "Demo/Demo/Base.lproj/Main.storyboard",
"chars": 15072,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
},
{
"path": "Demo/Demo/FDAppDelegate.h",
"chars": 273,
"preview": "//\n// AppDelegate.h\n// Demo\n//\n// Created by sunnyxx on 15/4/16.\n// Copyright (c) 2015年 forkingdog. All rights reser"
},
{
"path": "Demo/Demo/FDAppDelegate.m",
"chars": 192,
"preview": "//\n// AppDelegate.m\n// Demo\n//\n// Created by sunnyxx on 15/4/16.\n// Copyright (c) 2015年 forkingdog. All rights reser"
},
{
"path": "Demo/Demo/FDFeedCell.h",
"chars": 277,
"preview": "//\n// FDFeedCell.h\n// Demo\n//\n// Created by sunnyxx on 15/4/17.\n// Copyright (c) 2015年 forkingdog. All rights reserv"
},
{
"path": "Demo/Demo/FDFeedCell.m",
"chars": 1580,
"preview": "//\n// FDFeedCell.m\n// Demo\n//\n// Created by sunnyxx on 15/4/17.\n// Copyright (c) 2015年 forkingdog. All rights reserv"
},
{
"path": "Demo/Demo/FDFeedEntity.h",
"chars": 614,
"preview": "//\n// FDFeedEntity.h\n// Demo\n//\n// Created by sunnyxx on 15/4/16.\n// Copyright (c) 2015年 forkingdog. All rights rese"
},
{
"path": "Demo/Demo/FDFeedEntity.m",
"chars": 718,
"preview": "//\n// FDFeedEntity.m\n// Demo\n//\n// Created by sunnyxx on 15/4/16.\n// Copyright (c) 2015年 forkingdog. All rights rese"
},
{
"path": "Demo/Demo/FDFeedViewController.h",
"chars": 225,
"preview": "//\n// FDFeedViewController.h\n// Demo\n//\n// Created by sunnyxx on 15/4/16.\n// Copyright (c) 2015年 forkingdog. All rig"
},
{
"path": "Demo/Demo/FDFeedViewController.m",
"chars": 7225,
"preview": "//\n// FDFeedViewController.m\n// Demo\n//\n// Created by sunnyxx on 15/4/16.\n// Copyright (c) 2015年 forkingdog. All rig"
},
{
"path": "Demo/Demo/Images.xcassets/AppIcon.appiconset/Contents.json",
"chars": 585,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"29x29\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\""
},
{
"path": "Demo/Demo/Images.xcassets/breaddoge.imageset/Contents.json",
"chars": 306,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "Demo/Demo/Images.xcassets/doge.imageset/Contents.json",
"chars": 304,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "Demo/Demo/Images.xcassets/forkingdog.imageset/Contents.json",
"chars": 310,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "Demo/Demo/Images.xcassets/phil.imageset/Contents.json",
"chars": 301,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "Demo/Demo/Images.xcassets/sark.imageset/Contents.json",
"chars": 304,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "Demo/Demo/Images.xcassets/sinojerk.imageset/Contents.json",
"chars": 301,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "Demo/Demo/Images.xcassets/sunnyxx.imageset/Contents.json",
"chars": 299,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "Demo/Demo/Info.plist",
"chars": 1244,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "Demo/Demo/data.json",
"chars": 16989,
"preview": "{\n \"feed\": [\n {\n \"title\": \"Hello world\",\n \"content\": \"This is forkingdog team. He"
},
{
"path": "Demo/Demo/main.m",
"chars": 333,
"preview": "//\n// main.m\n// Demo\n//\n// Created by sunnyxx on 15/4/16.\n// Copyright (c) 2015年 forkingdog. All rights reserved.\n//"
},
{
"path": "Demo/Demo.xcodeproj/project.pbxproj",
"chars": 17116,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 135,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:\">\n </FileRef"
},
{
"path": "FDTemplateCell.xcworkspace/contents.xcworkspacedata",
"chars": 259,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"group:FDTemplateLayo"
},
{
"path": "FDTemplateCell.xcworkspace/xcshareddata/FDTemplateCell.xcscmblueprint",
"chars": 1704,
"preview": "{\n \"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey\" : \"45232C3CDBDF9DB333979E103A0429BCEB54D2EF\",\n \"DVTS"
},
{
"path": "FDTemplateLayoutCell/FDTemplateLayoutCell.xcodeproj/project.pbxproj",
"chars": 14506,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "FDTemplateLayoutCell/FDTemplateLayoutCell.xcodeproj/xcshareddata/xcschemes/FDTemplateLayoutCell.xcscheme",
"chars": 2967,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n LastUpgradeVersion = \"0700\"\n version = \"1.3\">\n <BuildAction\n "
},
{
"path": "FDTemplateLayoutCell/FDTemplateLayoutcell/FDTemplateLayoutCell.h",
"chars": 436,
"preview": "//\n// FDTemplateLayoutCell.h\n// FDTemplateLayoutCell\n//\n// Created by ospreyren on 9/19/15.\n//\n//\n\n#import <UIKit/UIK"
},
{
"path": "FDTemplateLayoutCell/FDTemplateLayoutcell/Info.plist",
"chars": 806,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "LICENSE",
"chars": 1068,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 \n\nPermission is hereby granted, free of charge, to any person obtaining a copy"
},
{
"path": "README.md",
"chars": 5012,
"preview": "# UITableView-FDTemplateLayoutCell\n<img src=\"https://cloud.githubusercontent.com/assets/219689/7244961/4209de32-e816-11e"
},
{
"path": "UITableView+FDTemplateLayoutCell.podspec",
"chars": 1388,
"preview": "\nPod::Spec.new do |s|\n s.name = \"UITableView+FDTemplateLayoutCell\"\n s.version = \"1.6\"\n s.summary = "
}
]
About this extraction
This page contains the full source code of the forkingdog/UITableView-FDTemplateLayoutCell GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 41 files (137.3 KB), approximately 38.0k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.