├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── Podfile.lock ├── RTComponentTableView.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── RTComponentTableView-Example.xcscheme ├── RTComponentTableView.xcworkspace │ └── contents.xcworkspacedata ├── RTComponentTableView │ ├── Images.xcassets │ │ ├── 1.imageset │ │ │ ├── 1@2x.png │ │ │ └── Contents.json │ │ ├── 2.imageset │ │ │ ├── 2@2x.png │ │ │ └── Contents.json │ │ ├── 3.imageset │ │ │ ├── 3@2x.png │ │ │ └── Contents.json │ │ ├── 4.imageset │ │ │ ├── 4@2x.png │ │ │ └── Contents.json │ │ ├── 5.imageset │ │ │ ├── 5@2x.png │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── Launchscreen.storyboard │ ├── Main.storyboard │ ├── RTAppDelegate.h │ ├── RTAppDelegate.m │ ├── RTComponentTableView-Info.plist │ ├── RTComponentTableView-Prefix.pch │ ├── RTDemoBannerComponent.h │ ├── RTDemoBannerComponent.m │ ├── RTDemoCombinationViewController.h │ ├── RTDemoCombinationViewController.m │ ├── RTDemoImageItemComponent.h │ ├── RTDemoImageItemComponent.m │ ├── RTDemoItemComponent.h │ ├── RTDemoItemComponent.m │ ├── RTDemoStyle1ViewController.h │ ├── RTDemoStyle1ViewController.m │ ├── RTDemoStyle2ViewController.h │ ├── RTDemoStyle2ViewController.m │ ├── RTDemoTagsComponent.h │ ├── RTDemoTagsComponent.m │ ├── RTImageItemCollectionViewCell.h │ ├── RTImageItemCollectionViewCell.m │ ├── RTItemTableViewCell.h │ ├── RTItemTableViewCell.m │ ├── RTMoreActionComponent.h │ ├── RTMoreActionComponent.m │ ├── RTTextCollectionViewCell.h │ ├── RTTextCollectionViewCell.m │ ├── RTViewController.h │ ├── RTViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── README.md ├── RTComponentTableView.podspec ├── RTComponentTableView ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── Components │ ├── RTActionHeaderComponent.h │ ├── RTActionHeaderComponent.m │ ├── RTBaseComponent.h │ ├── RTBaseComponent.m │ ├── RTCollectionComponent.h │ ├── RTCollectionComponent.m │ ├── RTHeaderComponent.h │ ├── RTHeaderComponent.m │ └── RTTableComponent.h │ ├── RTComponentController.h │ ├── RTComponentController.m │ └── RTComponentTableView.h └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | Pods/ 34 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * http://www.objc.io/issue-6/travis-ci.html 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | cache: cocoapods 8 | # podfile: Example/Podfile 9 | before_install: 10 | - gem install cocoapods # Since Travis is not always on latest version 11 | - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild build -workspace Example/RTComponentTableView.xcworkspace -scheme RTComponentTableView-Example -sdk iphonesimulator8.1 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | 2 | target 'RTComponentTableView_Example' do 3 | pod 'RTComponentTableView', :path => '../' 4 | pod 'Masonry' 5 | 6 | target 'RTComponentTableView_Tests' do 7 | 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.0.1) 3 | - RTComponentTableView (0.1.0) 4 | 5 | DEPENDENCIES: 6 | - Masonry 7 | - RTComponentTableView (from `../`) 8 | 9 | EXTERNAL SOURCES: 10 | RTComponentTableView: 11 | :path: ../ 12 | 13 | SPEC CHECKSUMS: 14 | Masonry: a1a931a0d08870ed8ae415a2ea5ea68ebcac77df 15 | RTComponentTableView: a36e58b9e7a2a51001ce1b96ce82dd0abae6248a 16 | 17 | COCOAPODS: 0.39.0 18 | -------------------------------------------------------------------------------- /Example/RTComponentTableView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2274906B68DB917F94FB9D08 /* libPods-RTComponentTableView_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C630FE9CC71522BE7EE09FFA /* libPods-RTComponentTableView_Example.a */; }; 11 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 12 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 13 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 14 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 15 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 16 | 6003F59E195388D20070C39A /* RTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* RTAppDelegate.m */; }; 17 | 6003F5A7195388D20070C39A /* RTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* RTViewController.m */; }; 18 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 19 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 20 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 21 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 22 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 23 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 24 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 25 | 9C006E031D167D9E00FD66FF /* Launchscreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C006E021D167D9E00FD66FF /* Launchscreen.storyboard */; }; 26 | 9C006E061D1680F000FD66FF /* RTMoreActionComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E051D1680F000FD66FF /* RTMoreActionComponent.m */; }; 27 | 9C006E091D16852100FD66FF /* RTDemoImageItemComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E081D16852100FD66FF /* RTDemoImageItemComponent.m */; }; 28 | 9C006E0C1D16853B00FD66FF /* RTImageItemCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E0B1D16853B00FD66FF /* RTImageItemCollectionViewCell.m */; }; 29 | 9C006E0F1D16894700FD66FF /* RTDemoStyle2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E0E1D16894700FD66FF /* RTDemoStyle2ViewController.m */; }; 30 | 9C006E141D168C8F00FD66FF /* RTDemoCombinationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E131D168C8F00FD66FF /* RTDemoCombinationViewController.m */; }; 31 | 9C006E171D168F9900FD66FF /* RTTextCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E161D168F9900FD66FF /* RTTextCollectionViewCell.m */; }; 32 | 9C006E1A1D16908800FD66FF /* RTDemoTagsComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E191D16908800FD66FF /* RTDemoTagsComponent.m */; }; 33 | 9C006E1D1D16E2C800FD66FF /* RTDemoBannerComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C006E1C1D16E2C800FD66FF /* RTDemoBannerComponent.m */; }; 34 | 9C49504B1D167631008B17AD /* RTDemoStyle1ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C49504A1D167631008B17AD /* RTDemoStyle1ViewController.m */; }; 35 | 9C4950501D167861008B17AD /* RTItemTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C49504F1D167861008B17AD /* RTItemTableViewCell.m */; }; 36 | 9C4950531D167A86008B17AD /* RTDemoItemComponent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C4950521D167A86008B17AD /* RTDemoItemComponent.m */; }; 37 | /* End PBXBuildFile section */ 38 | 39 | /* Begin PBXContainerItemProxy section */ 40 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = 6003F582195388D10070C39A /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 6003F589195388D20070C39A; 45 | remoteInfo = RTComponentTableView; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXFileReference section */ 50 | 025A5AB9B5A365A8086B6F0A /* RTComponentTableView.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = RTComponentTableView.podspec; path = ../RTComponentTableView.podspec; sourceTree = ""; }; 51 | 6003F58A195388D20070C39A /* RTComponentTableView_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RTComponentTableView_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 53 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 54 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 55 | 6003F595195388D20070C39A /* RTComponentTableView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "RTComponentTableView-Info.plist"; sourceTree = ""; }; 56 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 57 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 58 | 6003F59B195388D20070C39A /* RTComponentTableView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RTComponentTableView-Prefix.pch"; sourceTree = ""; }; 59 | 6003F59C195388D20070C39A /* RTAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTAppDelegate.h; sourceTree = ""; }; 60 | 6003F59D195388D20070C39A /* RTAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RTAppDelegate.m; sourceTree = ""; }; 61 | 6003F5A5195388D20070C39A /* RTViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RTViewController.h; sourceTree = ""; }; 62 | 6003F5A6195388D20070C39A /* RTViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RTViewController.m; sourceTree = ""; }; 63 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 64 | 6003F5AE195388D20070C39A /* RTComponentTableView_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RTComponentTableView_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 66 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 67 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 68 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 69 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 70 | 7DAF28A8AEE1F0CE939117FB /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 71 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 72 | 9A30233BB298216281F7871D /* Pods-RTComponentTableView_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RTComponentTableView_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RTComponentTableView_Example/Pods-RTComponentTableView_Example.debug.xcconfig"; sourceTree = ""; }; 73 | 9C006E021D167D9E00FD66FF /* Launchscreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Launchscreen.storyboard; sourceTree = ""; }; 74 | 9C006E041D1680F000FD66FF /* RTMoreActionComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTMoreActionComponent.h; sourceTree = ""; }; 75 | 9C006E051D1680F000FD66FF /* RTMoreActionComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTMoreActionComponent.m; sourceTree = ""; }; 76 | 9C006E071D16852100FD66FF /* RTDemoImageItemComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDemoImageItemComponent.h; sourceTree = ""; }; 77 | 9C006E081D16852100FD66FF /* RTDemoImageItemComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTDemoImageItemComponent.m; sourceTree = ""; }; 78 | 9C006E0A1D16853B00FD66FF /* RTImageItemCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTImageItemCollectionViewCell.h; sourceTree = ""; }; 79 | 9C006E0B1D16853B00FD66FF /* RTImageItemCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTImageItemCollectionViewCell.m; sourceTree = ""; }; 80 | 9C006E0D1D16894700FD66FF /* RTDemoStyle2ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDemoStyle2ViewController.h; sourceTree = ""; }; 81 | 9C006E0E1D16894700FD66FF /* RTDemoStyle2ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTDemoStyle2ViewController.m; sourceTree = ""; }; 82 | 9C006E121D168C8F00FD66FF /* RTDemoCombinationViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDemoCombinationViewController.h; sourceTree = ""; }; 83 | 9C006E131D168C8F00FD66FF /* RTDemoCombinationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTDemoCombinationViewController.m; sourceTree = ""; }; 84 | 9C006E151D168F9900FD66FF /* RTTextCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTTextCollectionViewCell.h; sourceTree = ""; }; 85 | 9C006E161D168F9900FD66FF /* RTTextCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTTextCollectionViewCell.m; sourceTree = ""; }; 86 | 9C006E181D16908800FD66FF /* RTDemoTagsComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDemoTagsComponent.h; sourceTree = ""; }; 87 | 9C006E191D16908800FD66FF /* RTDemoTagsComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTDemoTagsComponent.m; sourceTree = ""; }; 88 | 9C006E1B1D16E2C800FD66FF /* RTDemoBannerComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDemoBannerComponent.h; sourceTree = ""; }; 89 | 9C006E1C1D16E2C800FD66FF /* RTDemoBannerComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTDemoBannerComponent.m; sourceTree = ""; }; 90 | 9C4950491D167631008B17AD /* RTDemoStyle1ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDemoStyle1ViewController.h; sourceTree = ""; }; 91 | 9C49504A1D167631008B17AD /* RTDemoStyle1ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTDemoStyle1ViewController.m; sourceTree = ""; }; 92 | 9C49504E1D167861008B17AD /* RTItemTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTItemTableViewCell.h; sourceTree = ""; }; 93 | 9C49504F1D167861008B17AD /* RTItemTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTItemTableViewCell.m; sourceTree = ""; }; 94 | 9C4950511D167A86008B17AD /* RTDemoItemComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTDemoItemComponent.h; sourceTree = ""; }; 95 | 9C4950521D167A86008B17AD /* RTDemoItemComponent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RTDemoItemComponent.m; sourceTree = ""; }; 96 | C630FE9CC71522BE7EE09FFA /* libPods-RTComponentTableView_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RTComponentTableView_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 97 | DC6E59E9163113A529653F1D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 98 | E47F5B90101F855869478692 /* Pods-RTComponentTableView_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RTComponentTableView_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-RTComponentTableView_Example/Pods-RTComponentTableView_Example.release.xcconfig"; sourceTree = ""; }; 99 | /* End PBXFileReference section */ 100 | 101 | /* Begin PBXFrameworksBuildPhase section */ 102 | 6003F587195388D20070C39A /* Frameworks */ = { 103 | isa = PBXFrameworksBuildPhase; 104 | buildActionMask = 2147483647; 105 | files = ( 106 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 107 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 108 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 109 | 2274906B68DB917F94FB9D08 /* libPods-RTComponentTableView_Example.a in Frameworks */, 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | 6003F5AB195388D20070C39A /* Frameworks */ = { 114 | isa = PBXFrameworksBuildPhase; 115 | buildActionMask = 2147483647; 116 | files = ( 117 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 118 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 119 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 120 | ); 121 | runOnlyForDeploymentPostprocessing = 0; 122 | }; 123 | /* End PBXFrameworksBuildPhase section */ 124 | 125 | /* Begin PBXGroup section */ 126 | 6003F581195388D10070C39A = { 127 | isa = PBXGroup; 128 | children = ( 129 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 130 | 6003F593195388D20070C39A /* Example for RTComponentTableView */, 131 | 6003F5B5195388D20070C39A /* Tests */, 132 | 6003F58C195388D20070C39A /* Frameworks */, 133 | 6003F58B195388D20070C39A /* Products */, 134 | 7DC6533D36805F9BAE729FE2 /* Pods */, 135 | ); 136 | sourceTree = ""; 137 | }; 138 | 6003F58B195388D20070C39A /* Products */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 6003F58A195388D20070C39A /* RTComponentTableView_Example.app */, 142 | 6003F5AE195388D20070C39A /* RTComponentTableView_Tests.xctest */, 143 | ); 144 | name = Products; 145 | sourceTree = ""; 146 | }; 147 | 6003F58C195388D20070C39A /* Frameworks */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 6003F58D195388D20070C39A /* Foundation.framework */, 151 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 152 | 6003F591195388D20070C39A /* UIKit.framework */, 153 | 6003F5AF195388D20070C39A /* XCTest.framework */, 154 | C630FE9CC71522BE7EE09FFA /* libPods-RTComponentTableView_Example.a */, 155 | ); 156 | name = Frameworks; 157 | sourceTree = ""; 158 | }; 159 | 6003F593195388D20070C39A /* Example for RTComponentTableView */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 9C49504D1D16783B008B17AD /* CollectionCells */, 163 | 9C4950441D166B25008B17AD /* Components */, 164 | 6003F5A8195388D20070C39A /* Images.xcassets */, 165 | 9C006E021D167D9E00FD66FF /* Launchscreen.storyboard */, 166 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 167 | 6003F59C195388D20070C39A /* RTAppDelegate.h */, 168 | 6003F59D195388D20070C39A /* RTAppDelegate.m */, 169 | 9C4950491D167631008B17AD /* RTDemoStyle1ViewController.h */, 170 | 9C49504A1D167631008B17AD /* RTDemoStyle1ViewController.m */, 171 | 9C006E0D1D16894700FD66FF /* RTDemoStyle2ViewController.h */, 172 | 9C006E0E1D16894700FD66FF /* RTDemoStyle2ViewController.m */, 173 | 6003F5A5195388D20070C39A /* RTViewController.h */, 174 | 6003F5A6195388D20070C39A /* RTViewController.m */, 175 | 6003F594195388D20070C39A /* Supporting Files */, 176 | 9C49504C1D16782F008B17AD /* TableCells */, 177 | 9C006E121D168C8F00FD66FF /* RTDemoCombinationViewController.h */, 178 | 9C006E131D168C8F00FD66FF /* RTDemoCombinationViewController.m */, 179 | ); 180 | name = "Example for RTComponentTableView"; 181 | path = RTComponentTableView; 182 | sourceTree = ""; 183 | }; 184 | 6003F594195388D20070C39A /* Supporting Files */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 6003F595195388D20070C39A /* RTComponentTableView-Info.plist */, 188 | 6003F596195388D20070C39A /* InfoPlist.strings */, 189 | 6003F599195388D20070C39A /* main.m */, 190 | 6003F59B195388D20070C39A /* RTComponentTableView-Prefix.pch */, 191 | ); 192 | name = "Supporting Files"; 193 | sourceTree = ""; 194 | }; 195 | 6003F5B5195388D20070C39A /* Tests */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | 6003F5BB195388D20070C39A /* Tests.m */, 199 | 6003F5B6195388D20070C39A /* Supporting Files */, 200 | ); 201 | path = Tests; 202 | sourceTree = ""; 203 | }; 204 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 208 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 209 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 210 | ); 211 | name = "Supporting Files"; 212 | sourceTree = ""; 213 | }; 214 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 025A5AB9B5A365A8086B6F0A /* RTComponentTableView.podspec */, 218 | 7DAF28A8AEE1F0CE939117FB /* README.md */, 219 | DC6E59E9163113A529653F1D /* LICENSE */, 220 | ); 221 | name = "Podspec Metadata"; 222 | sourceTree = ""; 223 | }; 224 | 7DC6533D36805F9BAE729FE2 /* Pods */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 9A30233BB298216281F7871D /* Pods-RTComponentTableView_Example.debug.xcconfig */, 228 | E47F5B90101F855869478692 /* Pods-RTComponentTableView_Example.release.xcconfig */, 229 | ); 230 | name = Pods; 231 | sourceTree = ""; 232 | }; 233 | 9C4950441D166B25008B17AD /* Components */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 9C006E1B1D16E2C800FD66FF /* RTDemoBannerComponent.h */, 237 | 9C006E1C1D16E2C800FD66FF /* RTDemoBannerComponent.m */, 238 | 9C006E071D16852100FD66FF /* RTDemoImageItemComponent.h */, 239 | 9C006E081D16852100FD66FF /* RTDemoImageItemComponent.m */, 240 | 9C4950511D167A86008B17AD /* RTDemoItemComponent.h */, 241 | 9C4950521D167A86008B17AD /* RTDemoItemComponent.m */, 242 | 9C006E181D16908800FD66FF /* RTDemoTagsComponent.h */, 243 | 9C006E191D16908800FD66FF /* RTDemoTagsComponent.m */, 244 | 9C006E041D1680F000FD66FF /* RTMoreActionComponent.h */, 245 | 9C006E051D1680F000FD66FF /* RTMoreActionComponent.m */, 246 | ); 247 | name = Components; 248 | sourceTree = ""; 249 | }; 250 | 9C49504C1D16782F008B17AD /* TableCells */ = { 251 | isa = PBXGroup; 252 | children = ( 253 | 9C49504E1D167861008B17AD /* RTItemTableViewCell.h */, 254 | 9C49504F1D167861008B17AD /* RTItemTableViewCell.m */, 255 | ); 256 | name = TableCells; 257 | sourceTree = ""; 258 | }; 259 | 9C49504D1D16783B008B17AD /* CollectionCells */ = { 260 | isa = PBXGroup; 261 | children = ( 262 | 9C006E0A1D16853B00FD66FF /* RTImageItemCollectionViewCell.h */, 263 | 9C006E0B1D16853B00FD66FF /* RTImageItemCollectionViewCell.m */, 264 | 9C006E151D168F9900FD66FF /* RTTextCollectionViewCell.h */, 265 | 9C006E161D168F9900FD66FF /* RTTextCollectionViewCell.m */, 266 | ); 267 | name = CollectionCells; 268 | sourceTree = ""; 269 | }; 270 | /* End PBXGroup section */ 271 | 272 | /* Begin PBXNativeTarget section */ 273 | 6003F589195388D20070C39A /* RTComponentTableView_Example */ = { 274 | isa = PBXNativeTarget; 275 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "RTComponentTableView_Example" */; 276 | buildPhases = ( 277 | C0952A247C6C8F3564129854 /* Check Pods Manifest.lock */, 278 | 6003F586195388D20070C39A /* Sources */, 279 | 6003F587195388D20070C39A /* Frameworks */, 280 | 6003F588195388D20070C39A /* Resources */, 281 | 95E1F5E57E9C45D6EEF5DFFA /* Embed Pods Frameworks */, 282 | 29AD141958CB8F606A0A160C /* Copy Pods Resources */, 283 | ); 284 | buildRules = ( 285 | ); 286 | dependencies = ( 287 | ); 288 | name = RTComponentTableView_Example; 289 | productName = RTComponentTableView; 290 | productReference = 6003F58A195388D20070C39A /* RTComponentTableView_Example.app */; 291 | productType = "com.apple.product-type.application"; 292 | }; 293 | 6003F5AD195388D20070C39A /* RTComponentTableView_Tests */ = { 294 | isa = PBXNativeTarget; 295 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "RTComponentTableView_Tests" */; 296 | buildPhases = ( 297 | 6003F5AA195388D20070C39A /* Sources */, 298 | 6003F5AB195388D20070C39A /* Frameworks */, 299 | 6003F5AC195388D20070C39A /* Resources */, 300 | ); 301 | buildRules = ( 302 | ); 303 | dependencies = ( 304 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 305 | ); 306 | name = RTComponentTableView_Tests; 307 | productName = RTComponentTableViewTests; 308 | productReference = 6003F5AE195388D20070C39A /* RTComponentTableView_Tests.xctest */; 309 | productType = "com.apple.product-type.bundle.unit-test"; 310 | }; 311 | /* End PBXNativeTarget section */ 312 | 313 | /* Begin PBXProject section */ 314 | 6003F582195388D10070C39A /* Project object */ = { 315 | isa = PBXProject; 316 | attributes = { 317 | CLASSPREFIX = RT; 318 | LastUpgradeCheck = 0720; 319 | ORGANIZATIONNAME = rickytan; 320 | TargetAttributes = { 321 | 6003F5AD195388D20070C39A = { 322 | TestTargetID = 6003F589195388D20070C39A; 323 | }; 324 | }; 325 | }; 326 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "RTComponentTableView" */; 327 | compatibilityVersion = "Xcode 3.2"; 328 | developmentRegion = English; 329 | hasScannedForEncodings = 0; 330 | knownRegions = ( 331 | en, 332 | Base, 333 | ); 334 | mainGroup = 6003F581195388D10070C39A; 335 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 336 | projectDirPath = ""; 337 | projectRoot = ""; 338 | targets = ( 339 | 6003F589195388D20070C39A /* RTComponentTableView_Example */, 340 | 6003F5AD195388D20070C39A /* RTComponentTableView_Tests */, 341 | ); 342 | }; 343 | /* End PBXProject section */ 344 | 345 | /* Begin PBXResourcesBuildPhase section */ 346 | 6003F588195388D20070C39A /* Resources */ = { 347 | isa = PBXResourcesBuildPhase; 348 | buildActionMask = 2147483647; 349 | files = ( 350 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 351 | 9C006E031D167D9E00FD66FF /* Launchscreen.storyboard in Resources */, 352 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 353 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 354 | ); 355 | runOnlyForDeploymentPostprocessing = 0; 356 | }; 357 | 6003F5AC195388D20070C39A /* Resources */ = { 358 | isa = PBXResourcesBuildPhase; 359 | buildActionMask = 2147483647; 360 | files = ( 361 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 362 | ); 363 | runOnlyForDeploymentPostprocessing = 0; 364 | }; 365 | /* End PBXResourcesBuildPhase section */ 366 | 367 | /* Begin PBXShellScriptBuildPhase section */ 368 | 29AD141958CB8F606A0A160C /* Copy Pods Resources */ = { 369 | isa = PBXShellScriptBuildPhase; 370 | buildActionMask = 2147483647; 371 | files = ( 372 | ); 373 | inputPaths = ( 374 | ); 375 | name = "Copy Pods Resources"; 376 | outputPaths = ( 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | shellPath = /bin/sh; 380 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RTComponentTableView_Example/Pods-RTComponentTableView_Example-resources.sh\"\n"; 381 | showEnvVarsInLog = 0; 382 | }; 383 | 95E1F5E57E9C45D6EEF5DFFA /* Embed Pods Frameworks */ = { 384 | isa = PBXShellScriptBuildPhase; 385 | buildActionMask = 2147483647; 386 | files = ( 387 | ); 388 | inputPaths = ( 389 | ); 390 | name = "Embed Pods Frameworks"; 391 | outputPaths = ( 392 | ); 393 | runOnlyForDeploymentPostprocessing = 0; 394 | shellPath = /bin/sh; 395 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RTComponentTableView_Example/Pods-RTComponentTableView_Example-frameworks.sh\"\n"; 396 | showEnvVarsInLog = 0; 397 | }; 398 | C0952A247C6C8F3564129854 /* Check Pods Manifest.lock */ = { 399 | isa = PBXShellScriptBuildPhase; 400 | buildActionMask = 2147483647; 401 | files = ( 402 | ); 403 | inputPaths = ( 404 | ); 405 | name = "Check Pods Manifest.lock"; 406 | outputPaths = ( 407 | ); 408 | runOnlyForDeploymentPostprocessing = 0; 409 | shellPath = /bin/sh; 410 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 411 | showEnvVarsInLog = 0; 412 | }; 413 | /* End PBXShellScriptBuildPhase section */ 414 | 415 | /* Begin PBXSourcesBuildPhase section */ 416 | 6003F586195388D20070C39A /* Sources */ = { 417 | isa = PBXSourcesBuildPhase; 418 | buildActionMask = 2147483647; 419 | files = ( 420 | 9C006E1D1D16E2C800FD66FF /* RTDemoBannerComponent.m in Sources */, 421 | 9C006E141D168C8F00FD66FF /* RTDemoCombinationViewController.m in Sources */, 422 | 6003F59E195388D20070C39A /* RTAppDelegate.m in Sources */, 423 | 9C4950531D167A86008B17AD /* RTDemoItemComponent.m in Sources */, 424 | 9C006E0C1D16853B00FD66FF /* RTImageItemCollectionViewCell.m in Sources */, 425 | 9C006E1A1D16908800FD66FF /* RTDemoTagsComponent.m in Sources */, 426 | 9C4950501D167861008B17AD /* RTItemTableViewCell.m in Sources */, 427 | 9C006E0F1D16894700FD66FF /* RTDemoStyle2ViewController.m in Sources */, 428 | 9C006E061D1680F000FD66FF /* RTMoreActionComponent.m in Sources */, 429 | 6003F5A7195388D20070C39A /* RTViewController.m in Sources */, 430 | 9C006E091D16852100FD66FF /* RTDemoImageItemComponent.m in Sources */, 431 | 6003F59A195388D20070C39A /* main.m in Sources */, 432 | 9C49504B1D167631008B17AD /* RTDemoStyle1ViewController.m in Sources */, 433 | 9C006E171D168F9900FD66FF /* RTTextCollectionViewCell.m in Sources */, 434 | ); 435 | runOnlyForDeploymentPostprocessing = 0; 436 | }; 437 | 6003F5AA195388D20070C39A /* Sources */ = { 438 | isa = PBXSourcesBuildPhase; 439 | buildActionMask = 2147483647; 440 | files = ( 441 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 442 | ); 443 | runOnlyForDeploymentPostprocessing = 0; 444 | }; 445 | /* End PBXSourcesBuildPhase section */ 446 | 447 | /* Begin PBXTargetDependency section */ 448 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 449 | isa = PBXTargetDependency; 450 | target = 6003F589195388D20070C39A /* RTComponentTableView_Example */; 451 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 452 | }; 453 | /* End PBXTargetDependency section */ 454 | 455 | /* Begin PBXVariantGroup section */ 456 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 457 | isa = PBXVariantGroup; 458 | children = ( 459 | 6003F597195388D20070C39A /* en */, 460 | ); 461 | name = InfoPlist.strings; 462 | sourceTree = ""; 463 | }; 464 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 465 | isa = PBXVariantGroup; 466 | children = ( 467 | 6003F5B9195388D20070C39A /* en */, 468 | ); 469 | name = InfoPlist.strings; 470 | sourceTree = ""; 471 | }; 472 | /* End PBXVariantGroup section */ 473 | 474 | /* Begin XCBuildConfiguration section */ 475 | 6003F5BD195388D20070C39A /* Debug */ = { 476 | isa = XCBuildConfiguration; 477 | buildSettings = { 478 | ALWAYS_SEARCH_USER_PATHS = NO; 479 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 480 | CLANG_CXX_LIBRARY = "libc++"; 481 | CLANG_ENABLE_MODULES = YES; 482 | CLANG_ENABLE_OBJC_ARC = YES; 483 | CLANG_WARN_BOOL_CONVERSION = YES; 484 | CLANG_WARN_CONSTANT_CONVERSION = YES; 485 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 486 | CLANG_WARN_EMPTY_BODY = YES; 487 | CLANG_WARN_ENUM_CONVERSION = YES; 488 | CLANG_WARN_INT_CONVERSION = YES; 489 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 490 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 491 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 492 | COPY_PHASE_STRIP = NO; 493 | ENABLE_TESTABILITY = YES; 494 | GCC_C_LANGUAGE_STANDARD = gnu99; 495 | GCC_DYNAMIC_NO_PIC = NO; 496 | GCC_OPTIMIZATION_LEVEL = 0; 497 | GCC_PREPROCESSOR_DEFINITIONS = ( 498 | "DEBUG=1", 499 | "$(inherited)", 500 | ); 501 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 502 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 503 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 504 | GCC_WARN_UNDECLARED_SELECTOR = YES; 505 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 506 | GCC_WARN_UNUSED_FUNCTION = YES; 507 | GCC_WARN_UNUSED_VARIABLE = YES; 508 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 509 | ONLY_ACTIVE_ARCH = YES; 510 | SDKROOT = iphoneos; 511 | TARGETED_DEVICE_FAMILY = "1,2"; 512 | }; 513 | name = Debug; 514 | }; 515 | 6003F5BE195388D20070C39A /* Release */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | ALWAYS_SEARCH_USER_PATHS = NO; 519 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 520 | CLANG_CXX_LIBRARY = "libc++"; 521 | CLANG_ENABLE_MODULES = YES; 522 | CLANG_ENABLE_OBJC_ARC = YES; 523 | CLANG_WARN_BOOL_CONVERSION = YES; 524 | CLANG_WARN_CONSTANT_CONVERSION = YES; 525 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 526 | CLANG_WARN_EMPTY_BODY = YES; 527 | CLANG_WARN_ENUM_CONVERSION = YES; 528 | CLANG_WARN_INT_CONVERSION = YES; 529 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 530 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 531 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 532 | COPY_PHASE_STRIP = YES; 533 | ENABLE_NS_ASSERTIONS = NO; 534 | GCC_C_LANGUAGE_STANDARD = gnu99; 535 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 536 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 537 | GCC_WARN_UNDECLARED_SELECTOR = YES; 538 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 539 | GCC_WARN_UNUSED_FUNCTION = YES; 540 | GCC_WARN_UNUSED_VARIABLE = YES; 541 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 542 | SDKROOT = iphoneos; 543 | TARGETED_DEVICE_FAMILY = "1,2"; 544 | VALIDATE_PRODUCT = YES; 545 | }; 546 | name = Release; 547 | }; 548 | 6003F5C0195388D20070C39A /* Debug */ = { 549 | isa = XCBuildConfiguration; 550 | baseConfigurationReference = 9A30233BB298216281F7871D /* Pods-RTComponentTableView_Example.debug.xcconfig */; 551 | buildSettings = { 552 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 553 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 554 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 555 | GCC_PREFIX_HEADER = "RTComponentTableView/RTComponentTableView-Prefix.pch"; 556 | INFOPLIST_FILE = "RTComponentTableView/RTComponentTableView-Info.plist"; 557 | MODULE_NAME = ExampleApp; 558 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 559 | PRODUCT_NAME = "$(TARGET_NAME)"; 560 | WRAPPER_EXTENSION = app; 561 | }; 562 | name = Debug; 563 | }; 564 | 6003F5C1195388D20070C39A /* Release */ = { 565 | isa = XCBuildConfiguration; 566 | baseConfigurationReference = E47F5B90101F855869478692 /* Pods-RTComponentTableView_Example.release.xcconfig */; 567 | buildSettings = { 568 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 569 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 570 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 571 | GCC_PREFIX_HEADER = "RTComponentTableView/RTComponentTableView-Prefix.pch"; 572 | INFOPLIST_FILE = "RTComponentTableView/RTComponentTableView-Info.plist"; 573 | MODULE_NAME = ExampleApp; 574 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 575 | PRODUCT_NAME = "$(TARGET_NAME)"; 576 | WRAPPER_EXTENSION = app; 577 | }; 578 | name = Release; 579 | }; 580 | 6003F5C3195388D20070C39A /* Debug */ = { 581 | isa = XCBuildConfiguration; 582 | buildSettings = { 583 | BUNDLE_LOADER = "$(TEST_HOST)"; 584 | FRAMEWORK_SEARCH_PATHS = ( 585 | "$(SDKROOT)/Developer/Library/Frameworks", 586 | "$(inherited)", 587 | "$(DEVELOPER_FRAMEWORKS_DIR)", 588 | ); 589 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 590 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 591 | GCC_PREPROCESSOR_DEFINITIONS = ( 592 | "DEBUG=1", 593 | "$(inherited)", 594 | ); 595 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 596 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 597 | PRODUCT_NAME = "$(TARGET_NAME)"; 598 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RTComponentTableView_Example.app/RTComponentTableView_Example"; 599 | WRAPPER_EXTENSION = xctest; 600 | }; 601 | name = Debug; 602 | }; 603 | 6003F5C4195388D20070C39A /* Release */ = { 604 | isa = XCBuildConfiguration; 605 | buildSettings = { 606 | BUNDLE_LOADER = "$(TEST_HOST)"; 607 | FRAMEWORK_SEARCH_PATHS = ( 608 | "$(SDKROOT)/Developer/Library/Frameworks", 609 | "$(inherited)", 610 | "$(DEVELOPER_FRAMEWORKS_DIR)", 611 | ); 612 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 613 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 614 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 615 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 616 | PRODUCT_NAME = "$(TARGET_NAME)"; 617 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RTComponentTableView_Example.app/RTComponentTableView_Example"; 618 | WRAPPER_EXTENSION = xctest; 619 | }; 620 | name = Release; 621 | }; 622 | /* End XCBuildConfiguration section */ 623 | 624 | /* Begin XCConfigurationList section */ 625 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "RTComponentTableView" */ = { 626 | isa = XCConfigurationList; 627 | buildConfigurations = ( 628 | 6003F5BD195388D20070C39A /* Debug */, 629 | 6003F5BE195388D20070C39A /* Release */, 630 | ); 631 | defaultConfigurationIsVisible = 0; 632 | defaultConfigurationName = Release; 633 | }; 634 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "RTComponentTableView_Example" */ = { 635 | isa = XCConfigurationList; 636 | buildConfigurations = ( 637 | 6003F5C0195388D20070C39A /* Debug */, 638 | 6003F5C1195388D20070C39A /* Release */, 639 | ); 640 | defaultConfigurationIsVisible = 0; 641 | defaultConfigurationName = Release; 642 | }; 643 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "RTComponentTableView_Tests" */ = { 644 | isa = XCConfigurationList; 645 | buildConfigurations = ( 646 | 6003F5C3195388D20070C39A /* Debug */, 647 | 6003F5C4195388D20070C39A /* Release */, 648 | ); 649 | defaultConfigurationIsVisible = 0; 650 | defaultConfigurationName = Release; 651 | }; 652 | /* End XCConfigurationList section */ 653 | }; 654 | rootObject = 6003F582195388D10070C39A /* Project object */; 655 | } 656 | -------------------------------------------------------------------------------- /Example/RTComponentTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/RTComponentTableView.xcodeproj/xcshareddata/xcschemes/RTComponentTableView-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/RTComponentTableView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/1.imageset/1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rickytan/RTComponentTableView/200eb3d6d566077640a0152afb5bc987f741b6d7/Example/RTComponentTableView/Images.xcassets/1.imageset/1@2x.png -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/2.imageset/2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rickytan/RTComponentTableView/200eb3d6d566077640a0152afb5bc987f741b6d7/Example/RTComponentTableView/Images.xcassets/2.imageset/2@2x.png -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "2@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/3.imageset/3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rickytan/RTComponentTableView/200eb3d6d566077640a0152afb5bc987f741b6d7/Example/RTComponentTableView/Images.xcassets/3.imageset/3@2x.png -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "3@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/4.imageset/4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rickytan/RTComponentTableView/200eb3d6d566077640a0152afb5bc987f741b6d7/Example/RTComponentTableView/Images.xcassets/4.imageset/4@2x.png -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "4@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/5.imageset/5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rickytan/RTComponentTableView/200eb3d6d566077640a0152afb5bc987f741b6d7/Example/RTComponentTableView/Images.xcassets/5.imageset/5@2x.png -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "5@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/RTComponentTableView/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/Launchscreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/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 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 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 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTAppDelegate.h 3 | // RTComponentTableView 4 | // 5 | // Created by rickytan on 06/15/2016. 6 | // Copyright (c) 2016 rickytan. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface RTAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTAppDelegate.m 3 | // RTComponentTableView 4 | // 5 | // Created by rickytan on 06/15/2016. 6 | // Copyright (c) 2016 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTAppDelegate.h" 10 | 11 | @implementation RTAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTComponentTableView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | Launchscreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTComponentTableView-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoBannerComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoBannerComponent.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTDemoBannerComponent : RTCollectionComponent 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoBannerComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoBannerComponent.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTDemoBannerComponent.h" 10 | 11 | @implementation RTDemoBannerComponent 12 | 13 | - (instancetype)initWithTableView:(UITableView *)tableView delegate:(id)delegate 14 | { 15 | self = [super initWithTableView:tableView delegate:delegate]; 16 | if (self) { 17 | self.title = @"Banners"; 18 | self.actionTitle = @"More >"; 19 | } 20 | return self; 21 | } 22 | 23 | - (void)configureCollectionView:(UICollectionView *)collectionView 24 | { 25 | [super configureCollectionView:collectionView]; 26 | 27 | collectionView.contentInset = UIEdgeInsetsZero; 28 | collectionView.pagingEnabled = YES; 29 | 30 | UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)collectionView.collectionViewLayout; 31 | layout.minimumInteritemSpacing = 0.f; 32 | layout.minimumLineSpacing = 0.f; 33 | } 34 | 35 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 36 | { 37 | return 4; 38 | } 39 | 40 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 41 | { 42 | UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" 43 | forIndexPath:indexPath]; 44 | UIImageView *imageView = (UIImageView *)[cell.contentView viewWithTag:1001]; 45 | if (!imageView) { 46 | imageView = [[UIImageView alloc] initWithFrame:cell.bounds]; 47 | imageView.contentMode = UIViewContentModeScaleAspectFill; 48 | imageView.tag = 1001; 49 | imageView.layer.borderWidth = 0.5f; 50 | imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; 51 | [cell.contentView addSubview:imageView]; 52 | } 53 | imageView.image = [UIImage imageNamed:[@(indexPath.item % 5 + 1) stringValue]]; 54 | return cell; 55 | } 56 | 57 | - (CGSize)collectionView:(UICollectionView *)collectionView 58 | layout:(UICollectionViewLayout *)collectionViewLayout 59 | sizeForItemAtIndexPath:(NSIndexPath *)indexPath 60 | { 61 | return collectionView.bounds.size; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoCombinationViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoCombinationViewController.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTDemoCombinationViewController : RTComponentController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoCombinationViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoCombinationViewController.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTDemoCombinationViewController.h" 10 | 11 | #import "RTDemoImageItemComponent.h" 12 | #import "RTDemoItemComponent.h" 13 | #import "RTDemoTagsComponent.h" 14 | #import "RTDemoBannerComponent.h" 15 | 16 | @interface RTDemoCombinationViewController () 17 | 18 | @end 19 | 20 | @implementation RTDemoCombinationViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | RTDemoTagsComponent *tags = [RTDemoTagsComponent componentWithTableView:self.tableView 26 | delegate:self]; 27 | self.components = @[tags, 28 | [RTDemoImageItemComponent componentWithTableView:self.tableView 29 | delegate:self], 30 | [RTDemoBannerComponent componentWithTableView:self.tableView 31 | delegate:self], 32 | [RTDemoImageItemComponent componentWithTableView:self.tableView 33 | delegate:self], 34 | [RTDemoItemComponent componentWithTableView:self.tableView 35 | delegate:self]]; 36 | 37 | [tags reloadDataWithTableView:self.tableView 38 | inSection:0]; 39 | } 40 | 41 | #pragma mark - Component Delegate 42 | 43 | - (void)tableComponent:(id)component didTapItemAtIndex:(NSUInteger)index 44 | { 45 | [[[UIAlertView alloc] initWithTitle:@"Item" 46 | message:[NSString stringWithFormat:@"Index: %lu", (unsigned long)index] 47 | delegate:nil 48 | cancelButtonTitle:@"OK" 49 | otherButtonTitles:nil] show]; 50 | } 51 | 52 | - (void)tableComponent:(id)component didTapActionButton:(UIButton *)actionButton 53 | { 54 | if ([component isKindOfClass:[RTDemoTagsComponent class]]) { 55 | [component reloadDataWithTableView:self.tableView 56 | inSection:0]; 57 | } 58 | else { 59 | [[[UIAlertView alloc] initWithTitle:@"Action Button" 60 | message:actionButton.titleLabel.text 61 | delegate:nil 62 | cancelButtonTitle:@"OK" 63 | otherButtonTitles:nil] show]; 64 | } 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoImageItemComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoImageItemComponent.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTDemoImageItemComponent : RTCollectionComponent 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoImageItemComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoImageItemComponent.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTDemoImageItemComponent.h" 10 | 11 | #import "RTImageItemCollectionViewCell.h" 12 | 13 | @implementation RTDemoImageItemComponent 14 | 15 | - (instancetype)initWithTableView:(UITableView *)tableView delegate:(id)delegate 16 | { 17 | self = [super initWithTableView:tableView delegate:delegate]; 18 | if (self) { 19 | self.title = @"Photo"; 20 | self.actionTitle = @"Share"; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)configureCollectionView:(UICollectionView *)collectionView 26 | { 27 | [super configureCollectionView:collectionView]; 28 | 29 | [collectionView registerClass:[RTImageItemCollectionViewCell class] 30 | forCellWithReuseIdentifier:@"Cell"]; 31 | UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)collectionView.collectionViewLayout; 32 | layout.itemSize = CGSizeMake(120, 164); 33 | } 34 | 35 | - (CGFloat)heightForComponentItemAtIndex:(NSUInteger)index 36 | { 37 | return 180.f; 38 | } 39 | 40 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 41 | { 42 | return 6; 43 | } 44 | 45 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView 46 | cellForItemAtIndexPath:(NSIndexPath *)indexPath 47 | { 48 | RTImageItemCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" 49 | forIndexPath:indexPath]; 50 | cell.imageView.image = [UIImage imageNamed:[@(indexPath.item % 5 + 1) stringValue]]; 51 | cell.nameLabel.text = @"Picture"; 52 | cell.detailLabel.text = @"Descriptions"; 53 | return cell; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoItemComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoItemComponent.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTMoreActionComponent.h" 10 | 11 | @interface RTDemoItemComponent : RTMoreActionComponent 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoItemComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoItemComponent.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTDemoItemComponent.h" 10 | 11 | #import "RTItemTableViewCell.h" 12 | 13 | @implementation RTDemoItemComponent 14 | 15 | - (instancetype)initWithTableView:(UITableView *)tableView delegate:(id)delegate 16 | { 17 | self = [super initWithTableView:tableView delegate:delegate]; 18 | if (self) { 19 | self.title = @"Items"; 20 | } 21 | return self; 22 | } 23 | 24 | - (void)registerWithTableView:(UITableView *)tableView 25 | { 26 | [super registerWithTableView:tableView]; 27 | 28 | [tableView registerClass:[RTItemTableViewCell class] 29 | forCellReuseIdentifier:self.cellIdentifier]; 30 | } 31 | 32 | - (NSInteger)numberOfItems 33 | { 34 | return 8; 35 | } 36 | 37 | - (CGFloat)heightForComponentItemAtIndex:(NSUInteger)index 38 | { 39 | return 64.f; 40 | } 41 | 42 | - (__kindof UITableViewCell *)cellForTableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath 43 | { 44 | RTItemTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:self.cellIdentifier 45 | forIndexPath:indexPath]; 46 | cell.imageView.image = [UIImage imageNamed:[@(indexPath.row % 5 + 1) stringValue]]; 47 | cell.textLabel.text = @"A awesome item"; 48 | cell.detailTextLabel.text = @"some descriptions here. some descriptions here. some descriptions here."; 49 | return cell; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoStyle1ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoStyle1ViewController.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTDemoStyle1ViewController : RTComponentController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoStyle1ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoStyle1ViewController.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTDemoStyle1ViewController.h" 10 | 11 | #import "RTDemoItemComponent.h" 12 | 13 | @interface RTDemoStyle1ViewController () 14 | 15 | @end 16 | 17 | @implementation RTDemoStyle1ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view. 22 | 23 | self.components = @[[RTDemoItemComponent componentWithTableView:self.tableView 24 | delegate:self]]; 25 | } 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoStyle2ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoStyle2ViewController.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTDemoStyle2ViewController : RTComponentController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoStyle2ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoStyle2ViewController.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTDemoStyle2ViewController.h" 10 | 11 | #import "RTDemoImageItemComponent.h" 12 | 13 | @interface RTDemoStyle2ViewController () 14 | 15 | @end 16 | 17 | @implementation RTDemoStyle2ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view. 22 | self.tableView.tableFooterView = [UIView new]; 23 | 24 | self.components = @[[RTDemoImageItemComponent componentWithTableView:self.tableView delegate:self]]; 25 | } 26 | 27 | - (void)didReceiveMemoryWarning { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | /* 33 | #pragma mark - Navigation 34 | 35 | // In a storyboard-based application, you will often want to do a little preparation before navigation 36 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 37 | // Get the new view controller using [segue destinationViewController]. 38 | // Pass the selected object to the new view controller. 39 | } 40 | */ 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoTagsComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoTagsComponent.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTDemoTagsComponent : RTCollectionComponent 12 | @property (nonatomic, strong) NSArray *tags; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTDemoTagsComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTDemoTagsComponent.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTDemoTagsComponent.h" 10 | 11 | #import "RTTextCollectionViewCell.h" 12 | 13 | @implementation RTDemoTagsComponent 14 | 15 | - (instancetype)initWithTableView:(UITableView *)tableView delegate:(id)delegate 16 | { 17 | self = [super initWithTableView:tableView delegate:delegate]; 18 | if (self) { 19 | self.title = @"Suggestions"; 20 | self.actionTitle = @"Refresh"; 21 | } 22 | return self; 23 | } 24 | 25 | - (void)reloadDataWithTableView:(UITableView *)tableView inSection:(NSInteger)section 26 | { 27 | static BOOL refresh = NO; 28 | if (!refresh) { 29 | refresh = YES; 30 | self.tags = @[@"C++", @"C", @"Objective-C", @"Javascript", @"CSS", @"Swift", @"Go", @"Python", @"PHP", @"HTML"]; 31 | } 32 | else { 33 | refresh = NO; 34 | self.tags = @[@"NodeJS", @"AngularJS", @"Ruby", @"Erlang", @"MySQL"]; 35 | } 36 | [self.collectionView reloadData]; 37 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 38 | [self setNeedUpdateHeightForSection:section]; 39 | }); 40 | } 41 | 42 | - (CGFloat)heightForComponentItemAtIndex:(NSUInteger)index 43 | { 44 | return ceil(MAX(44, self.collectionView.contentSize.height + self.collectionView.contentInset.top + self.collectionView.contentInset.bottom)); 45 | } 46 | 47 | - (void)configureCollectionView:(UICollectionView *)collectionView 48 | { 49 | [super configureCollectionView:collectionView]; 50 | 51 | [collectionView registerClass:[RTTextCollectionViewCell class] 52 | forCellWithReuseIdentifier:@"Cell"]; 53 | 54 | UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)collectionView.collectionViewLayout; 55 | layout.scrollDirection = UICollectionViewScrollDirectionVertical; 56 | } 57 | 58 | - (NSInteger)collectionView:(UICollectionView *)collectionView 59 | numberOfItemsInSection:(NSInteger)section 60 | { 61 | return self.tags.count; 62 | } 63 | 64 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 65 | { 66 | RTTextCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" 67 | forIndexPath:indexPath]; 68 | cell.text = self.tags[indexPath.item]; 69 | return cell; 70 | } 71 | 72 | - (CGSize)collectionView:(UICollectionView *)collectionView 73 | layout:(UICollectionViewLayout *)collectionViewLayout 74 | sizeForItemAtIndexPath:(NSIndexPath *)indexPath 75 | { 76 | CGSize size = [self.tags[indexPath.item] sizeWithAttributes:@{NSFontAttributeName: [UIFont preferredFontForTextStyle:UIFontTextStyleBody]}]; 77 | size.width += 16.f; 78 | size.height += 8.f; 79 | return size; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTImageItemCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTImageItemCollectionViewCell.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTImageItemCollectionViewCell : UICollectionViewCell 12 | @property (nonatomic, readonly, strong) UIImageView *imageView; 13 | @property (nonatomic, readonly, strong) UILabel *nameLabel; 14 | @property (nonatomic, readonly, strong) UILabel *detailLabel; 15 | @end 16 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTImageItemCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTImageItemCollectionViewCell.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "RTImageItemCollectionViewCell.h" 12 | 13 | @interface RTImageItemCollectionViewCell () 14 | @property (nonatomic, strong) UIImageView *imageView; 15 | @property (nonatomic, strong) UILabel *nameLabel; 16 | @property (nonatomic, strong) UILabel *detailLabel; 17 | @end 18 | 19 | @implementation RTImageItemCollectionViewCell 20 | 21 | - (instancetype)initWithFrame:(CGRect)frame 22 | { 23 | self = [super initWithFrame:frame]; 24 | if (self) { 25 | self.layer.borderWidth = 1.f; 26 | 27 | self.imageView = [[UIImageView alloc] init]; 28 | self.imageView.contentMode = UIViewContentModeScaleAspectFit; 29 | [self.contentView addSubview:self.imageView]; 30 | [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { 31 | make.top.left.right.offset(0.f); 32 | make.height.equalTo(self.imageView.mas_width); 33 | }]; 34 | 35 | self.nameLabel = [[UILabel alloc] init]; 36 | self.nameLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; 37 | [self.contentView addSubview:self.nameLabel]; 38 | [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { 39 | make.centerX.offset(0.f); 40 | make.top.equalTo(self.imageView.mas_bottom).offset(4.f); 41 | make.width.lessThanOrEqualTo(self.contentView); 42 | }]; 43 | 44 | self.detailLabel = [[UILabel alloc] init]; 45 | self.detailLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]; 46 | [self.contentView addSubview:self.detailLabel]; 47 | [self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) { 48 | make.centerX.offset(0.f); 49 | make.top.equalTo(self.nameLabel.mas_bottom).offset(2.f); 50 | make.bottom.lessThanOrEqualTo(self.contentView).offset(2.f); 51 | }]; 52 | } 53 | return self; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTItemTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTItemTableViewCell.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTItemTableViewCell : UITableViewCell 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTItemTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTItemTableViewCell.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTItemTableViewCell.h" 10 | 11 | @implementation RTItemTableViewCell 12 | 13 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier 14 | { 15 | self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier]; 16 | if (self) { 17 | self.textLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]; 18 | self.textLabel.textColor = [UIColor darkTextColor]; 19 | self.detailTextLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2]; 20 | self.detailTextLabel.numberOfLines = 0; 21 | self.detailTextLabel.textColor = [UIColor grayColor]; 22 | } 23 | return self; 24 | } 25 | 26 | - (void)layoutSubviews 27 | { 28 | [super layoutSubviews]; 29 | 30 | CGFloat height = self.contentView.bounds.size.height - 8 * 2; 31 | self.imageView.frame = CGRectMake(8, 8, height, height); 32 | 33 | CGFloat width = CGRectGetWidth(self.contentView.bounds) - CGRectGetMaxX(self.imageView.frame) - 8; 34 | self.textLabel.preferredMaxLayoutWidth = width; 35 | [self.textLabel sizeToFit]; 36 | self.textLabel.frame = CGRectMake(CGRectGetMaxX(self.imageView.frame) + 8, 8, width, self.textLabel.frame.size.height); 37 | 38 | self.detailTextLabel.preferredMaxLayoutWidth = width; 39 | [self.detailTextLabel sizeToFit]; 40 | self.detailTextLabel.frame = CGRectMake(CGRectGetMaxX(self.imageView.frame) + 8, CGRectGetMaxY(self.textLabel.frame) + 4, width, self.detailTextLabel.frame.size.height); 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTMoreActionComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTMoreActionComponent.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTMoreActionComponent : RTActionHeaderComponent 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTMoreActionComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTMoreActionComponent.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTMoreActionComponent.h" 10 | 11 | @implementation RTMoreActionComponent 12 | 13 | - (instancetype)initWithTableView:(UITableView *)tableView delegate:(id)delegate 14 | { 15 | self = [super initWithTableView:tableView delegate:delegate]; 16 | if (self) { 17 | self.actionTitle = @"More >"; 18 | } 19 | return self; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTTextCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTTextCollectionViewCell.h 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RTTextCollectionViewCell : UICollectionViewCell 12 | @property (nonatomic, strong) NSString *text; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTTextCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTTextCollectionViewCell.m 3 | // RTComponentTableView 4 | // 5 | // Created by ricky on 16/6/19. 6 | // Copyright © 2016年 rickytan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "RTTextCollectionViewCell.h" 12 | 13 | @interface RTTextCollectionViewCell () 14 | @property (nonatomic, strong) UILabel *label; 15 | @end 16 | 17 | @implementation RTTextCollectionViewCell 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | self.layer.cornerRadius = 3.f; 24 | self.layer.borderWidth = 1.f; 25 | 26 | self.label = [[UILabel alloc] init]; 27 | self.label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; 28 | [self.contentView addSubview:self.label]; 29 | [self.label mas_makeConstraints:^(MASConstraintMaker *make) { 30 | make.center.equalTo(self.contentView); 31 | make.width.lessThanOrEqualTo(self.contentView); 32 | }]; 33 | } 34 | return self; 35 | } 36 | 37 | - (void)setText:(NSString *)text 38 | { 39 | self.label.text = text; 40 | } 41 | 42 | - (NSString *)text 43 | { 44 | return self.label.text; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTViewController.h 3 | // RTComponentTableView 4 | // 5 | // Created by rickytan on 06/15/2016. 6 | // Copyright (c) 2016 rickytan. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface RTViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/RTViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTViewController.m 3 | // RTComponentTableView 4 | // 5 | // Created by rickytan on 06/15/2016. 6 | // Copyright (c) 2016 rickytan. All rights reserved. 7 | // 8 | 9 | #import "RTViewController.h" 10 | 11 | @interface RTViewController () 12 | 13 | @end 14 | 15 | @implementation RTViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view, typically from a nib. 21 | } 22 | 23 | - (void)didReceiveMemoryWarning 24 | { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/RTComponentTableView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // RTComponentTableView 4 | // 5 | // Created by rickytan on 06/15/2016. 6 | // Copyright (c) 2016 rickytan. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "RTAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([RTAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTComponentTableViewTests.m 3 | // RTComponentTableViewTests 4 | // 5 | // Created by rickytan on 06/15/2016. 6 | // Copyright (c) 2016 rickytan. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 rickytan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RTComponentTableView 2 | 3 | [![CI Status](http://img.shields.io/travis/rickytan/RTComponentTableView.svg?style=flat)](https://travis-ci.org/rickytan/RTComponentTableView) 4 | [![Version](https://img.shields.io/cocoapods/v/RTComponentTableView.svg?style=flat)](http://cocoapods.org/pods/RTComponentTableView) 5 | [![License](https://img.shields.io/cocoapods/l/RTComponentTableView.svg?style=flat)](http://cocoapods.org/pods/RTComponentTableView) 6 | [![Platform](https://img.shields.io/cocoapods/p/RTComponentTableView.svg?style=flat)](http://cocoapods.org/pods/RTComponentTableView) 7 | 8 | ## 简介 9 | 一种组件化的 `UITableView` 的实现,见 [xcoder.tips](https://xcoder.tips/a-componentized-uitableivew/) 10 | 11 | ## Example 12 | 13 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 14 | 15 | ## Requirements 16 | 17 | ## Installation 18 | 19 | RTComponentTableView is available through [CocoaPods](http://cocoapods.org). To install 20 | it, simply add the following line to your Podfile: 21 | 22 | ```ruby 23 | pod "RTComponentTableView" 24 | ``` 25 | 26 | ## Author 27 | 28 | rickytan, ricky.tan.xin@gmail.com 29 | 30 | ## License 31 | 32 | RTComponentTableView is available under the MIT license. See the LICENSE file for more info. 33 | -------------------------------------------------------------------------------- /RTComponentTableView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint RTComponentTableView.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'RTComponentTableView' 11 | s.version = '0.1.1' 12 | s.summary = 'A short description of RTComponentTableView.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | TODO: Add long description of the pod here. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/rickytan/RTComponentTableView' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'rickytan' => 'ricky.tan.xin@gmail.com' } 28 | s.source = { :git => 'https://github.com/rickytan/RTComponentTableView.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '7.0' 32 | 33 | s.source_files = 'RTComponentTableView/Classes/**/*' 34 | s.public_header_files = 'RTComponentTableView/Classes/**/*.h' 35 | s.frameworks = 'UIKit', 'Foundation' 36 | # s.dependency 'AFNetworking', '~> 2.3' 37 | end 38 | -------------------------------------------------------------------------------- /RTComponentTableView/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rickytan/RTComponentTableView/200eb3d6d566077640a0152afb5bc987f741b6d7/RTComponentTableView/Assets/.gitkeep -------------------------------------------------------------------------------- /RTComponentTableView/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rickytan/RTComponentTableView/200eb3d6d566077640a0152afb5bc987f741b6d7/RTComponentTableView/Classes/.gitkeep -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTActionHeaderComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTActionHeaderComponent.h 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #import "RTHeaderComponent.h" 10 | 11 | @protocol RTActionHeaderComponentDelegate 12 | @optional 13 | - (void)tableComponent:(id)component 14 | didTapActionButton:(UIButton *)actionButton; 15 | @end 16 | 17 | 18 | @interface RTActionHeaderComponent : RTHeaderComponent 19 | @property (nonatomic, weak) id delegate; 20 | @property (nonatomic, readonly, strong) UIButton *actionButton; 21 | @property (nonatomic, strong) NSString *actionTitle; 22 | @end 23 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTActionHeaderComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTActionHeaderComponent.m 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #import "RTActionHeaderComponent.h" 10 | 11 | @interface RTActionHeaderComponent () 12 | @property (nonatomic, strong) UIButton *actionButton; 13 | @end 14 | 15 | 16 | @implementation RTActionHeaderComponent 17 | @dynamic delegate; 18 | 19 | - (void)setActionButton:(UIButton *)actionButton 20 | { 21 | self.accessoryView = actionButton; 22 | } 23 | 24 | - (UIButton *)actionButton 25 | { 26 | if (!self.accessoryView) { 27 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 28 | button.titleLabel.font = [UIFont systemFontOfSize:12]; 29 | [button setTitleColor:button.tintColor forState:UIControlStateNormal]; 30 | [button addTarget:self 31 | action:@selector(onActionButton:) 32 | forControlEvents:UIControlEventTouchUpInside]; 33 | 34 | self.actionButton = button; 35 | } 36 | return (UIButton *)self.accessoryView; 37 | } 38 | 39 | - (void)setActionTitle:(NSString *)actionTitle 40 | { 41 | if (_actionTitle != actionTitle) { 42 | _actionTitle = actionTitle; 43 | 44 | [self.actionButton setTitle:_actionTitle 45 | forState:UIControlStateNormal]; 46 | [self.actionButton sizeToFit]; 47 | } 48 | } 49 | 50 | - (void)onActionButton:(id)sender 51 | { 52 | if ([self.delegate respondsToSelector:@selector(tableComponent:didTapActionButton:)]) { 53 | [self.delegate tableComponent:self didTapActionButton:self.actionButton]; 54 | } 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTBaseComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTBaseComponent.h 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/18. 6 | // 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "RTTableComponent.h" 13 | 14 | 15 | @interface RTBaseComponent : NSObject 16 | @property (nonatomic, weak) id delegate; 17 | @property (nonatomic, weak, readonly) UITableView *tableView; 18 | 19 | @property (nonatomic, strong) NSString *cellIdentifier; 20 | @property (nonatomic, strong) NSString *headerIdentifier, *footerIdentifier; 21 | 22 | + (instancetype)componentWithTableView:(UITableView *)tableView; 23 | + (instancetype)componentWithTableView:(UITableView *)tableView delegate:(id)delegate; 24 | 25 | - (instancetype)init NS_UNAVAILABLE; 26 | - (instancetype)initWithTableView:(UITableView *)tableView; 27 | - (instancetype)initWithTableView:(UITableView *)tableView delegate:(id)delegate NS_DESIGNATED_INITIALIZER; 28 | 29 | - (void)registerWithTableView:(UITableView *)tableView NS_REQUIRES_SUPER; 30 | - (void)setNeedUpdateHeightForSection:(NSInteger)section; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTBaseComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTBaseComponent.m 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/18. 6 | // 7 | // 8 | 9 | #import "RTBaseComponent.h" 10 | 11 | #import "RTTableComponent.h" 12 | 13 | @interface RTBaseComponent () 14 | @property (nonatomic, weak) UITableView *tableView; 15 | @end 16 | 17 | @implementation RTBaseComponent 18 | 19 | + (instancetype)componentWithTableView:(UITableView *)tableView 20 | { 21 | return [self componentWithTableView:tableView 22 | delegate:nil]; 23 | } 24 | 25 | + (instancetype)componentWithTableView:(UITableView *)tableView delegate:(id)delegate 26 | { 27 | id component = [[self alloc] initWithTableView:tableView 28 | delegate:delegate]; 29 | return component; 30 | } 31 | 32 | - (instancetype)init 33 | { 34 | return [self initWithTableView:nil]; 35 | } 36 | 37 | - (instancetype)initWithTableView:(UITableView *)tableView 38 | { 39 | return [self initWithTableView:tableView 40 | delegate:nil]; 41 | } 42 | 43 | - (instancetype)initWithTableView:(UITableView *)tableView delegate:(id)delegate 44 | { 45 | self = [super init]; 46 | if (self) { 47 | self.cellIdentifier = [NSString stringWithFormat:@"%@-Cell", NSStringFromClass(self.class)]; 48 | self.headerIdentifier = [NSString stringWithFormat:@"%@-Header", NSStringFromClass(self.class)]; 49 | self.footerIdentifier = [NSString stringWithFormat:@"%@-Footer", NSStringFromClass(self.class)]; 50 | self.tableView = tableView; 51 | self.delegate = delegate; 52 | 53 | [self registerWithTableView:tableView]; 54 | } 55 | return self; 56 | } 57 | 58 | - (NSInteger)numberOfItems 59 | { 60 | return 0; 61 | } 62 | 63 | - (CGFloat)heightForComponentHeader 64 | { 65 | return 0.f; 66 | } 67 | 68 | - (CGFloat)heightForComponentFooter 69 | { 70 | return CGFLOAT_MIN; 71 | } 72 | 73 | - (CGFloat)heightForComponentItemAtIndex:(NSUInteger)index 74 | { 75 | return 0.f; 76 | } 77 | 78 | - (__kindof UITableViewCell *)cellForTableView:(UITableView *)tableView 79 | atIndexPath:(NSIndexPath *)indexPath 80 | { 81 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:self.cellIdentifier 82 | forIndexPath:indexPath]; 83 | return cell; 84 | } 85 | 86 | - (__kindof UIView *)headerForTableView:(UITableView *)tableView 87 | { 88 | return nil; 89 | } 90 | 91 | - (__kindof UIView *)footerForTableView:(UITableView *)tableView 92 | { 93 | return nil; 94 | } 95 | 96 | - (void)didSelectItemAtIndex:(NSUInteger)index 97 | { 98 | if ([self.delegate respondsToSelector:@selector(tableComponent:didTapItemAtIndex:)]) { 99 | [self.delegate tableComponent:self 100 | didTapItemAtIndex:index]; 101 | } 102 | } 103 | 104 | - (void)reloadDataWithTableView:(UITableView *)tableView 105 | inSection:(NSInteger)section 106 | { 107 | 108 | } 109 | 110 | - (void)registerWithTableView:(UITableView *)tableView 111 | { 112 | [tableView registerClass:[UITableViewCell class] 113 | forCellReuseIdentifier:self.cellIdentifier]; 114 | } 115 | 116 | - (void)setNeedUpdateHeightForSection:(NSInteger)section 117 | { 118 | CFRunLoopObserverRef observer = CFRunLoopObserverCreateWithHandler(kCFAllocatorDefault, kCFRunLoopBeforeWaiting, NO, 0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) { 119 | [self.tableView reloadData]; 120 | }); 121 | CFRunLoopAddObserver(CFRunLoopGetMain(), observer, kCFRunLoopDefaultMode); 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTCollectionComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTCollectionComponent.h 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #import "RTActionHeaderComponent.h" 10 | 11 | @interface RTCollectionComponent : RTActionHeaderComponent 12 | @property (nonatomic, readonly, strong) UICollectionView *collectionView; 13 | 14 | - (void)configureCollectionView:(UICollectionView *)collectionView NS_REQUIRES_SUPER; 15 | 16 | - (CGRect)collectionViewRectForBounds:(CGRect)bounds; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTCollectionComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTCollectionComponent.m 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #import "RTCollectionComponent.h" 10 | 11 | @interface RTCollectionComponent () 12 | @property (nonatomic, strong) UICollectionView *collectionView; 13 | @end 14 | 15 | @implementation RTCollectionComponent 16 | 17 | - (instancetype)initWithTableView:(UITableView *)tableView 18 | delegate:(id)delegate 19 | { 20 | self = [super initWithTableView:tableView delegate:delegate]; 21 | if (self) { 22 | UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; 23 | layout.minimumInteritemSpacing = 8.f; 24 | layout.minimumLineSpacing = 8.f; 25 | layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; 26 | 27 | self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; 28 | 29 | [self configureCollectionView:self.collectionView]; 30 | 31 | self.collectionView.delegate = self; 32 | self.collectionView.dataSource = self; 33 | } 34 | return self; 35 | } 36 | 37 | #pragma mark - Overrides 38 | 39 | - (void)reloadDataWithTableView:(UITableView *)tableView 40 | forSection:(NSInteger)section 41 | { 42 | [self.collectionView reloadData]; 43 | } 44 | 45 | - (NSInteger)numberOfItems 46 | { 47 | return 1; 48 | } 49 | 50 | - (CGFloat)heightForComponentItemAtIndex:(NSUInteger)index 51 | { 52 | return 160.f; 53 | } 54 | 55 | - (void)didSelectItemAtIndex:(NSUInteger)index 56 | { 57 | // Override, no action 58 | } 59 | 60 | - (__kindof UITableViewCell *)cellForTableView:(UITableView *)tableView 61 | atIndexPath:(NSIndexPath *)indexPath 62 | { 63 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:self.cellIdentifier 64 | forIndexPath:indexPath]; 65 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 66 | self.collectionView.frame = [self collectionViewRectForBounds:cell.bounds]; 67 | [cell.contentView addSubview:self.collectionView]; 68 | return cell; 69 | } 70 | 71 | - (void)configureCollectionView:(UICollectionView *)collectionView 72 | { 73 | collectionView.contentInset = UIEdgeInsetsMake(8, 8, 8, 8); 74 | collectionView.backgroundColor = [UIColor clearColor]; 75 | collectionView.scrollsToTop = NO; 76 | 77 | [collectionView registerClass:[UICollectionViewCell class] 78 | forCellWithReuseIdentifier:@"Cell"]; 79 | } 80 | 81 | - (void)didDisplayCell:(__kindof UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath 82 | { 83 | self.collectionView.frame = [self collectionViewRectForBounds:cell.contentView.bounds]; 84 | } 85 | 86 | #pragma mark - Methods 87 | 88 | - (CGRect)collectionViewRectForBounds:(CGRect)bounds 89 | { 90 | return bounds; 91 | } 92 | 93 | #pragma mark - UICollection Datasource & Delegate 94 | 95 | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView 96 | { 97 | return 1; 98 | } 99 | 100 | - (NSInteger)collectionView:(UICollectionView *)collectionView 101 | numberOfItemsInSection:(NSInteger)section 102 | { 103 | return 0; 104 | } 105 | 106 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView 107 | cellForItemAtIndexPath:(NSIndexPath *)indexPath 108 | { 109 | UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" 110 | forIndexPath:indexPath]; 111 | 112 | return cell; 113 | } 114 | 115 | 116 | - (void)collectionView:(UICollectionView *)collectionView 117 | didSelectItemAtIndexPath:(NSIndexPath *)indexPath 118 | { 119 | if ([self.delegate respondsToSelector:@selector(tableComponent:didTapItemAtIndex:)]) { 120 | [self.delegate tableComponent:self 121 | didTapItemAtIndex:indexPath.item]; 122 | } 123 | } 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTHeaderComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTHeaderComponent.h 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #import "RTBaseComponent.h" 10 | 11 | @interface RTHeaderComponent : RTBaseComponent 12 | @property (nonatomic, copy) NSString *title; 13 | @property (nonatomic, strong) UIFont *titleFont; 14 | @property (nonatomic, strong) UIColor *titleColor; 15 | @property (nonatomic, strong) UIView *accessoryView; 16 | 17 | - (CGRect)accessoryRectForBounds:(CGRect)bounds; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTHeaderComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTHeaderComponent.m 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #import "RTHeaderComponent.h" 10 | 11 | @implementation RTHeaderComponent 12 | 13 | - (void)registerWithTableView:(UITableView *)tableView 14 | { 15 | [super registerWithTableView:tableView]; 16 | [tableView registerClass:[UITableViewHeaderFooterView class] 17 | forHeaderFooterViewReuseIdentifier:self.headerIdentifier]; 18 | } 19 | 20 | - (CGFloat)heightForComponentHeader 21 | { 22 | return 36.f; 23 | } 24 | 25 | - (__kindof UIView *)headerForTableView:(UITableView *)tableView 26 | { 27 | UITableViewHeaderFooterView *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:self.headerIdentifier]; 28 | header.textLabel.text = self.title; 29 | header.textLabel.textColor = self.titleColor ?: [UIColor darkGrayColor]; 30 | self.accessoryView.frame = [self accessoryRectForBounds:header.bounds]; 31 | [header.contentView addSubview:self.accessoryView]; 32 | return header; 33 | } 34 | 35 | - (void)willDisplayHeader:(__kindof UIView *)header 36 | { 37 | UITableViewHeaderFooterView *headerView = (UITableViewHeaderFooterView *)header; 38 | headerView.textLabel.font = self.titleFont ?: [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; 39 | self.accessoryView.frame = [self accessoryRectForBounds:header.bounds]; 40 | } 41 | 42 | - (CGRect)accessoryRectForBounds:(CGRect)bounds 43 | { 44 | CGSize size = [self.accessoryView sizeThatFits:bounds.size]; 45 | return CGRectMake(bounds.size.width - size.width - 8.f, (bounds.size.height - size.height) / 2, size.width, size.height); 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/Components/RTTableComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTTableComponent.h 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #import 10 | 11 | 12 | @protocol RTTableComponent; 13 | 14 | 15 | @protocol RTTableComponentDelegate 16 | @optional 17 | - (void)tableComponent:(id)component didTapItemAtIndex:(NSUInteger)index; 18 | @end 19 | 20 | 21 | 22 | @protocol RTTableComponent 23 | @required 24 | 25 | - (NSString *)cellIdentifier; 26 | - (NSString *)headerIdentifier; 27 | - (NSString *)footerIdentifier; 28 | 29 | - (NSInteger)numberOfItems; 30 | - (CGFloat)heightForComponentHeader; 31 | - (CGFloat)heightForComponentFooter; 32 | - (CGFloat)heightForComponentItemAtIndex:(NSUInteger)index; 33 | 34 | - (__kindof UITableViewCell *)cellForTableView:(UITableView *)tableView 35 | atIndexPath:(NSIndexPath *)indexPath; 36 | 37 | - (void)reloadDataWithTableView:(UITableView *)tableView 38 | inSection:(NSInteger)section; 39 | - (void)registerWithTableView:(UITableView *)tableView; 40 | 41 | @optional 42 | - (__kindof UIView *)headerForTableView:(UITableView *)tableView; 43 | - (__kindof UIView *)footerForTableView:(UITableView *)tableView; 44 | 45 | - (void)willDisplayHeader:(__kindof UIView *)header; 46 | - (void)willDisplayFooter:(__kindof UIView *)footer; 47 | - (void)willDisplayCell:(__kindof UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath; 48 | 49 | - (void)didSelectItemAtIndex:(NSUInteger)index; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/RTComponentController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTComponentTableView.h 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/18. 6 | // 7 | // 8 | 9 | #import 10 | #import "RTTableComponent.h" 11 | 12 | @interface RTComponentController : UIViewController 13 | @property (nonatomic, readonly, strong) UITableView *tableView; 14 | 15 | @property (nonatomic, strong) NSArray > *components; 16 | 17 | 18 | - (CGRect)tableViewRectForBounds:(CGRect)bounds; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/RTComponentController.m: -------------------------------------------------------------------------------- 1 | // 2 | // RTComponentTableView.m 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/18. 6 | // 7 | // 8 | 9 | #import "RTComponentController.h" 10 | 11 | #import "RTBaseComponent.h" 12 | 13 | @interface RTComponentController () 14 | @property (nonatomic, strong) UITableView *tableView; 15 | @end 16 | 17 | @implementation RTComponentController 18 | 19 | - (void)loadView 20 | { 21 | [super loadView]; 22 | [self.view addSubview:self.tableView]; 23 | } 24 | 25 | - (void)viewDidLoad 26 | { 27 | [super viewDidLoad]; 28 | } 29 | 30 | - (void)viewDidLayoutSubviews 31 | { 32 | [super viewDidLayoutSubviews]; 33 | self.tableView.frame = [self tableViewRectForBounds:self.view.bounds]; 34 | } 35 | 36 | - (UITableView *)tableView 37 | { 38 | if (!_tableView) { 39 | _tableView = [[UITableView alloc] initWithFrame:[self tableViewRectForBounds:self.view.bounds] 40 | style:UITableViewStylePlain]; 41 | _tableView.delegate = self; 42 | _tableView.dataSource = self; 43 | } 44 | return _tableView; 45 | } 46 | 47 | #pragma mark - Methods 48 | 49 | - (void)setComponents:(NSArray> *)components 50 | { 51 | if (_components != components) { 52 | _components = components; 53 | [self.tableView reloadData]; 54 | } 55 | } 56 | 57 | - (CGRect)tableViewRectForBounds:(CGRect)bounds 58 | { 59 | return bounds; 60 | } 61 | 62 | #pragma mark - UITableView Datasource & Delegate 63 | 64 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 65 | { 66 | return self.components.count; 67 | } 68 | 69 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 70 | { 71 | return self.components[section].numberOfItems; 72 | } 73 | 74 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 75 | { 76 | return self.components[section].heightForComponentHeader; 77 | } 78 | 79 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section 80 | { 81 | return self.components[section].heightForComponentHeader; 82 | } 83 | 84 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 85 | { 86 | return [self.components[indexPath.section] heightForComponentItemAtIndex:indexPath.row]; 87 | } 88 | 89 | - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath 90 | { 91 | return [self.components[indexPath.section] heightForComponentItemAtIndex:indexPath.row]; 92 | } 93 | 94 | - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 95 | { 96 | if ([self.components[section] respondsToSelector:@selector(headerForTableView:)]) { 97 | return [self.components[section] headerForTableView:tableView]; 98 | } 99 | return nil; 100 | } 101 | 102 | - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 103 | { 104 | if ([self.components[section] respondsToSelector:@selector(footerForTableView:)]) { 105 | return [self.components[section] footerForTableView:tableView]; 106 | } 107 | return nil; 108 | } 109 | 110 | - (UITableViewCell *)tableView:(UITableView *)tableView 111 | cellForRowAtIndexPath:(NSIndexPath *)indexPath 112 | { 113 | return [self.components[indexPath.section] cellForTableView:tableView atIndexPath:indexPath]; 114 | } 115 | 116 | - (void)tableView:(UITableView *)tableView 117 | willDisplayHeaderView:(UIView *)view 118 | forSection:(NSInteger)section 119 | { 120 | if ([self.components[section] respondsToSelector:@selector(willDisplayHeader:)]) { 121 | [self.components[section] willDisplayHeader:view]; 122 | } 123 | } 124 | 125 | - (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view 126 | forSection:(NSInteger)section 127 | { 128 | if ([self.components[section] respondsToSelector:@selector(willDisplayFooter:)]) { 129 | [self.components[section] willDisplayFooter:view]; 130 | } 131 | } 132 | 133 | - (void)tableView:(UITableView *)tableView 134 | willDisplayCell:(UITableViewCell *)cell 135 | forRowAtIndexPath:(NSIndexPath *)indexPath 136 | { 137 | if ([self.components[indexPath.section] respondsToSelector:@selector(willDisplayCell:forIndexPath:)]) { 138 | [self.components[indexPath.section] willDisplayCell:cell 139 | forIndexPath:indexPath]; 140 | } 141 | } 142 | 143 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 144 | { 145 | if ([self.components[indexPath.section] respondsToSelector:@selector(didSelectItemAtIndex:)]) { 146 | [self.components[indexPath.section] didSelectItemAtIndex:indexPath.row]; 147 | } 148 | } 149 | 150 | @end 151 | -------------------------------------------------------------------------------- /RTComponentTableView/Classes/RTComponentTableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // RTComponentTableView.h 3 | // Pods 4 | // 5 | // Created by ricky on 16/6/19. 6 | // 7 | // 8 | 9 | #ifndef RTComponentTableView_h 10 | #define RTComponentTableView_h 11 | 12 | #import "RTTableComponent.h" 13 | 14 | #import "RTBaseComponent.h" 15 | #import "RTHeaderComponent.h" 16 | #import "RTActionHeaderComponent.h" 17 | #import "RTCollectionComponent.h" 18 | 19 | #import "RTComponentController.h" 20 | 21 | 22 | #endif /* RTComponentTableView_h */ 23 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------