├── CRVisibleCellsDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── Charon.xcuserdatad │ └── xcschemes │ ├── CRVisibleCellsDemo.xcscheme │ └── xcschememanagement.plist └── CRVisibleCellsDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json ├── Contents.json └── banner.imageset │ ├── Contents.json │ └── banner.jpg ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Cells ├── CRBannerTableViewCell.h ├── CRBannerTableViewCell.m ├── CRBannerTableViewCell.xib ├── CRCommentHeaderTableViewCell.h ├── CRCommentHeaderTableViewCell.m ├── CRCommentHeaderTableViewCell.xib ├── CRCommentTableViewCell.h ├── CRCommentTableViewCell.m ├── CRCommentTableViewCell.xib ├── CRGoodsDescTableViewCell.h ├── CRGoodsDescTableViewCell.m ├── CRGoodsDescTableViewCell.xib ├── CRGoodsNameTableViewCell.h ├── CRGoodsNameTableViewCell.m ├── CRGoodsNameTableViewCell.xib ├── CRGoodsPriceTableViewCell.h ├── CRGoodsPriceTableViewCell.m ├── CRGoodsPriceTableViewCell.xib ├── CRHasSelectedTableViewCell.h ├── CRHasSelectedTableViewCell.m ├── CRHasSelectedTableViewCell.xib ├── CRPromotionTableViewCell.h ├── CRPromotionTableViewCell.m ├── CRPromotionTableViewCell.xib ├── CRRecommendTableViewCell.h ├── CRRecommendTableViewCell.m ├── CRRecommendTableViewCell.xib ├── CRStoreInfoTableViewCell.h ├── CRStoreInfoTableViewCell.m └── CRStoreInfoTableViewCell.xib ├── Configurator ├── CRVisibleCellsConfigurator.h ├── CRVisibleCellsConfigurator.m ├── NSString+Size.h └── NSString+Size.m ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m /CRVisibleCellsDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 904205A71E4B2C46004083B8 /* NSString+Size.m in Sources */ = {isa = PBXBuildFile; fileRef = 904205A61E4B2C46004083B8 /* NSString+Size.m */; }; 11 | 90F07DE61E4ABFFE00625AA5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07DE51E4ABFFE00625AA5 /* main.m */; }; 12 | 90F07DE91E4ABFFE00625AA5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07DE81E4ABFFE00625AA5 /* AppDelegate.m */; }; 13 | 90F07DEC1E4ABFFE00625AA5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07DEB1E4ABFFE00625AA5 /* ViewController.m */; }; 14 | 90F07DEF1E4ABFFE00625AA5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 90F07DED1E4ABFFE00625AA5 /* Main.storyboard */; }; 15 | 90F07DF11E4ABFFE00625AA5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90F07DF01E4ABFFE00625AA5 /* Assets.xcassets */; }; 16 | 90F07DF41E4ABFFE00625AA5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 90F07DF21E4ABFFE00625AA5 /* LaunchScreen.storyboard */; }; 17 | 90F07DFF1E4AC19C00625AA5 /* CRVisibleCellsConfigurator.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07DFE1E4AC19C00625AA5 /* CRVisibleCellsConfigurator.m */; }; 18 | 90F07E031E4AC1C700625AA5 /* CRBannerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E011E4AC1C700625AA5 /* CRBannerTableViewCell.m */; }; 19 | 90F07E041E4AC1C700625AA5 /* CRBannerTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E021E4AC1C700625AA5 /* CRBannerTableViewCell.xib */; }; 20 | 90F07E081E4AC6F200625AA5 /* CRGoodsNameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E061E4AC6F200625AA5 /* CRGoodsNameTableViewCell.m */; }; 21 | 90F07E091E4AC6F200625AA5 /* CRGoodsNameTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E071E4AC6F200625AA5 /* CRGoodsNameTableViewCell.xib */; }; 22 | 90F07E0D1E4AE76800625AA5 /* CRGoodsDescTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E0B1E4AE76800625AA5 /* CRGoodsDescTableViewCell.m */; }; 23 | 90F07E0E1E4AE76800625AA5 /* CRGoodsDescTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E0C1E4AE76800625AA5 /* CRGoodsDescTableViewCell.xib */; }; 24 | 90F07E121E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E101E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.m */; }; 25 | 90F07E131E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E111E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.xib */; }; 26 | 90F07E171E4AED8700625AA5 /* CRHasSelectedTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E151E4AED8700625AA5 /* CRHasSelectedTableViewCell.m */; }; 27 | 90F07E181E4AED8700625AA5 /* CRHasSelectedTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E161E4AED8700625AA5 /* CRHasSelectedTableViewCell.xib */; }; 28 | 90F07E1C1E4AEDAD00625AA5 /* CRPromotionTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E1A1E4AEDAD00625AA5 /* CRPromotionTableViewCell.m */; }; 29 | 90F07E1D1E4AEDAD00625AA5 /* CRPromotionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E1B1E4AEDAD00625AA5 /* CRPromotionTableViewCell.xib */; }; 30 | 90F07E211E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E1F1E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.m */; }; 31 | 90F07E221E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E201E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.xib */; }; 32 | 90F07E261E4AF59B00625AA5 /* CRCommentTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E241E4AF59B00625AA5 /* CRCommentTableViewCell.m */; }; 33 | 90F07E271E4AF59B00625AA5 /* CRCommentTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E251E4AF59B00625AA5 /* CRCommentTableViewCell.xib */; }; 34 | 90F07E2B1E4AF70100625AA5 /* CRStoreInfoTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E291E4AF70100625AA5 /* CRStoreInfoTableViewCell.m */; }; 35 | 90F07E2C1E4AF70100625AA5 /* CRStoreInfoTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E2A1E4AF70100625AA5 /* CRStoreInfoTableViewCell.xib */; }; 36 | 90F07E301E4AF8F300625AA5 /* CRRecommendTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 90F07E2E1E4AF8F300625AA5 /* CRRecommendTableViewCell.m */; }; 37 | 90F07E311E4AF8F300625AA5 /* CRRecommendTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90F07E2F1E4AF8F300625AA5 /* CRRecommendTableViewCell.xib */; }; 38 | /* End PBXBuildFile section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 904205A51E4B2C46004083B8 /* NSString+Size.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Size.h"; sourceTree = ""; }; 42 | 904205A61E4B2C46004083B8 /* NSString+Size.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Size.m"; sourceTree = ""; }; 43 | 90F07DE11E4ABFFE00625AA5 /* CRVisibleCellsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CRVisibleCellsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 90F07DE51E4ABFFE00625AA5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | 90F07DE71E4ABFFE00625AA5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 90F07DE81E4ABFFE00625AA5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 90F07DEA1E4ABFFE00625AA5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 48 | 90F07DEB1E4ABFFE00625AA5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 49 | 90F07DEE1E4ABFFE00625AA5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 90F07DF01E4ABFFE00625AA5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 90F07DF31E4ABFFE00625AA5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 90F07DF51E4ABFFE00625AA5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 90F07DFD1E4AC19C00625AA5 /* CRVisibleCellsConfigurator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRVisibleCellsConfigurator.h; sourceTree = ""; }; 54 | 90F07DFE1E4AC19C00625AA5 /* CRVisibleCellsConfigurator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRVisibleCellsConfigurator.m; sourceTree = ""; }; 55 | 90F07E001E4AC1C700625AA5 /* CRBannerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRBannerTableViewCell.h; sourceTree = ""; }; 56 | 90F07E011E4AC1C700625AA5 /* CRBannerTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRBannerTableViewCell.m; sourceTree = ""; }; 57 | 90F07E021E4AC1C700625AA5 /* CRBannerTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRBannerTableViewCell.xib; sourceTree = ""; }; 58 | 90F07E051E4AC6F200625AA5 /* CRGoodsNameTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRGoodsNameTableViewCell.h; sourceTree = ""; }; 59 | 90F07E061E4AC6F200625AA5 /* CRGoodsNameTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRGoodsNameTableViewCell.m; sourceTree = ""; }; 60 | 90F07E071E4AC6F200625AA5 /* CRGoodsNameTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRGoodsNameTableViewCell.xib; sourceTree = ""; }; 61 | 90F07E0A1E4AE76800625AA5 /* CRGoodsDescTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRGoodsDescTableViewCell.h; sourceTree = ""; }; 62 | 90F07E0B1E4AE76800625AA5 /* CRGoodsDescTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRGoodsDescTableViewCell.m; sourceTree = ""; }; 63 | 90F07E0C1E4AE76800625AA5 /* CRGoodsDescTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRGoodsDescTableViewCell.xib; sourceTree = ""; }; 64 | 90F07E0F1E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRGoodsPriceTableViewCell.h; sourceTree = ""; }; 65 | 90F07E101E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRGoodsPriceTableViewCell.m; sourceTree = ""; }; 66 | 90F07E111E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRGoodsPriceTableViewCell.xib; sourceTree = ""; }; 67 | 90F07E141E4AED8700625AA5 /* CRHasSelectedTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRHasSelectedTableViewCell.h; sourceTree = ""; }; 68 | 90F07E151E4AED8700625AA5 /* CRHasSelectedTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRHasSelectedTableViewCell.m; sourceTree = ""; }; 69 | 90F07E161E4AED8700625AA5 /* CRHasSelectedTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRHasSelectedTableViewCell.xib; sourceTree = ""; }; 70 | 90F07E191E4AEDAD00625AA5 /* CRPromotionTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRPromotionTableViewCell.h; sourceTree = ""; }; 71 | 90F07E1A1E4AEDAD00625AA5 /* CRPromotionTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRPromotionTableViewCell.m; sourceTree = ""; }; 72 | 90F07E1B1E4AEDAD00625AA5 /* CRPromotionTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRPromotionTableViewCell.xib; sourceTree = ""; }; 73 | 90F07E1E1E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRCommentHeaderTableViewCell.h; sourceTree = ""; }; 74 | 90F07E1F1E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRCommentHeaderTableViewCell.m; sourceTree = ""; }; 75 | 90F07E201E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRCommentHeaderTableViewCell.xib; sourceTree = ""; }; 76 | 90F07E231E4AF59B00625AA5 /* CRCommentTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRCommentTableViewCell.h; sourceTree = ""; }; 77 | 90F07E241E4AF59B00625AA5 /* CRCommentTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRCommentTableViewCell.m; sourceTree = ""; }; 78 | 90F07E251E4AF59B00625AA5 /* CRCommentTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRCommentTableViewCell.xib; sourceTree = ""; }; 79 | 90F07E281E4AF70100625AA5 /* CRStoreInfoTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRStoreInfoTableViewCell.h; sourceTree = ""; }; 80 | 90F07E291E4AF70100625AA5 /* CRStoreInfoTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRStoreInfoTableViewCell.m; sourceTree = ""; }; 81 | 90F07E2A1E4AF70100625AA5 /* CRStoreInfoTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRStoreInfoTableViewCell.xib; sourceTree = ""; }; 82 | 90F07E2D1E4AF8F300625AA5 /* CRRecommendTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRRecommendTableViewCell.h; sourceTree = ""; }; 83 | 90F07E2E1E4AF8F300625AA5 /* CRRecommendTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRRecommendTableViewCell.m; sourceTree = ""; }; 84 | 90F07E2F1E4AF8F300625AA5 /* CRRecommendTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CRRecommendTableViewCell.xib; sourceTree = ""; }; 85 | /* End PBXFileReference section */ 86 | 87 | /* Begin PBXFrameworksBuildPhase section */ 88 | 90F07DDE1E4ABFFE00625AA5 /* Frameworks */ = { 89 | isa = PBXFrameworksBuildPhase; 90 | buildActionMask = 2147483647; 91 | files = ( 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 90F07DD81E4ABFFE00625AA5 = { 99 | isa = PBXGroup; 100 | children = ( 101 | 90F07DE31E4ABFFE00625AA5 /* CRVisibleCellsDemo */, 102 | 90F07DE21E4ABFFE00625AA5 /* Products */, 103 | ); 104 | sourceTree = ""; 105 | }; 106 | 90F07DE21E4ABFFE00625AA5 /* Products */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 90F07DE11E4ABFFE00625AA5 /* CRVisibleCellsDemo.app */, 110 | ); 111 | name = Products; 112 | sourceTree = ""; 113 | }; 114 | 90F07DE31E4ABFFE00625AA5 /* CRVisibleCellsDemo */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 90F07DFB1E4AC0EA00625AA5 /* Configurator */, 118 | 90F07DFC1E4AC0EA00625AA5 /* Cells */, 119 | 90F07DE71E4ABFFE00625AA5 /* AppDelegate.h */, 120 | 90F07DE81E4ABFFE00625AA5 /* AppDelegate.m */, 121 | 90F07DEA1E4ABFFE00625AA5 /* ViewController.h */, 122 | 90F07DEB1E4ABFFE00625AA5 /* ViewController.m */, 123 | 90F07DED1E4ABFFE00625AA5 /* Main.storyboard */, 124 | 90F07DF01E4ABFFE00625AA5 /* Assets.xcassets */, 125 | 90F07DF21E4ABFFE00625AA5 /* LaunchScreen.storyboard */, 126 | 90F07DF51E4ABFFE00625AA5 /* Info.plist */, 127 | 90F07DE41E4ABFFE00625AA5 /* Supporting Files */, 128 | ); 129 | path = CRVisibleCellsDemo; 130 | sourceTree = ""; 131 | }; 132 | 90F07DE41E4ABFFE00625AA5 /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 90F07DE51E4ABFFE00625AA5 /* main.m */, 136 | ); 137 | name = "Supporting Files"; 138 | sourceTree = ""; 139 | }; 140 | 90F07DFB1E4AC0EA00625AA5 /* Configurator */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 90F07DFD1E4AC19C00625AA5 /* CRVisibleCellsConfigurator.h */, 144 | 90F07DFE1E4AC19C00625AA5 /* CRVisibleCellsConfigurator.m */, 145 | 904205A51E4B2C46004083B8 /* NSString+Size.h */, 146 | 904205A61E4B2C46004083B8 /* NSString+Size.m */, 147 | ); 148 | path = Configurator; 149 | sourceTree = ""; 150 | }; 151 | 90F07DFC1E4AC0EA00625AA5 /* Cells */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 90F07E001E4AC1C700625AA5 /* CRBannerTableViewCell.h */, 155 | 90F07E011E4AC1C700625AA5 /* CRBannerTableViewCell.m */, 156 | 90F07E021E4AC1C700625AA5 /* CRBannerTableViewCell.xib */, 157 | 90F07E051E4AC6F200625AA5 /* CRGoodsNameTableViewCell.h */, 158 | 90F07E061E4AC6F200625AA5 /* CRGoodsNameTableViewCell.m */, 159 | 90F07E071E4AC6F200625AA5 /* CRGoodsNameTableViewCell.xib */, 160 | 90F07E0A1E4AE76800625AA5 /* CRGoodsDescTableViewCell.h */, 161 | 90F07E0B1E4AE76800625AA5 /* CRGoodsDescTableViewCell.m */, 162 | 90F07E0C1E4AE76800625AA5 /* CRGoodsDescTableViewCell.xib */, 163 | 90F07E0F1E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.h */, 164 | 90F07E101E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.m */, 165 | 90F07E111E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.xib */, 166 | 90F07E191E4AEDAD00625AA5 /* CRPromotionTableViewCell.h */, 167 | 90F07E1A1E4AEDAD00625AA5 /* CRPromotionTableViewCell.m */, 168 | 90F07E1B1E4AEDAD00625AA5 /* CRPromotionTableViewCell.xib */, 169 | 90F07E141E4AED8700625AA5 /* CRHasSelectedTableViewCell.h */, 170 | 90F07E151E4AED8700625AA5 /* CRHasSelectedTableViewCell.m */, 171 | 90F07E161E4AED8700625AA5 /* CRHasSelectedTableViewCell.xib */, 172 | 90F07E1E1E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.h */, 173 | 90F07E1F1E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.m */, 174 | 90F07E201E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.xib */, 175 | 90F07E231E4AF59B00625AA5 /* CRCommentTableViewCell.h */, 176 | 90F07E241E4AF59B00625AA5 /* CRCommentTableViewCell.m */, 177 | 90F07E251E4AF59B00625AA5 /* CRCommentTableViewCell.xib */, 178 | 90F07E281E4AF70100625AA5 /* CRStoreInfoTableViewCell.h */, 179 | 90F07E291E4AF70100625AA5 /* CRStoreInfoTableViewCell.m */, 180 | 90F07E2A1E4AF70100625AA5 /* CRStoreInfoTableViewCell.xib */, 181 | 90F07E2D1E4AF8F300625AA5 /* CRRecommendTableViewCell.h */, 182 | 90F07E2E1E4AF8F300625AA5 /* CRRecommendTableViewCell.m */, 183 | 90F07E2F1E4AF8F300625AA5 /* CRRecommendTableViewCell.xib */, 184 | ); 185 | path = Cells; 186 | sourceTree = ""; 187 | }; 188 | /* End PBXGroup section */ 189 | 190 | /* Begin PBXNativeTarget section */ 191 | 90F07DE01E4ABFFE00625AA5 /* CRVisibleCellsDemo */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 90F07DF81E4ABFFE00625AA5 /* Build configuration list for PBXNativeTarget "CRVisibleCellsDemo" */; 194 | buildPhases = ( 195 | 90F07DDD1E4ABFFE00625AA5 /* Sources */, 196 | 90F07DDE1E4ABFFE00625AA5 /* Frameworks */, 197 | 90F07DDF1E4ABFFE00625AA5 /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | ); 203 | name = CRVisibleCellsDemo; 204 | productName = CRVisibleCellsDemo; 205 | productReference = 90F07DE11E4ABFFE00625AA5 /* CRVisibleCellsDemo.app */; 206 | productType = "com.apple.product-type.application"; 207 | }; 208 | /* End PBXNativeTarget section */ 209 | 210 | /* Begin PBXProject section */ 211 | 90F07DD91E4ABFFE00625AA5 /* Project object */ = { 212 | isa = PBXProject; 213 | attributes = { 214 | LastUpgradeCheck = 0820; 215 | ORGANIZATIONNAME = Charon; 216 | TargetAttributes = { 217 | 90F07DE01E4ABFFE00625AA5 = { 218 | CreatedOnToolsVersion = 8.2.1; 219 | ProvisioningStyle = Automatic; 220 | }; 221 | }; 222 | }; 223 | buildConfigurationList = 90F07DDC1E4ABFFE00625AA5 /* Build configuration list for PBXProject "CRVisibleCellsDemo" */; 224 | compatibilityVersion = "Xcode 3.2"; 225 | developmentRegion = English; 226 | hasScannedForEncodings = 0; 227 | knownRegions = ( 228 | en, 229 | Base, 230 | ); 231 | mainGroup = 90F07DD81E4ABFFE00625AA5; 232 | productRefGroup = 90F07DE21E4ABFFE00625AA5 /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | 90F07DE01E4ABFFE00625AA5 /* CRVisibleCellsDemo */, 237 | ); 238 | }; 239 | /* End PBXProject section */ 240 | 241 | /* Begin PBXResourcesBuildPhase section */ 242 | 90F07DDF1E4ABFFE00625AA5 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 90F07E221E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.xib in Resources */, 247 | 90F07E0E1E4AE76800625AA5 /* CRGoodsDescTableViewCell.xib in Resources */, 248 | 90F07E271E4AF59B00625AA5 /* CRCommentTableViewCell.xib in Resources */, 249 | 90F07E311E4AF8F300625AA5 /* CRRecommendTableViewCell.xib in Resources */, 250 | 90F07E041E4AC1C700625AA5 /* CRBannerTableViewCell.xib in Resources */, 251 | 90F07E131E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.xib in Resources */, 252 | 90F07E1D1E4AEDAD00625AA5 /* CRPromotionTableViewCell.xib in Resources */, 253 | 90F07DF41E4ABFFE00625AA5 /* LaunchScreen.storyboard in Resources */, 254 | 90F07E181E4AED8700625AA5 /* CRHasSelectedTableViewCell.xib in Resources */, 255 | 90F07DF11E4ABFFE00625AA5 /* Assets.xcassets in Resources */, 256 | 90F07E091E4AC6F200625AA5 /* CRGoodsNameTableViewCell.xib in Resources */, 257 | 90F07E2C1E4AF70100625AA5 /* CRStoreInfoTableViewCell.xib in Resources */, 258 | 90F07DEF1E4ABFFE00625AA5 /* Main.storyboard in Resources */, 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | /* End PBXResourcesBuildPhase section */ 263 | 264 | /* Begin PBXSourcesBuildPhase section */ 265 | 90F07DDD1E4ABFFE00625AA5 /* Sources */ = { 266 | isa = PBXSourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | 90F07E0D1E4AE76800625AA5 /* CRGoodsDescTableViewCell.m in Sources */, 270 | 90F07E031E4AC1C700625AA5 /* CRBannerTableViewCell.m in Sources */, 271 | 90F07E261E4AF59B00625AA5 /* CRCommentTableViewCell.m in Sources */, 272 | 90F07E1C1E4AEDAD00625AA5 /* CRPromotionTableViewCell.m in Sources */, 273 | 904205A71E4B2C46004083B8 /* NSString+Size.m in Sources */, 274 | 90F07DFF1E4AC19C00625AA5 /* CRVisibleCellsConfigurator.m in Sources */, 275 | 90F07DEC1E4ABFFE00625AA5 /* ViewController.m in Sources */, 276 | 90F07DE91E4ABFFE00625AA5 /* AppDelegate.m in Sources */, 277 | 90F07E211E4AF36E00625AA5 /* CRCommentHeaderTableViewCell.m in Sources */, 278 | 90F07E121E4AEBED00625AA5 /* CRGoodsPriceTableViewCell.m in Sources */, 279 | 90F07E301E4AF8F300625AA5 /* CRRecommendTableViewCell.m in Sources */, 280 | 90F07E2B1E4AF70100625AA5 /* CRStoreInfoTableViewCell.m in Sources */, 281 | 90F07E081E4AC6F200625AA5 /* CRGoodsNameTableViewCell.m in Sources */, 282 | 90F07E171E4AED8700625AA5 /* CRHasSelectedTableViewCell.m in Sources */, 283 | 90F07DE61E4ABFFE00625AA5 /* main.m in Sources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | /* End PBXSourcesBuildPhase section */ 288 | 289 | /* Begin PBXVariantGroup section */ 290 | 90F07DED1E4ABFFE00625AA5 /* Main.storyboard */ = { 291 | isa = PBXVariantGroup; 292 | children = ( 293 | 90F07DEE1E4ABFFE00625AA5 /* Base */, 294 | ); 295 | name = Main.storyboard; 296 | sourceTree = ""; 297 | }; 298 | 90F07DF21E4ABFFE00625AA5 /* LaunchScreen.storyboard */ = { 299 | isa = PBXVariantGroup; 300 | children = ( 301 | 90F07DF31E4ABFFE00625AA5 /* Base */, 302 | ); 303 | name = LaunchScreen.storyboard; 304 | sourceTree = ""; 305 | }; 306 | /* End PBXVariantGroup section */ 307 | 308 | /* Begin XCBuildConfiguration section */ 309 | 90F07DF61E4ABFFE00625AA5 /* Debug */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ALWAYS_SEARCH_USER_PATHS = NO; 313 | CLANG_ANALYZER_NONNULL = YES; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INFINITE_RECURSION = YES; 325 | CLANG_WARN_INT_CONVERSION = YES; 326 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 327 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 328 | CLANG_WARN_UNREACHABLE_CODE = YES; 329 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 330 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 331 | COPY_PHASE_STRIP = NO; 332 | DEBUG_INFORMATION_FORMAT = dwarf; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | ENABLE_TESTABILITY = YES; 335 | GCC_C_LANGUAGE_STANDARD = gnu99; 336 | GCC_DYNAMIC_NO_PIC = NO; 337 | GCC_NO_COMMON_BLOCKS = YES; 338 | GCC_OPTIMIZATION_LEVEL = 0; 339 | GCC_PREPROCESSOR_DEFINITIONS = ( 340 | "DEBUG=1", 341 | "$(inherited)", 342 | ); 343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 345 | GCC_WARN_UNDECLARED_SELECTOR = YES; 346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 347 | GCC_WARN_UNUSED_FUNCTION = YES; 348 | GCC_WARN_UNUSED_VARIABLE = YES; 349 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 350 | MTL_ENABLE_DEBUG_INFO = YES; 351 | ONLY_ACTIVE_ARCH = YES; 352 | SDKROOT = iphoneos; 353 | }; 354 | name = Debug; 355 | }; 356 | 90F07DF71E4ABFFE00625AA5 /* Release */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ALWAYS_SEARCH_USER_PATHS = NO; 360 | CLANG_ANALYZER_NONNULL = YES; 361 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 362 | CLANG_CXX_LIBRARY = "libc++"; 363 | CLANG_ENABLE_MODULES = YES; 364 | CLANG_ENABLE_OBJC_ARC = YES; 365 | CLANG_WARN_BOOL_CONVERSION = YES; 366 | CLANG_WARN_CONSTANT_CONVERSION = YES; 367 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 368 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 369 | CLANG_WARN_EMPTY_BODY = YES; 370 | CLANG_WARN_ENUM_CONVERSION = YES; 371 | CLANG_WARN_INFINITE_RECURSION = YES; 372 | CLANG_WARN_INT_CONVERSION = YES; 373 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 374 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 375 | CLANG_WARN_UNREACHABLE_CODE = YES; 376 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 377 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 378 | COPY_PHASE_STRIP = NO; 379 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 380 | ENABLE_NS_ASSERTIONS = NO; 381 | ENABLE_STRICT_OBJC_MSGSEND = YES; 382 | GCC_C_LANGUAGE_STANDARD = gnu99; 383 | GCC_NO_COMMON_BLOCKS = YES; 384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 386 | GCC_WARN_UNDECLARED_SELECTOR = YES; 387 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 388 | GCC_WARN_UNUSED_FUNCTION = YES; 389 | GCC_WARN_UNUSED_VARIABLE = YES; 390 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 391 | MTL_ENABLE_DEBUG_INFO = NO; 392 | SDKROOT = iphoneos; 393 | VALIDATE_PRODUCT = YES; 394 | }; 395 | name = Release; 396 | }; 397 | 90F07DF91E4ABFFE00625AA5 /* Debug */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 401 | INFOPLIST_FILE = CRVisibleCellsDemo/Info.plist; 402 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 403 | PRODUCT_BUNDLE_IDENTIFIER = BS.CRVisibleCellsDemo; 404 | PRODUCT_NAME = "$(TARGET_NAME)"; 405 | }; 406 | name = Debug; 407 | }; 408 | 90F07DFA1E4ABFFE00625AA5 /* Release */ = { 409 | isa = XCBuildConfiguration; 410 | buildSettings = { 411 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 412 | INFOPLIST_FILE = CRVisibleCellsDemo/Info.plist; 413 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 414 | PRODUCT_BUNDLE_IDENTIFIER = BS.CRVisibleCellsDemo; 415 | PRODUCT_NAME = "$(TARGET_NAME)"; 416 | }; 417 | name = Release; 418 | }; 419 | /* End XCBuildConfiguration section */ 420 | 421 | /* Begin XCConfigurationList section */ 422 | 90F07DDC1E4ABFFE00625AA5 /* Build configuration list for PBXProject "CRVisibleCellsDemo" */ = { 423 | isa = XCConfigurationList; 424 | buildConfigurations = ( 425 | 90F07DF61E4ABFFE00625AA5 /* Debug */, 426 | 90F07DF71E4ABFFE00625AA5 /* Release */, 427 | ); 428 | defaultConfigurationIsVisible = 0; 429 | defaultConfigurationName = Release; 430 | }; 431 | 90F07DF81E4ABFFE00625AA5 /* Build configuration list for PBXNativeTarget "CRVisibleCellsDemo" */ = { 432 | isa = XCConfigurationList; 433 | buildConfigurations = ( 434 | 90F07DF91E4ABFFE00625AA5 /* Debug */, 435 | 90F07DFA1E4ABFFE00625AA5 /* Release */, 436 | ); 437 | defaultConfigurationIsVisible = 0; 438 | defaultConfigurationName = Release; 439 | }; 440 | /* End XCConfigurationList section */ 441 | }; 442 | rootObject = 90F07DD91E4ABFFE00625AA5 /* Project object */; 443 | } 444 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo.xcodeproj/xcuserdata/Charon.xcuserdatad/xcschemes/CRVisibleCellsDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo.xcodeproj/xcuserdata/Charon.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CRVisibleCellsDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 90F07DE01E4ABFFE00625AA5 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Assets.xcassets/banner.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "banner.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Assets.xcassets/banner.imageset/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sun6boys/CRVisibleCellsDemo/2735a55bc6925dd878858acc95bddd86d047f2ca/CRVisibleCellsDemo/Assets.xcassets/banner.imageset/banner.jpg -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRBannerTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRBannerTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRBannerTableViewCellIdentifier; 12 | 13 | @interface CRBannerTableViewCell : UITableViewCell 14 | 15 | + (CGFloat)cellHeight; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRBannerTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRBannerTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRBannerTableViewCell.h" 10 | 11 | NSString * const kCRBannerTableViewCellIdentifier = @"kCRBannerTableViewCellIdentifier"; 12 | 13 | @implementation CRBannerTableViewCell 14 | 15 | - (void)awakeFromNib { 16 | [super awakeFromNib]; 17 | // Initialization code 18 | } 19 | 20 | + (CGFloat)cellHeight 21 | { 22 | return 160; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRBannerTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRCommentHeaderTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRCommentHeaderTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const CRCommentHeaderTableViewCellIdentifier; 12 | 13 | @interface CRCommentHeaderTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRCommentHeaderTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRCommentHeaderTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRCommentHeaderTableViewCell.h" 10 | 11 | NSString * const CRCommentHeaderTableViewCellIdentifier = @"CRCommentHeaderTableViewCellIdentifier"; 12 | 13 | @implementation CRCommentHeaderTableViewCell 14 | 15 | - (void)awakeFromNib { 16 | [super awakeFromNib]; 17 | // Initialization code 18 | } 19 | 20 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 21 | [super setSelected:selected animated:animated]; 22 | 23 | // Configure the view for the selected state 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRCommentHeaderTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRCommentTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRCommentTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRCommentTableViewCellIdentifier; 12 | 13 | @interface CRCommentTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRCommentTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRCommentTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRCommentTableViewCell.h" 10 | 11 | NSString * const kCRCommentTableViewCellIdentifier = @"kCRCommentTableViewCellIdentifier"; 12 | 13 | @implementation CRCommentTableViewCell 14 | 15 | - (void)awakeFromNib { 16 | [super awakeFromNib]; 17 | // Initialization code 18 | } 19 | 20 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 21 | [super setSelected:selected animated:animated]; 22 | 23 | // Configure the view for the selected state 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRCommentTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 41 | 50 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsDescTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRGoodsDescTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRGoodsDescTableViewCellIdentifier; 12 | 13 | @interface CRGoodsDescTableViewCell : UITableViewCell 14 | 15 | - (void)configWithGoodsDesc:(NSString *)goodsDesc; 16 | 17 | + (CGFloat)cellHeightWithGoodsDesc:(NSString *)goodsDesc; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsDescTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRGoodsDescTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRGoodsDescTableViewCell.h" 10 | #import "NSString+Size.h" 11 | 12 | NSString * const kCRGoodsDescTableViewCellIdentifier = @"kCRGoodsDescTableViewCellIdentifier"; 13 | 14 | @interface CRGoodsDescTableViewCell() 15 | 16 | @property (nonatomic, weak) IBOutlet UILabel *goodsDescLabel; 17 | @end 18 | 19 | @implementation CRGoodsDescTableViewCell 20 | 21 | - (void)awakeFromNib { 22 | [super awakeFromNib]; 23 | // Initialization code 24 | } 25 | 26 | - (void)configWithGoodsDesc:(NSString *)goodsDesc 27 | { 28 | self.goodsDescLabel.text = goodsDesc; 29 | } 30 | 31 | + (CGFloat)cellHeightWithGoodsDesc:(NSString *)goodsDesc 32 | { 33 | CGSize size = [goodsDesc stringSizeWithContentSize:CGSizeMake([[UIScreen mainScreen] bounds].size.width - 30, MAXFLOAT) font:[UIFont systemFontOfSize:13.f]]; 34 | return ceil(size.height) + 16; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsDescTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsNameTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRGoodsNameTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRGoodsNameTableViewCellIdentifier; 12 | 13 | @interface CRGoodsNameTableViewCell : UITableViewCell 14 | 15 | - (void)configWithGoodsName:(NSString *)goodsName; 16 | 17 | + (CGFloat)cellHeightWithGoodsName:(NSString *)goodsName; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsNameTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRGoodsNameTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRGoodsNameTableViewCell.h" 10 | #import "NSString+Size.h" 11 | 12 | NSString * const kCRGoodsNameTableViewCellIdentifier = @"kCRGoodsNameTableViewCellIdentifier"; 13 | 14 | @interface CRGoodsNameTableViewCell() 15 | 16 | @property (nonatomic, weak) IBOutlet UILabel *goodsNameLabel; 17 | @end 18 | 19 | @implementation CRGoodsNameTableViewCell 20 | 21 | - (void)awakeFromNib { 22 | [super awakeFromNib]; 23 | // Initialization code 24 | } 25 | 26 | - (void)configWithGoodsName:(NSString *)goodsName 27 | { 28 | self.goodsNameLabel.text = goodsName; 29 | } 30 | 31 | + (CGFloat)cellHeightWithGoodsName:(NSString *)goodsName 32 | { 33 | CGSize size = [goodsName stringSizeWithContentSize:CGSizeMake([[UIScreen mainScreen] bounds].size.width - 30, MAXFLOAT) font:[UIFont systemFontOfSize:16.f]]; 34 | return ceil(size.height) + 23; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsNameTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsPriceTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRGoodsPriceTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRGoodsPriceTableViewCellIdentifier; 12 | 13 | @interface CRGoodsPriceTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsPriceTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRGoodsPriceTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRGoodsPriceTableViewCell.h" 10 | 11 | NSString * const kCRGoodsPriceTableViewCellIdentifier = @"kCRGoodsPriceTableViewCellIdentifier"; 12 | 13 | @implementation CRGoodsPriceTableViewCell 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRGoodsPriceTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRHasSelectedTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRHasSelectedTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRHasSelectedTableViewCellIdentifier; 12 | 13 | @interface CRHasSelectedTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRHasSelectedTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRHasSelectedTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRHasSelectedTableViewCell.h" 10 | 11 | NSString * const kCRHasSelectedTableViewCellIdentifier = @"kCRHasSelectedTableViewCellIdentifier"; 12 | 13 | @implementation CRHasSelectedTableViewCell 14 | 15 | 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRHasSelectedTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRPromotionTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRPromotionTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRPromotionTableViewCellIdentifier; 12 | 13 | @interface CRPromotionTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRPromotionTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRPromotionTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRPromotionTableViewCell.h" 10 | 11 | NSString * const kCRPromotionTableViewCellIdentifier = @"kCRPromotionTableViewCellIdentifier"; 12 | 13 | @implementation CRPromotionTableViewCell 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRPromotionTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 48 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRRecommendTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRRecommendTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRRecommendTableViewCellIdentifier; 12 | 13 | @interface CRRecommendTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRRecommendTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRRecommendTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRRecommendTableViewCell.h" 10 | 11 | NSString * const kCRRecommendTableViewCellIdentifier = @"kCRRecommendTableViewCellIdentifier"; 12 | 13 | @implementation CRRecommendTableViewCell 14 | 15 | - (void)awakeFromNib { 16 | [super awakeFromNib]; 17 | // Initialization code 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRRecommendTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRStoreInfoTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRStoreInfoTableViewCell.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString * const kCRStoreInfoTableViewCellIdentifier; 12 | 13 | @interface CRStoreInfoTableViewCell : UITableViewCell 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRStoreInfoTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRStoreInfoTableViewCell.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRStoreInfoTableViewCell.h" 10 | 11 | NSString * const kCRStoreInfoTableViewCellIdentifier = @"kCRStoreInfoTableViewCellIdentifier"; 12 | 13 | @implementation CRStoreInfoTableViewCell 14 | 15 | - (void)awakeFromNib { 16 | [super awakeFromNib]; 17 | // Initialization code 18 | } 19 | 20 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 21 | [super setSelected:selected animated:animated]; 22 | 23 | // Configure the view for the selected state 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Cells/CRStoreInfoTableViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 31 | 41 | 47 | 53 | 63 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Configurator/CRVisibleCellsConfigurator.h: -------------------------------------------------------------------------------- 1 | // 2 | // CRVisibleCellsConfigurator.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | typedef NS_ENUM(NSInteger, CRVisibleCellType){ 13 | CRVisibleCellTypeBanner = 0, 14 | CRVisibleCellTypeGoodsName, 15 | CRVisibleCellTypeGoodsDesc, 16 | CRVisibleCellTypeGoodsPrice, 17 | CRVisibleCellTypePromotion, 18 | CRVisibleCellTypeHasSelected, 19 | CRVisibleCellTypeCommentHeader, 20 | CRVisibleCellTypeComment, 21 | CRVisibleCellTypeStoreInfo, 22 | CRVisibleCellTypeRecommend 23 | }; 24 | 25 | @interface CRVisibleCellsConfigurator : NSObject 26 | 27 | @property (nonatomic, copy) NSArray *bannerPics; 28 | @property (nonatomic, copy) NSString *goodsName; 29 | @property (nonatomic, copy) NSString *goodsDesc; 30 | @property (nonatomic, copy) NSString *goodsPrice; 31 | @property (nonatomic, copy) NSArray *promotions; 32 | @property (nonatomic, copy) NSArray *comments; 33 | @property (nonatomic, copy) NSString *storeName; 34 | @property (nonatomic, copy) NSArray *recommendGoods; 35 | 36 | @property (nonatomic, assign) BOOL isBannerVisible; 37 | @property (nonatomic, assign) BOOL isGoodsNameCellVisible; 38 | @property (nonatomic, assign) BOOL isGoodsDescCellVisible; 39 | @property (nonatomic, assign) BOOL isGoodsPriceCellVisible; 40 | @property (nonatomic, assign) BOOL isPromotionCellVisible; 41 | @property (nonatomic, assign) BOOL isHasSelectedCellVisible; 42 | @property (nonatomic, assign) BOOL isCommentCellVisible; 43 | @property (nonatomic, assign) BOOL isStoreInfoCellVisible; 44 | @property (nonatomic, assign) BOOL isRecommendCellVisible; 45 | 46 | - (NSInteger)numberOfRowsInSection:(NSInteger)section; 47 | 48 | - (CGFloat)heightForHeaderInSection:(NSInteger)section; 49 | 50 | //测试 51 | - (void)didSelectedRowAtSection:(NSInteger)section; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Configurator/CRVisibleCellsConfigurator.m: -------------------------------------------------------------------------------- 1 | // 2 | // CRVisibleCellsConfigurator.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "CRVisibleCellsConfigurator.h" 10 | 11 | @implementation CRVisibleCellsConfigurator 12 | 13 | - (instancetype)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | _bannerPics = @[@1]; 18 | _goodsName = @"三星(SAMSUNG) 750 EVO 250G SATA3 固态硬盘"; 19 | _goodsDesc = @"价格亲民,高速犹存!读写给力,意想不到的惊喜!更快速的增强版SSD>>>"; 20 | _goodsPrice = @"2993.5"; 21 | _promotions = @[@"满500减20"]; 22 | _comments = @[@"东西不错,正品",@"这是个demo,这是个demo,这是个demo,这是个demo,这是个demo,这是个demo"]; 23 | _storeName = @"三星官方旗舰店"; 24 | _recommendGoods = @[@"1",@"2"]; 25 | } 26 | return self; 27 | } 28 | 29 | #pragma mark - public methods 30 | - (NSInteger)numberOfRowsInSection:(NSInteger)section 31 | { 32 | switch (section) { 33 | case CRVisibleCellTypeBanner: 34 | return self.isBannerVisible; 35 | case CRVisibleCellTypeGoodsName: 36 | return self.isGoodsNameCellVisible; 37 | case CRVisibleCellTypeGoodsDesc: 38 | return self.isGoodsDescCellVisible; 39 | case CRVisibleCellTypeGoodsPrice: 40 | return self.isGoodsPriceCellVisible; 41 | case CRVisibleCellTypePromotion: 42 | return self.isPromotionCellVisible; 43 | case CRVisibleCellTypeHasSelected: 44 | return self.isHasSelectedCellVisible; 45 | case CRVisibleCellTypeCommentHeader: 46 | return self.isCommentCellVisible; 47 | case CRVisibleCellTypeComment: 48 | return self.comments.count; 49 | case CRVisibleCellTypeStoreInfo: 50 | return self.isStoreInfoCellVisible; 51 | case CRVisibleCellTypeRecommend: 52 | return self.isRecommendCellVisible; 53 | default: 54 | break; 55 | } 56 | return 0; 57 | } 58 | 59 | - (CGFloat)heightForHeaderInSection:(NSInteger)section 60 | { 61 | switch (section) { 62 | case CRVisibleCellTypeHasSelected: 63 | return self.isHasSelectedCellVisible ? 10.f : CGFLOAT_MIN; 64 | case CRVisibleCellTypeCommentHeader: 65 | return self.isCommentCellVisible ? 10.f : CGFLOAT_MIN; 66 | case CRVisibleCellTypeStoreInfo: 67 | return self.isStoreInfoCellVisible ? 10.f : CGFLOAT_MIN; 68 | case CRVisibleCellTypeRecommend: 69 | return self.isRecommendCellVisible ? 10.f : CGFLOAT_MIN; 70 | default: 71 | break; 72 | } 73 | return CGFLOAT_MIN; 74 | } 75 | 76 | - (void)didSelectedRowAtSection:(NSInteger)section 77 | { 78 | switch (section) { 79 | case CRVisibleCellTypeBanner: 80 | self.bannerPics = @[]; 81 | break; 82 | case CRVisibleCellTypeGoodsName: 83 | self.goodsName = nil; 84 | break; 85 | case CRVisibleCellTypeGoodsDesc: 86 | self.goodsDesc = nil; 87 | break; 88 | case CRVisibleCellTypeGoodsPrice: 89 | self.goodsPrice = nil; 90 | break; 91 | case CRVisibleCellTypePromotion: 92 | self.promotions = nil; 93 | break; 94 | case CRVisibleCellTypeCommentHeader: 95 | self.comments = nil; 96 | break; 97 | case CRVisibleCellTypeComment: 98 | { 99 | NSMutableArray *tempArray = self.comments.mutableCopy; 100 | [tempArray removeLastObject]; 101 | self.comments = tempArray; 102 | } 103 | break; 104 | case CRVisibleCellTypeStoreInfo: 105 | self.storeName = nil; 106 | break; 107 | case CRVisibleCellTypeRecommend: 108 | self.recommendGoods = nil; 109 | break; 110 | default: 111 | break; 112 | } 113 | 114 | } 115 | 116 | #pragma mark - getters 117 | - (BOOL)isBannerVisible 118 | { 119 | return self.bannerPics.count; 120 | } 121 | 122 | - (BOOL)isGoodsNameCellVisible 123 | { 124 | return self.goodsName.length > 0; 125 | } 126 | 127 | - (BOOL)isGoodsDescCellVisible 128 | { 129 | return self.goodsDesc.length > 0; 130 | } 131 | 132 | - (BOOL)isGoodsPriceCellVisible 133 | { 134 | return self.goodsPrice.length > 0; 135 | } 136 | 137 | - (BOOL)isPromotionCellVisible 138 | { 139 | return self.promotions.count; 140 | } 141 | 142 | - (BOOL)isHasSelectedCellVisible 143 | { 144 | return YES; 145 | } 146 | 147 | - (BOOL)isCommentCellVisible 148 | { 149 | return self.comments.count; 150 | } 151 | 152 | - (BOOL)isStoreInfoCellVisible 153 | { 154 | return self.storeName > 0; 155 | } 156 | 157 | - (BOOL)isRecommendCellVisible 158 | { 159 | return self.recommendGoods.count; 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Configurator/NSString+Size.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Size.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface NSString (Size) 13 | 14 | - (CGSize)stringSizeWithContentSize:(CGSize)contentSize font:(UIFont *)font; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Configurator/NSString+Size.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Size.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "NSString+Size.h" 10 | 11 | @implementation NSString (Size) 12 | 13 | - (CGSize)stringSizeWithContentSize:(CGSize)contentSize font:(UIFont *)font 14 | { 15 | NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init]; 16 | paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping; 17 | 18 | NSDictionary *attributes = @{NSFontAttributeName: font,NSParagraphStyleAttributeName:paragraphStyle.copy}; 19 | 20 | CGSize size = [self boundingRectWithSize:contentSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil].size; 21 | return size; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "CRVisibleCellsConfigurator.h" 11 | 12 | #import "CRBannerTableViewCell.h" 13 | #import "CRGoodsNameTableViewCell.h" 14 | #import "CRGoodsDescTableViewCell.h" 15 | #import "CRGoodsPriceTableViewCell.h" 16 | #import "CRPromotionTableViewCell.h" 17 | #import "CRHasSelectedTableViewCell.h" 18 | #import "CRCommentTableViewCell.h" 19 | #import "CRCommentHeaderTableViewCell.h" 20 | #import "CRStoreInfoTableViewCell.h" 21 | #import "CRRecommendTableViewCell.h" 22 | 23 | @interface ViewController () 24 | 25 | @property (nonatomic, strong) UITableView *tableView; 26 | @property (nonatomic, strong) CRVisibleCellsConfigurator *cellConfigurator; 27 | @end 28 | 29 | @implementation ViewController 30 | 31 | - (void)viewDidLoad { 32 | [super viewDidLoad]; 33 | 34 | [self.view addSubview:self.tableView]; 35 | } 36 | 37 | - (void)viewWillLayoutSubviews 38 | { 39 | [super viewWillLayoutSubviews]; 40 | self.tableView.frame = self.view.bounds; 41 | } 42 | 43 | #pragma mark - UITableViewDataSource 44 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 45 | { 46 | return 10; 47 | } 48 | 49 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 50 | { 51 | return [self.cellConfigurator numberOfRowsInSection:section]; 52 | } 53 | 54 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 55 | { 56 | switch (indexPath.section) { 57 | case CRVisibleCellTypeBanner: 58 | { 59 | CRBannerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRBannerTableViewCellIdentifier forIndexPath:indexPath]; 60 | return cell; 61 | } 62 | case CRVisibleCellTypeGoodsName: 63 | { 64 | CRGoodsNameTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRGoodsNameTableViewCellIdentifier forIndexPath:indexPath]; 65 | [cell configWithGoodsName:self.cellConfigurator.goodsName]; 66 | return cell; 67 | } 68 | case CRVisibleCellTypeGoodsDesc: 69 | { 70 | CRGoodsDescTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRGoodsDescTableViewCellIdentifier forIndexPath:indexPath]; 71 | [cell configWithGoodsDesc:self.cellConfigurator.goodsDesc]; 72 | return cell; 73 | } 74 | case CRVisibleCellTypeGoodsPrice: 75 | { 76 | CRGoodsPriceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRGoodsPriceTableViewCellIdentifier forIndexPath:indexPath]; 77 | return cell; 78 | } 79 | case CRVisibleCellTypePromotion: 80 | { 81 | CRPromotionTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRPromotionTableViewCellIdentifier forIndexPath:indexPath]; 82 | return cell; 83 | } 84 | case CRVisibleCellTypeHasSelected: 85 | { 86 | CRHasSelectedTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRHasSelectedTableViewCellIdentifier forIndexPath:indexPath]; 87 | return cell; 88 | } 89 | case CRVisibleCellTypeCommentHeader: 90 | { 91 | CRCommentHeaderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CRCommentHeaderTableViewCellIdentifier forIndexPath:indexPath]; 92 | return cell; 93 | } 94 | case CRVisibleCellTypeComment: 95 | { 96 | CRCommentTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRCommentTableViewCellIdentifier forIndexPath:indexPath]; 97 | return cell; 98 | } 99 | case CRVisibleCellTypeStoreInfo: 100 | { 101 | CRStoreInfoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRStoreInfoTableViewCellIdentifier forIndexPath:indexPath]; 102 | return cell; 103 | } 104 | case CRVisibleCellTypeRecommend: 105 | { 106 | CRRecommendTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCRRecommendTableViewCellIdentifier forIndexPath:indexPath]; 107 | return cell; 108 | } 109 | default: 110 | break; 111 | } 112 | return [[UITableViewCell alloc] init]; 113 | } 114 | 115 | #pragma mark - UITableViewDelegate 116 | 117 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 118 | { 119 | switch (indexPath.section) { 120 | case CRVisibleCellTypeBanner: 121 | { 122 | return [CRBannerTableViewCell cellHeight]; 123 | } 124 | case CRVisibleCellTypeGoodsName: 125 | { 126 | return [CRGoodsNameTableViewCell cellHeightWithGoodsName:self.cellConfigurator.goodsName]; 127 | } 128 | case CRVisibleCellTypeGoodsDesc: 129 | { 130 | return [CRGoodsDescTableViewCell cellHeightWithGoodsDesc:self.cellConfigurator.goodsDesc]; 131 | } 132 | case CRVisibleCellTypeGoodsPrice: 133 | { 134 | return 44.f; 135 | } 136 | case CRVisibleCellTypePromotion: 137 | { 138 | return 44.f; //该高度需要根据有多少条促销信息计算,我暂且写死,可以拿到数据后在CRVisibleCellsConfigurator中缓存高度 139 | } 140 | case CRVisibleCellTypeHasSelected: 141 | { 142 | return 44.f; 143 | } 144 | case CRVisibleCellTypeCommentHeader: 145 | { 146 | return 44.f; 147 | } 148 | case CRVisibleCellTypeComment: 149 | { 150 | return 80.f; //需要根据评论内容计算高度缓存 151 | } 152 | case CRVisibleCellTypeStoreInfo: 153 | { 154 | return 85.f; 155 | } 156 | case CRVisibleCellTypeRecommend: 157 | { 158 | return 110.f; 159 | } 160 | default: 161 | break; 162 | } 163 | return CGFLOAT_MIN; 164 | 165 | } 166 | 167 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 168 | { 169 | return CGFLOAT_MIN; 170 | } 171 | 172 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 173 | { 174 | return [self.cellConfigurator heightForHeaderInSection:section]; 175 | } 176 | 177 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 178 | { 179 | [self.cellConfigurator didSelectedRowAtSection:indexPath.section]; 180 | [tableView reloadData]; 181 | } 182 | 183 | #pragma mark - getters 184 | - (UITableView *)tableView 185 | { 186 | if (_tableView == nil) { 187 | _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 188 | _tableView.delegate = self; 189 | _tableView.dataSource = self; 190 | _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 191 | _tableView.backgroundColor = [UIColor colorWithRed:245/255.0 green:245/255.0 blue:245/255.0 alpha:1]; 192 | 193 | [_tableView registerNib:[UINib nibWithNibName:@"CRBannerTableViewCell" bundle:nil] forCellReuseIdentifier:kCRBannerTableViewCellIdentifier]; 194 | [_tableView registerNib:[UINib nibWithNibName:@"CRGoodsNameTableViewCell" bundle:nil] forCellReuseIdentifier:kCRGoodsNameTableViewCellIdentifier]; 195 | [_tableView registerNib:[UINib nibWithNibName:@"CRGoodsDescTableViewCell" bundle:nil] forCellReuseIdentifier:kCRGoodsDescTableViewCellIdentifier]; 196 | [_tableView registerNib:[UINib nibWithNibName:@"CRGoodsPriceTableViewCell" bundle:nil] forCellReuseIdentifier:kCRGoodsPriceTableViewCellIdentifier]; 197 | [_tableView registerNib:[UINib nibWithNibName:@"CRPromotionTableViewCell" bundle:nil] forCellReuseIdentifier:kCRPromotionTableViewCellIdentifier]; 198 | [_tableView registerNib:[UINib nibWithNibName:@"CRHasSelectedTableViewCell" bundle:nil] forCellReuseIdentifier:kCRHasSelectedTableViewCellIdentifier]; 199 | [_tableView registerNib:[UINib nibWithNibName:@"CRCommentTableViewCell" bundle:nil] forCellReuseIdentifier:kCRCommentTableViewCellIdentifier]; 200 | [_tableView registerNib:[UINib nibWithNibName:@"CRCommentHeaderTableViewCell" bundle:nil] forCellReuseIdentifier:CRCommentHeaderTableViewCellIdentifier]; 201 | [_tableView registerNib:[UINib nibWithNibName:@"CRStoreInfoTableViewCell" bundle:nil] forCellReuseIdentifier:kCRStoreInfoTableViewCellIdentifier]; 202 | [_tableView registerNib:[UINib nibWithNibName:@"CRRecommendTableViewCell" bundle:nil] forCellReuseIdentifier:kCRRecommendTableViewCellIdentifier]; 203 | } 204 | return _tableView; 205 | } 206 | 207 | - (CRVisibleCellsConfigurator *)cellConfigurator 208 | { 209 | if (_cellConfigurator == nil) { 210 | _cellConfigurator = [[CRVisibleCellsConfigurator alloc] init]; 211 | } 212 | return _cellConfigurator; 213 | } 214 | 215 | @end 216 | -------------------------------------------------------------------------------- /CRVisibleCellsDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CRVisibleCellsDemo 4 | // 5 | // Created by Charon on 17/2/8. 6 | // Copyright © 2017年 Charon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | --------------------------------------------------------------------------------