├── .gitignore ├── AutoPage.gif ├── AutoPagingFlowLayout.podspec ├── AutoPagingFlowLayout ├── Categories │ └── UIViewCategory.swift ├── Layouts │ └── WKAutomaticPagingFlowLayout.swift └── Other │ └── WKAutomaticPagingFlowLayoutConfigurator.swift ├── AutoPagingLayoutDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── wanghu.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── AutoPagingLayoutDemo.xcscheme │ └── xcschememanagement.plist ├── AutoPagingLayoutDemo ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── DemoCollectionViewController.swift ├── Info.plist └── ViewController.swift ├── AutoPagingLayoutDemoTests ├── AutoPagingLayoutDemoTests.swift └── Info.plist ├── AutoPagingLayoutDemoUITests ├── AutoPagingLayoutDemoUITests.swift └── Info.plist ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/screenshots 64 | -------------------------------------------------------------------------------- /AutoPage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hoowang/AutoPagingFlowLayout/81536e136b19f811e11b5ec83acabf3a64f5e478/AutoPage.gif -------------------------------------------------------------------------------- /AutoPagingFlowLayout.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'AutoPagingFlowLayout' 3 | s.version = '3.0' 4 | s.license = 'MIT' 5 | s.summary = 'an collectionView auto paging layout in Swift for iOS' 6 | s.homepage = 'https://github.com/hoowang/AutoPagingFlowLayout' 7 | s.authors = { 'hooge' => 'hoowang@126.com' } 8 | s.source = { :git => 'https://github.com/hoowang/AutoPagingFlowLayout.git', :tag => s.version } 9 | 10 | s.ios.deployment_target = '8.0' 11 | 12 | s.source_files = 'AutoPagingFlowLayout/**/*.swift' 13 | end -------------------------------------------------------------------------------- /AutoPagingFlowLayout/Categories/UIViewCategory.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewCategory.swift 3 | // CategorySwift 4 | // 5 | // Created by chunxi on 16/3/23. 6 | // Copyright © 2016年 chunxi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public extension UIView { 12 | 13 | var wk_Width: CGFloat { 14 | set { 15 | var frame: CGRect = self.frame 16 | frame.size.width = newValue 17 | self.frame = frame 18 | } 19 | get { 20 | return self.frame.size.width 21 | } 22 | } 23 | 24 | 25 | var wk_Height: CGFloat { 26 | set { 27 | var frame: CGRect = self.frame 28 | frame.size.height = newValue 29 | self.frame = frame 30 | } 31 | get { 32 | return self.frame.size.height 33 | } 34 | } 35 | 36 | var wk_Size: CGSize { 37 | set { 38 | var frame: CGRect = self.frame 39 | frame.size = newValue 40 | self.frame = frame 41 | } 42 | get { 43 | return self.frame.size 44 | } 45 | } 46 | 47 | var wk_Origin: CGPoint { 48 | set { 49 | var frame: CGRect = self.frame 50 | frame.origin = newValue 51 | self.frame = frame 52 | } 53 | get { 54 | return self.frame.origin 55 | } 56 | } 57 | 58 | 59 | var top: CGFloat { 60 | set { 61 | var frame: CGRect = self.frame 62 | frame.origin.y = newValue 63 | self.frame = frame 64 | } 65 | 66 | get { 67 | return self.frame.origin.y 68 | } 69 | } 70 | 71 | 72 | var left: CGFloat { 73 | set { 74 | var frame: CGRect = self.frame 75 | frame.origin.x = newValue 76 | self.frame = frame 77 | } 78 | 79 | get { 80 | return self.frame.origin.x 81 | } 82 | } 83 | 84 | 85 | var bottom: CGFloat { 86 | set { 87 | var frame: CGRect = self.frame 88 | frame.origin.y = newValue - frame.size.height 89 | self.frame = frame 90 | } 91 | get { 92 | return self.top + self.wk_Height 93 | } 94 | } 95 | 96 | 97 | var right: CGFloat { 98 | set{ 99 | var frame: CGRect = self.frame 100 | frame.origin.x = newValue - frame.size.width 101 | self.frame = frame 102 | } 103 | 104 | get{ 105 | return self.left + self.wk_Width 106 | } 107 | } 108 | 109 | } 110 | 111 | -------------------------------------------------------------------------------- /AutoPagingFlowLayout/Layouts/WKAutomaticPagingFlowLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WKAutomaticPagingFlowLayout.swift 3 | // WKChatViewControllerDemo 4 | // 5 | // Created by hooge on 16/4/6. 6 | // Copyright © 2016年 hoowang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class WKAutomaticPagingFlowLayout: UICollectionViewFlowLayout { 12 | // MARK: - 初始化部分 13 | fileprivate var flowLayoutCfg = WKAutomaticPagingFlowLayoutConfigurator() 14 | fileprivate var pageContentInsets:UIEdgeInsets { 15 | get{ 16 | return self.flowLayoutCfg.contentInsets 17 | } 18 | } 19 | 20 | public init(layoutConfigurator:WKAutomaticPagingFlowLayoutConfigurator) { 21 | super.init() 22 | //self.scrollDirection = layoutConfigurator.scrollDirection 23 | self.flowLayoutCfg = layoutConfigurator 24 | } 25 | 26 | required public init?(coder aDecoder: NSCoder) { 27 | fatalError("Does not support xib loading mode !!!") 28 | } 29 | } 30 | 31 | // MARK:- 私有方法 32 | extension WKAutomaticPagingFlowLayout{ 33 | fileprivate func numberOfItems() ->(Int){ 34 | let section = 0 35 | let numberOfItems = collectionView?.dataSource?.collectionView(collectionView!, numberOfItemsInSection: section) 36 | return numberOfItems! 37 | } 38 | 39 | fileprivate func pageSize() -> (CGSize){ 40 | return (collectionView?.bounds.size)! 41 | } 42 | 43 | fileprivate func avaliableSizePerPage() -> (CGSize){ 44 | 45 | var width:CGFloat = 0.0 46 | var height:CGFloat = 0.0 47 | 48 | width = pageSize().width - pageContentInsets.left - 49 | pageContentInsets.right 50 | height = pageSize().height - pageContentInsets.top - 51 | pageContentInsets.bottom 52 | 53 | 54 | return CGSize(width: width, height: height) 55 | } 56 | 57 | //一行有多少列 58 | fileprivate func numberOfItemsPerRow() -> (Int){ 59 | return self.flowLayoutCfg.columnCountOfRow 60 | } 61 | 62 | // 一页有多少行 63 | fileprivate func numberOfRowsPerPage() -> (Int){ 64 | return self.flowLayoutCfg.rowCountOfPage 65 | } 66 | 67 | // 一页的总数 68 | fileprivate func numberOfItemsPerPage() -> (Int){ 69 | return numberOfItemsPerRow() * numberOfRowsPerPage() 70 | } 71 | 72 | // item frame 计算 73 | fileprivate func calcItemFrameWithIndexPath(_ indexPath:IndexPath) ->(CGRect){ 74 | let index = indexPath.row 75 | let page = floor( CGFloat(index) / CGFloat(self.numberOfItemsPerPage())) 76 | let row = floor( CGFloat(index % self.numberOfItemsPerPage()) / CGFloat(self.numberOfItemsPerRow())) 77 | 78 | let n = index % self.numberOfItemsPerRow() 79 | var x:CGFloat = 0.0; 80 | var y:CGFloat = 0.0; 81 | var width:CGFloat = 0.0; 82 | var height:CGFloat = 0.0; 83 | 84 | if (0 == self.flowLayoutCfg.cellSize.width) { 85 | width = 86 | (self.collectionView!.wk_Width - 2 * self.pageContentInsets.left - 87 | CGFloat(self.numberOfItemsPerRow() - 1) * flowLayoutCfg.columnSpacing) / 88 | CGFloat(self.numberOfItemsPerRow()) 89 | 90 | height = (self.flowLayoutCfg.cellSize.height != 0) ? (self.flowLayoutCfg.cellSize.height): 91 | ((self.collectionView!.wk_Height - 2 * self.pageContentInsets.bottom - 92 | CGFloat(self.flowLayoutCfg.rowCountOfPage - 1) * self.flowLayoutCfg.lineSpacing) / 93 | CGFloat(self.flowLayoutCfg.rowCountOfPage)) 94 | 95 | x = page * self.pageSize().width + self.pageContentInsets.left 96 | + CGFloat(n) * (width + self.flowLayoutCfg.columnSpacing) 97 | 98 | y = self.pageContentInsets.top + 99 | row * (height + self.flowLayoutCfg.lineSpacing) 100 | let frame = CGRect(x: x, y: y, width: width, height: height) 101 | 102 | return frame 103 | } 104 | 105 | x = page * self.pageSize().width + self.pageContentInsets.left + 106 | CGFloat(n) * (self.flowLayoutCfg.cellSize.width + self.flowLayoutCfg.columnSpacing) 107 | 108 | y = self.pageContentInsets.top + 109 | row * (self.flowLayoutCfg.cellSize.height + self.flowLayoutCfg.lineSpacing) 110 | 111 | width = self.flowLayoutCfg.cellSize.width 112 | height = self.flowLayoutCfg.cellSize.height 113 | 114 | return CGRect(x: x, y: y, width: width, height: height) 115 | } 116 | } 117 | 118 | // MARK: - 重写父类方法 119 | extension WKAutomaticPagingFlowLayout{ 120 | override open func layoutAttributesForItem(at indexPath: IndexPath) -> UICollectionViewLayoutAttributes? { 121 | let attributes = UICollectionViewLayoutAttributes(forCellWith:indexPath) 122 | attributes.frame = calcItemFrameWithIndexPath(indexPath) 123 | 124 | return attributes 125 | } 126 | 127 | override open func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { 128 | guard self.numberOfItems() > 0 else { 129 | 130 | return super.layoutAttributesForElements(in: rect) 131 | } 132 | var attributeArray = [UICollectionViewLayoutAttributes]() 133 | for i in 0...self.numberOfItems() - 1 { 134 | let attributes = 135 | layoutAttributesForItem(at: IndexPath(row: i, section: 0)) 136 | if rect.intersects((attributes?.frame)!) { 137 | attributeArray.append(attributes!) 138 | } 139 | } 140 | 141 | return attributeArray 142 | } 143 | 144 | override open func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { 145 | if (collectionView!.bounds.size.equalTo(newBounds.size)) { 146 | return false 147 | }else{ 148 | return true 149 | } 150 | } 151 | 152 | open override var collectionViewContentSize : (CGSize){ 153 | //super.collectionViewContentSize() 154 | let items:CGFloat = CGFloat(numberOfItems()) 155 | let perPageItems:CGFloat = CGFloat(numberOfItemsPerPage()) 156 | var width:CGFloat = 0.0 157 | var height:CGFloat = 0.0 158 | width = ceil(items / perPageItems) * pageSize().width 159 | height = pageSize().height 160 | return CGSize(width: width, height: height) 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /AutoPagingFlowLayout/Other/WKAutomaticPagingFlowLayoutConfigurator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WKAutomaticPagingFlowLayoutConfigurator.swift 3 | // WKChatViewControllerDemo 4 | // 5 | // Created by hooge on 16/4/6. 6 | // Copyright © 2016年 hoowang. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class WKAutomaticPagingFlowLayoutConfigurator : NSObject{ 12 | open var lineSpacing:CGFloat = 0.0 // 行间距 13 | open var columnSpacing:CGFloat = 0.0 // 列间距 14 | open var rowCountOfPage:Int = 0 // 一页有多少行 15 | open var columnCountOfRow:Int = 0 // 一行有多少列 16 | open var cellSize = CGSize.zero 17 | open var contentInsets:UIEdgeInsets = UIEdgeInsets.zero //contentView 外边距 18 | } 19 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 79FE89CB1CEEDAFA00DFA77F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE89CA1CEEDAFA00DFA77F /* AppDelegate.swift */; }; 11 | 79FE89CD1CEEDAFA00DFA77F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE89CC1CEEDAFA00DFA77F /* ViewController.swift */; }; 12 | 79FE89D01CEEDAFA00DFA77F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 79FE89CE1CEEDAFA00DFA77F /* Main.storyboard */; }; 13 | 79FE89D21CEEDAFA00DFA77F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 79FE89D11CEEDAFA00DFA77F /* Assets.xcassets */; }; 14 | 79FE89D51CEEDAFA00DFA77F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 79FE89D31CEEDAFA00DFA77F /* LaunchScreen.storyboard */; }; 15 | 79FE89E01CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE89DF1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.swift */; }; 16 | 79FE89EB1CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE89EA1CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.swift */; }; 17 | 79FE89FD1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE89FA1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayout.swift */; }; 18 | 79FE89FE1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayoutConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE89FC1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayoutConfigurator.swift */; }; 19 | 79FE8A011CEEDC1200DFA77F /* UIViewCategory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE8A001CEEDC1200DFA77F /* UIViewCategory.swift */; }; 20 | 79FE8A031CEEE26000DFA77F /* DemoCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79FE8A021CEEE26000DFA77F /* DemoCollectionViewController.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | 79FE89DC1CEEDAFB00DFA77F /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = 79FE89BF1CEEDAFA00DFA77F /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = 79FE89C61CEEDAFA00DFA77F; 29 | remoteInfo = AutoPagingLayoutDemo; 30 | }; 31 | 79FE89E71CEEDAFB00DFA77F /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 79FE89BF1CEEDAFA00DFA77F /* Project object */; 34 | proxyType = 1; 35 | remoteGlobalIDString = 79FE89C61CEEDAFA00DFA77F; 36 | remoteInfo = AutoPagingLayoutDemo; 37 | }; 38 | /* End PBXContainerItemProxy section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 79FE89C71CEEDAFA00DFA77F /* AutoPagingLayoutDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AutoPagingLayoutDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 79FE89CA1CEEDAFA00DFA77F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 43 | 79FE89CC1CEEDAFA00DFA77F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 44 | 79FE89CF1CEEDAFA00DFA77F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 79FE89D11CEEDAFA00DFA77F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 79FE89D41CEEDAFA00DFA77F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 79FE89D61CEEDAFA00DFA77F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 79FE89DB1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AutoPagingLayoutDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 79FE89DF1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoPagingLayoutDemoTests.swift; sourceTree = ""; }; 50 | 79FE89E11CEEDAFB00DFA77F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 79FE89E61CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AutoPagingLayoutDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 79FE89EA1CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoPagingLayoutDemoUITests.swift; sourceTree = ""; }; 53 | 79FE89EC1CEEDAFB00DFA77F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 79FE89FA1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WKAutomaticPagingFlowLayout.swift; sourceTree = ""; }; 55 | 79FE89FC1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayoutConfigurator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WKAutomaticPagingFlowLayoutConfigurator.swift; sourceTree = ""; }; 56 | 79FE8A001CEEDC1200DFA77F /* UIViewCategory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIViewCategory.swift; sourceTree = ""; }; 57 | 79FE8A021CEEE26000DFA77F /* DemoCollectionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DemoCollectionViewController.swift; sourceTree = ""; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 79FE89C41CEEDAFA00DFA77F /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | 79FE89D81CEEDAFB00DFA77F /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | 79FE89E31CEEDAFB00DFA77F /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 79FE89BE1CEEDAFA00DFA77F = { 86 | isa = PBXGroup; 87 | children = ( 88 | 79FE89F81CEEDBAF00DFA77F /* AutoPagingFlowLayout */, 89 | 79FE89C91CEEDAFA00DFA77F /* AutoPagingLayoutDemo */, 90 | 79FE89DE1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests */, 91 | 79FE89E91CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests */, 92 | 79FE89C81CEEDAFA00DFA77F /* Products */, 93 | ); 94 | sourceTree = ""; 95 | }; 96 | 79FE89C81CEEDAFA00DFA77F /* Products */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 79FE89C71CEEDAFA00DFA77F /* AutoPagingLayoutDemo.app */, 100 | 79FE89DB1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.xctest */, 101 | 79FE89E61CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.xctest */, 102 | ); 103 | name = Products; 104 | sourceTree = ""; 105 | }; 106 | 79FE89C91CEEDAFA00DFA77F /* AutoPagingLayoutDemo */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 79FE89CA1CEEDAFA00DFA77F /* AppDelegate.swift */, 110 | 79FE89CC1CEEDAFA00DFA77F /* ViewController.swift */, 111 | 79FE89CE1CEEDAFA00DFA77F /* Main.storyboard */, 112 | 79FE89D11CEEDAFA00DFA77F /* Assets.xcassets */, 113 | 79FE89D31CEEDAFA00DFA77F /* LaunchScreen.storyboard */, 114 | 79FE89D61CEEDAFA00DFA77F /* Info.plist */, 115 | 79FE8A021CEEE26000DFA77F /* DemoCollectionViewController.swift */, 116 | ); 117 | path = AutoPagingLayoutDemo; 118 | sourceTree = ""; 119 | }; 120 | 79FE89DE1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 79FE89DF1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.swift */, 124 | 79FE89E11CEEDAFB00DFA77F /* Info.plist */, 125 | ); 126 | path = AutoPagingLayoutDemoTests; 127 | sourceTree = ""; 128 | }; 129 | 79FE89E91CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 79FE89EA1CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.swift */, 133 | 79FE89EC1CEEDAFB00DFA77F /* Info.plist */, 134 | ); 135 | path = AutoPagingLayoutDemoUITests; 136 | sourceTree = ""; 137 | }; 138 | 79FE89F81CEEDBAF00DFA77F /* AutoPagingFlowLayout */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 79FE89FF1CEEDC1200DFA77F /* Categories */, 142 | 79FE89F91CEEDBAF00DFA77F /* Layouts */, 143 | 79FE89FB1CEEDBAF00DFA77F /* Other */, 144 | ); 145 | path = AutoPagingFlowLayout; 146 | sourceTree = ""; 147 | }; 148 | 79FE89F91CEEDBAF00DFA77F /* Layouts */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 79FE89FA1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayout.swift */, 152 | ); 153 | path = Layouts; 154 | sourceTree = ""; 155 | }; 156 | 79FE89FB1CEEDBAF00DFA77F /* Other */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | 79FE89FC1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayoutConfigurator.swift */, 160 | ); 161 | path = Other; 162 | sourceTree = ""; 163 | }; 164 | 79FE89FF1CEEDC1200DFA77F /* Categories */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 79FE8A001CEEDC1200DFA77F /* UIViewCategory.swift */, 168 | ); 169 | path = Categories; 170 | sourceTree = ""; 171 | }; 172 | /* End PBXGroup section */ 173 | 174 | /* Begin PBXNativeTarget section */ 175 | 79FE89C61CEEDAFA00DFA77F /* AutoPagingLayoutDemo */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 79FE89EF1CEEDAFB00DFA77F /* Build configuration list for PBXNativeTarget "AutoPagingLayoutDemo" */; 178 | buildPhases = ( 179 | 79FE89C31CEEDAFA00DFA77F /* Sources */, 180 | 79FE89C41CEEDAFA00DFA77F /* Frameworks */, 181 | 79FE89C51CEEDAFA00DFA77F /* Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | ); 187 | name = AutoPagingLayoutDemo; 188 | productName = AutoPagingLayoutDemo; 189 | productReference = 79FE89C71CEEDAFA00DFA77F /* AutoPagingLayoutDemo.app */; 190 | productType = "com.apple.product-type.application"; 191 | }; 192 | 79FE89DA1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests */ = { 193 | isa = PBXNativeTarget; 194 | buildConfigurationList = 79FE89F21CEEDAFB00DFA77F /* Build configuration list for PBXNativeTarget "AutoPagingLayoutDemoTests" */; 195 | buildPhases = ( 196 | 79FE89D71CEEDAFB00DFA77F /* Sources */, 197 | 79FE89D81CEEDAFB00DFA77F /* Frameworks */, 198 | 79FE89D91CEEDAFB00DFA77F /* Resources */, 199 | ); 200 | buildRules = ( 201 | ); 202 | dependencies = ( 203 | 79FE89DD1CEEDAFB00DFA77F /* PBXTargetDependency */, 204 | ); 205 | name = AutoPagingLayoutDemoTests; 206 | productName = AutoPagingLayoutDemoTests; 207 | productReference = 79FE89DB1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.xctest */; 208 | productType = "com.apple.product-type.bundle.unit-test"; 209 | }; 210 | 79FE89E51CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = 79FE89F51CEEDAFB00DFA77F /* Build configuration list for PBXNativeTarget "AutoPagingLayoutDemoUITests" */; 213 | buildPhases = ( 214 | 79FE89E21CEEDAFB00DFA77F /* Sources */, 215 | 79FE89E31CEEDAFB00DFA77F /* Frameworks */, 216 | 79FE89E41CEEDAFB00DFA77F /* Resources */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | 79FE89E81CEEDAFB00DFA77F /* PBXTargetDependency */, 222 | ); 223 | name = AutoPagingLayoutDemoUITests; 224 | productName = AutoPagingLayoutDemoUITests; 225 | productReference = 79FE89E61CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.xctest */; 226 | productType = "com.apple.product-type.bundle.ui-testing"; 227 | }; 228 | /* End PBXNativeTarget section */ 229 | 230 | /* Begin PBXProject section */ 231 | 79FE89BF1CEEDAFA00DFA77F /* Project object */ = { 232 | isa = PBXProject; 233 | attributes = { 234 | LastSwiftUpdateCheck = 0730; 235 | LastUpgradeCheck = 0920; 236 | ORGANIZATIONNAME = hooge; 237 | TargetAttributes = { 238 | 79FE89C61CEEDAFA00DFA77F = { 239 | CreatedOnToolsVersion = 7.3.1; 240 | LastSwiftMigration = 0920; 241 | }; 242 | 79FE89DA1CEEDAFB00DFA77F = { 243 | CreatedOnToolsVersion = 7.3.1; 244 | LastSwiftMigration = 0920; 245 | TestTargetID = 79FE89C61CEEDAFA00DFA77F; 246 | }; 247 | 79FE89E51CEEDAFB00DFA77F = { 248 | CreatedOnToolsVersion = 7.3.1; 249 | LastSwiftMigration = 0920; 250 | TestTargetID = 79FE89C61CEEDAFA00DFA77F; 251 | }; 252 | }; 253 | }; 254 | buildConfigurationList = 79FE89C21CEEDAFA00DFA77F /* Build configuration list for PBXProject "AutoPagingLayoutDemo" */; 255 | compatibilityVersion = "Xcode 3.2"; 256 | developmentRegion = English; 257 | hasScannedForEncodings = 0; 258 | knownRegions = ( 259 | en, 260 | Base, 261 | ); 262 | mainGroup = 79FE89BE1CEEDAFA00DFA77F; 263 | productRefGroup = 79FE89C81CEEDAFA00DFA77F /* Products */; 264 | projectDirPath = ""; 265 | projectRoot = ""; 266 | targets = ( 267 | 79FE89C61CEEDAFA00DFA77F /* AutoPagingLayoutDemo */, 268 | 79FE89DA1CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests */, 269 | 79FE89E51CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests */, 270 | ); 271 | }; 272 | /* End PBXProject section */ 273 | 274 | /* Begin PBXResourcesBuildPhase section */ 275 | 79FE89C51CEEDAFA00DFA77F /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 79FE89D51CEEDAFA00DFA77F /* LaunchScreen.storyboard in Resources */, 280 | 79FE89D21CEEDAFA00DFA77F /* Assets.xcassets in Resources */, 281 | 79FE89D01CEEDAFA00DFA77F /* Main.storyboard in Resources */, 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | 79FE89D91CEEDAFB00DFA77F /* Resources */ = { 286 | isa = PBXResourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | 79FE89E41CEEDAFB00DFA77F /* Resources */ = { 293 | isa = PBXResourcesBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | /* End PBXResourcesBuildPhase section */ 300 | 301 | /* Begin PBXSourcesBuildPhase section */ 302 | 79FE89C31CEEDAFA00DFA77F /* Sources */ = { 303 | isa = PBXSourcesBuildPhase; 304 | buildActionMask = 2147483647; 305 | files = ( 306 | 79FE89FE1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayoutConfigurator.swift in Sources */, 307 | 79FE8A011CEEDC1200DFA77F /* UIViewCategory.swift in Sources */, 308 | 79FE89CD1CEEDAFA00DFA77F /* ViewController.swift in Sources */, 309 | 79FE89CB1CEEDAFA00DFA77F /* AppDelegate.swift in Sources */, 310 | 79FE89FD1CEEDBAF00DFA77F /* WKAutomaticPagingFlowLayout.swift in Sources */, 311 | 79FE8A031CEEE26000DFA77F /* DemoCollectionViewController.swift in Sources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | 79FE89D71CEEDAFB00DFA77F /* Sources */ = { 316 | isa = PBXSourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | 79FE89E01CEEDAFB00DFA77F /* AutoPagingLayoutDemoTests.swift in Sources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | 79FE89E21CEEDAFB00DFA77F /* Sources */ = { 324 | isa = PBXSourcesBuildPhase; 325 | buildActionMask = 2147483647; 326 | files = ( 327 | 79FE89EB1CEEDAFB00DFA77F /* AutoPagingLayoutDemoUITests.swift in Sources */, 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | }; 331 | /* End PBXSourcesBuildPhase section */ 332 | 333 | /* Begin PBXTargetDependency section */ 334 | 79FE89DD1CEEDAFB00DFA77F /* PBXTargetDependency */ = { 335 | isa = PBXTargetDependency; 336 | target = 79FE89C61CEEDAFA00DFA77F /* AutoPagingLayoutDemo */; 337 | targetProxy = 79FE89DC1CEEDAFB00DFA77F /* PBXContainerItemProxy */; 338 | }; 339 | 79FE89E81CEEDAFB00DFA77F /* PBXTargetDependency */ = { 340 | isa = PBXTargetDependency; 341 | target = 79FE89C61CEEDAFA00DFA77F /* AutoPagingLayoutDemo */; 342 | targetProxy = 79FE89E71CEEDAFB00DFA77F /* PBXContainerItemProxy */; 343 | }; 344 | /* End PBXTargetDependency section */ 345 | 346 | /* Begin PBXVariantGroup section */ 347 | 79FE89CE1CEEDAFA00DFA77F /* Main.storyboard */ = { 348 | isa = PBXVariantGroup; 349 | children = ( 350 | 79FE89CF1CEEDAFA00DFA77F /* Base */, 351 | ); 352 | name = Main.storyboard; 353 | sourceTree = ""; 354 | }; 355 | 79FE89D31CEEDAFA00DFA77F /* LaunchScreen.storyboard */ = { 356 | isa = PBXVariantGroup; 357 | children = ( 358 | 79FE89D41CEEDAFA00DFA77F /* Base */, 359 | ); 360 | name = LaunchScreen.storyboard; 361 | sourceTree = ""; 362 | }; 363 | /* End PBXVariantGroup section */ 364 | 365 | /* Begin XCBuildConfiguration section */ 366 | 79FE89ED1CEEDAFB00DFA77F /* Debug */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ALWAYS_SEARCH_USER_PATHS = NO; 370 | CLANG_ANALYZER_NONNULL = YES; 371 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 372 | CLANG_CXX_LIBRARY = "libc++"; 373 | CLANG_ENABLE_MODULES = YES; 374 | CLANG_ENABLE_OBJC_ARC = YES; 375 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 376 | CLANG_WARN_BOOL_CONVERSION = YES; 377 | CLANG_WARN_COMMA = YES; 378 | CLANG_WARN_CONSTANT_CONVERSION = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 386 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 387 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 388 | CLANG_WARN_STRICT_PROTOTYPES = YES; 389 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 390 | CLANG_WARN_UNREACHABLE_CODE = YES; 391 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 392 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 393 | COPY_PHASE_STRIP = NO; 394 | DEBUG_INFORMATION_FORMAT = dwarf; 395 | ENABLE_STRICT_OBJC_MSGSEND = YES; 396 | ENABLE_TESTABILITY = YES; 397 | GCC_C_LANGUAGE_STANDARD = gnu99; 398 | GCC_DYNAMIC_NO_PIC = NO; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_OPTIMIZATION_LEVEL = 0; 401 | GCC_PREPROCESSOR_DEFINITIONS = ( 402 | "DEBUG=1", 403 | "$(inherited)", 404 | ); 405 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 406 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 407 | GCC_WARN_UNDECLARED_SELECTOR = YES; 408 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 409 | GCC_WARN_UNUSED_FUNCTION = YES; 410 | GCC_WARN_UNUSED_VARIABLE = YES; 411 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 412 | MTL_ENABLE_DEBUG_INFO = YES; 413 | ONLY_ACTIVE_ARCH = YES; 414 | SDKROOT = iphoneos; 415 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 416 | TARGETED_DEVICE_FAMILY = "1,2"; 417 | }; 418 | name = Debug; 419 | }; 420 | 79FE89EE1CEEDAFB00DFA77F /* Release */ = { 421 | isa = XCBuildConfiguration; 422 | buildSettings = { 423 | ALWAYS_SEARCH_USER_PATHS = NO; 424 | CLANG_ANALYZER_NONNULL = YES; 425 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 426 | CLANG_CXX_LIBRARY = "libc++"; 427 | CLANG_ENABLE_MODULES = YES; 428 | CLANG_ENABLE_OBJC_ARC = YES; 429 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 430 | CLANG_WARN_BOOL_CONVERSION = YES; 431 | CLANG_WARN_COMMA = YES; 432 | CLANG_WARN_CONSTANT_CONVERSION = YES; 433 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 434 | CLANG_WARN_EMPTY_BODY = YES; 435 | CLANG_WARN_ENUM_CONVERSION = YES; 436 | CLANG_WARN_INFINITE_RECURSION = YES; 437 | CLANG_WARN_INT_CONVERSION = YES; 438 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 439 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 440 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 441 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 442 | CLANG_WARN_STRICT_PROTOTYPES = YES; 443 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 444 | CLANG_WARN_UNREACHABLE_CODE = YES; 445 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 446 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 447 | COPY_PHASE_STRIP = NO; 448 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 449 | ENABLE_NS_ASSERTIONS = NO; 450 | ENABLE_STRICT_OBJC_MSGSEND = YES; 451 | GCC_C_LANGUAGE_STANDARD = gnu99; 452 | GCC_NO_COMMON_BLOCKS = YES; 453 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 454 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 455 | GCC_WARN_UNDECLARED_SELECTOR = YES; 456 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 457 | GCC_WARN_UNUSED_FUNCTION = YES; 458 | GCC_WARN_UNUSED_VARIABLE = YES; 459 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 460 | MTL_ENABLE_DEBUG_INFO = NO; 461 | SDKROOT = iphoneos; 462 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 463 | TARGETED_DEVICE_FAMILY = "1,2"; 464 | VALIDATE_PRODUCT = YES; 465 | }; 466 | name = Release; 467 | }; 468 | 79FE89F01CEEDAFB00DFA77F /* Debug */ = { 469 | isa = XCBuildConfiguration; 470 | buildSettings = { 471 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 472 | INFOPLIST_FILE = AutoPagingLayoutDemo/Info.plist; 473 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 474 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 475 | PRODUCT_BUNDLE_IDENTIFIER = hooge.AutoPagingLayoutDemo; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | SWIFT_VERSION = 4.0; 478 | }; 479 | name = Debug; 480 | }; 481 | 79FE89F11CEEDAFB00DFA77F /* Release */ = { 482 | isa = XCBuildConfiguration; 483 | buildSettings = { 484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 485 | INFOPLIST_FILE = AutoPagingLayoutDemo/Info.plist; 486 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 487 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 488 | PRODUCT_BUNDLE_IDENTIFIER = hooge.AutoPagingLayoutDemo; 489 | PRODUCT_NAME = "$(TARGET_NAME)"; 490 | SWIFT_VERSION = 4.0; 491 | }; 492 | name = Release; 493 | }; 494 | 79FE89F31CEEDAFB00DFA77F /* Debug */ = { 495 | isa = XCBuildConfiguration; 496 | buildSettings = { 497 | BUNDLE_LOADER = "$(TEST_HOST)"; 498 | INFOPLIST_FILE = AutoPagingLayoutDemoTests/Info.plist; 499 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 500 | PRODUCT_BUNDLE_IDENTIFIER = hooge.AutoPagingLayoutDemoTests; 501 | PRODUCT_NAME = "$(TARGET_NAME)"; 502 | SWIFT_VERSION = 4.0; 503 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AutoPagingLayoutDemo.app/AutoPagingLayoutDemo"; 504 | }; 505 | name = Debug; 506 | }; 507 | 79FE89F41CEEDAFB00DFA77F /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | buildSettings = { 510 | BUNDLE_LOADER = "$(TEST_HOST)"; 511 | INFOPLIST_FILE = AutoPagingLayoutDemoTests/Info.plist; 512 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 513 | PRODUCT_BUNDLE_IDENTIFIER = hooge.AutoPagingLayoutDemoTests; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | SWIFT_VERSION = 4.0; 516 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AutoPagingLayoutDemo.app/AutoPagingLayoutDemo"; 517 | }; 518 | name = Release; 519 | }; 520 | 79FE89F61CEEDAFB00DFA77F /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | INFOPLIST_FILE = AutoPagingLayoutDemoUITests/Info.plist; 524 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 525 | PRODUCT_BUNDLE_IDENTIFIER = hooge.AutoPagingLayoutDemoUITests; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | SWIFT_VERSION = 4.0; 528 | TEST_TARGET_NAME = AutoPagingLayoutDemo; 529 | }; 530 | name = Debug; 531 | }; 532 | 79FE89F71CEEDAFB00DFA77F /* Release */ = { 533 | isa = XCBuildConfiguration; 534 | buildSettings = { 535 | INFOPLIST_FILE = AutoPagingLayoutDemoUITests/Info.plist; 536 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 537 | PRODUCT_BUNDLE_IDENTIFIER = hooge.AutoPagingLayoutDemoUITests; 538 | PRODUCT_NAME = "$(TARGET_NAME)"; 539 | SWIFT_VERSION = 4.0; 540 | TEST_TARGET_NAME = AutoPagingLayoutDemo; 541 | }; 542 | name = Release; 543 | }; 544 | /* End XCBuildConfiguration section */ 545 | 546 | /* Begin XCConfigurationList section */ 547 | 79FE89C21CEEDAFA00DFA77F /* Build configuration list for PBXProject "AutoPagingLayoutDemo" */ = { 548 | isa = XCConfigurationList; 549 | buildConfigurations = ( 550 | 79FE89ED1CEEDAFB00DFA77F /* Debug */, 551 | 79FE89EE1CEEDAFB00DFA77F /* Release */, 552 | ); 553 | defaultConfigurationIsVisible = 0; 554 | defaultConfigurationName = Release; 555 | }; 556 | 79FE89EF1CEEDAFB00DFA77F /* Build configuration list for PBXNativeTarget "AutoPagingLayoutDemo" */ = { 557 | isa = XCConfigurationList; 558 | buildConfigurations = ( 559 | 79FE89F01CEEDAFB00DFA77F /* Debug */, 560 | 79FE89F11CEEDAFB00DFA77F /* Release */, 561 | ); 562 | defaultConfigurationIsVisible = 0; 563 | defaultConfigurationName = Release; 564 | }; 565 | 79FE89F21CEEDAFB00DFA77F /* Build configuration list for PBXNativeTarget "AutoPagingLayoutDemoTests" */ = { 566 | isa = XCConfigurationList; 567 | buildConfigurations = ( 568 | 79FE89F31CEEDAFB00DFA77F /* Debug */, 569 | 79FE89F41CEEDAFB00DFA77F /* Release */, 570 | ); 571 | defaultConfigurationIsVisible = 0; 572 | defaultConfigurationName = Release; 573 | }; 574 | 79FE89F51CEEDAFB00DFA77F /* Build configuration list for PBXNativeTarget "AutoPagingLayoutDemoUITests" */ = { 575 | isa = XCConfigurationList; 576 | buildConfigurations = ( 577 | 79FE89F61CEEDAFB00DFA77F /* Debug */, 578 | 79FE89F71CEEDAFB00DFA77F /* Release */, 579 | ); 580 | defaultConfigurationIsVisible = 0; 581 | defaultConfigurationName = Release; 582 | }; 583 | /* End XCConfigurationList section */ 584 | }; 585 | rootObject = 79FE89BF1CEEDAFA00DFA77F /* Project object */; 586 | } 587 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo.xcodeproj/xcuserdata/wanghu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo.xcodeproj/xcuserdata/wanghu.xcuserdatad/xcschemes/AutoPagingLayoutDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo.xcodeproj/xcuserdata/wanghu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | AutoPagingLayoutDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 79FE89C61CEEDAFA00DFA77F 16 | 17 | primary 18 | 19 | 20 | 79FE89DA1CEEDAFB00DFA77F 21 | 22 | primary 23 | 24 | 25 | 79FE89E51CEEDAFB00DFA77F 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // AutoPagingLayoutDemo 4 | // 5 | // Created by hooge on 16/5/20. 6 | // Copyright © 2016年 hooge. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 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 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo/Assets.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 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /AutoPagingLayoutDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo/DemoCollectionViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DemoCollectionViewController.swift 3 | // AutoPagingLayoutDemo 4 | // 5 | // Created by hooge on 16/5/20. 6 | // Copyright © 2016年 hooge. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | private let reuseIdentifier = "Cell" 12 | 13 | class DemoCollectionViewController: UIViewController { 14 | fileprivate var matrix:(rowCount:Int, columnCount:Int) = (0, 0) 15 | fileprivate let colors = [UIColor.red, UIColor.magenta, UIColor.green, UIColor.black, UIColor.purple,UIColor.cyan, UIColor.brown, UIColor.darkGray, UIColor.yellow, UIColor.orange, UIColor.gray, UIColor.blue, UIColor.lightGray, UIColor.magenta, UIColor(red:0.45, green: 0.33, blue: 0.30, alpha: 0.78), UIColor(red:0.48, green: 0.941, blue: 0.351, alpha: 0.66)] 16 | init(matrix:(rowCount:Int, columnCount:Int)){ 17 | super.init(nibName: nil, bundle: nil) 18 | self.matrix = matrix 19 | 20 | } 21 | 22 | required init?(coder aDecoder: NSCoder) { 23 | fatalError("init(coder:) has not been implemented") 24 | } 25 | 26 | override func viewDidLoad() { 27 | super.viewDidLoad() 28 | self.view.backgroundColor = UIColor.white 29 | 30 | self.automaticallyAdjustsScrollViewInsets = false 31 | let configurator = WKAutomaticPagingFlowLayoutConfigurator() 32 | configurator.columnCountOfRow = self.matrix.columnCount 33 | configurator.rowCountOfPage = self.matrix.rowCount 34 | configurator.contentInsets = UIEdgeInsetsMake(10, 10, 10, 10) 35 | configurator.columnSpacing = 5 36 | configurator.lineSpacing = 5 37 | let layout = WKAutomaticPagingFlowLayout(layoutConfigurator: configurator) 38 | let collectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout:layout) 39 | collectionView.isPagingEnabled = true 40 | var width:CGFloat = 0 41 | var height:CGFloat = 0 42 | width = CGFloat(self.matrix.columnCount) * 100 43 | height = CGFloat(self.matrix.rowCount) * 100 44 | collectionView.wk_Size = CGSize(width: width, height: height) 45 | collectionView.center = self.view.center 46 | collectionView.backgroundColor = UIColor(red: 0.675, green: 0.176, blue: 0.452, alpha: 0.83) 47 | self.view.addSubview(collectionView) 48 | collectionView.dataSource = self 49 | collectionView.register(UICollectionViewCell.classForCoder(), forCellWithReuseIdentifier: reuseIdentifier) 50 | } 51 | 52 | 53 | } 54 | 55 | extension DemoCollectionViewController:UICollectionViewDataSource{ 56 | 57 | 58 | 59 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 60 | 61 | return 300 62 | } 63 | 64 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 65 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) 66 | 67 | var itemIndex:Int = indexPath.row 68 | 69 | if indexPath.row > self.colors.count - 1 { 70 | itemIndex = itemIndex % 10 71 | } 72 | cell.backgroundColor = self.colors[itemIndex] 73 | 74 | 75 | return cell 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // AutoPagingLayoutDemo 4 | // 5 | // Created by hooge on 16/5/20. 6 | // Copyright © 2016年 hooge. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UITableViewController { 12 | let demoCell = "DemoCell" 13 | let matrix:[(rowCount:Int, columnCount:Int)] = 14 | [(1, 1), (1, 2), (2, 2),(3,3),(4, 4),(2,3),(3,4),(2, 4),(1, 3), (0,0)] 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | self.tableView.register(UITableViewCell.classForCoder(), forCellReuseIdentifier: demoCell) 18 | } 19 | 20 | } 21 | 22 | 23 | extension ViewController{ 24 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 25 | return matrix.count 26 | } 27 | 28 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 29 | 30 | let cell = tableView.dequeueReusableCell(withIdentifier: demoCell) 31 | let title = "\(matrix[indexPath.row].rowCount)行\(matrix[indexPath.row].columnCount)列" 32 | cell?.textLabel?.text = title 33 | return cell! 34 | } 35 | 36 | override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 37 | let controller = DemoCollectionViewController(matrix: self.matrix[indexPath.row]) 38 | self.navigationController?.pushViewController(controller, animated: true) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemoTests/AutoPagingLayoutDemoTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoPagingLayoutDemoTests.swift 3 | // AutoPagingLayoutDemoTests 4 | // 5 | // Created by hooge on 16/5/20. 6 | // Copyright © 2016年 hooge. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import AutoPagingLayoutDemo 11 | 12 | class AutoPagingLayoutDemoTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemoUITests/AutoPagingLayoutDemoUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AutoPagingLayoutDemoUITests.swift 3 | // AutoPagingLayoutDemoUITests 4 | // 5 | // Created by hooge on 16/5/20. 6 | // Copyright © 2016年 hooge. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class AutoPagingLayoutDemoUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /AutoPagingLayoutDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 hoowang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AutoPagingFlowLayout 2 | 根据collectionView datasource自动分页的,展示item的布局实现。废话不多说,请直接看图~~ 3 | ![image](https://github.com/hoowang/AutoPagingFlowLayout/blob/master/AutoPage.gif) 4 | 5 | ## 系统要求 6 | - iOS 8.0 7 | - ARC 8 | - Swift 4.0 9 | 10 | ## 安装方法 11 | 支持CocoaPods 安装,pod search AutoPagingFlowLayout 12 | 13 | 也可以下载文件,拖放至项目目录 14 | 15 | ## 使用方法: 16 | ### 1.创建flowlayout configurator对象 并配置参数 17 | 18 | ```Swift 19 | let configurator = WKAutomaticPagingFlowLayoutConfigurator() 20 | configurator.columnCountOfRow = 3 // 每行有3列 21 | configurator.rowCountOfPage = 2 // 每页展示2行 22 | configurator.contentInsets = UIEdgeInsetsMake(10, 10, 10, 10) //边距 23 | configurator.scrollDirection = .Horizontal 24 | configurator.columnSpacing = 5 // 行间距 25 | configurator.lineSpacing = 5 // 列间距 26 | ``` 27 | ### 2.根据layout创建CollectionView 28 | ```Swift 29 | let layout = WKAutomaticPagingFlowLayout(layoutConfigurator: configurator) 30 | let collectionView = UICollectionView(frame: CGRectZero, collectionViewLayout:layout) 31 | collectionView.pagingEnabled = true //自行指定分页属性 根据需要 32 | collectionView.wk_Size = CGSizeMake( 33 | CGFloat(self.matrix.columnCount) * 100, CGFloat(self.matrix.rowCount) * 100) 34 | ``` 35 | 36 | ### 3.其他的步骤与正常使用UICollectionView一致 37 | 38 | 此布局会根据datasource 自动分页 并根据相关配置参数分配每个Item. 39 | 40 | --------------------------------------------------------------------------------