├── .DS_Store ├── ElCVFlowLayout ├── .DS_Store ├── ElCVFlowLayout.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── Liuminglu.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── Liuminglu.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── ElCVFlowLayout.xcscheme │ │ └── xcschememanagement.plist └── ElCVFlowLayout │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── ELCVFlowLayout.h │ ├── ELCVFlowLayout.m │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── README.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elite-kai/ELCVFlowLayout/0c2548dfa01a817e05c308e9c181c86aaac42e2f/.DS_Store -------------------------------------------------------------------------------- /ElCVFlowLayout/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elite-kai/ELCVFlowLayout/0c2548dfa01a817e05c308e9c181c86aaac42e2f/ElCVFlowLayout/.DS_Store -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0B88546E1F020E6E0010822D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B88546D1F020E6E0010822D /* main.m */; }; 11 | 0B8854711F020E6E0010822D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B8854701F020E6E0010822D /* AppDelegate.m */; }; 12 | 0B8854741F020E6E0010822D /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B8854731F020E6E0010822D /* ViewController.m */; }; 13 | 0B8854771F020E6E0010822D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0B8854751F020E6E0010822D /* Main.storyboard */; }; 14 | 0B8854791F020E6E0010822D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0B8854781F020E6E0010822D /* Assets.xcassets */; }; 15 | 0B88547C1F020E6F0010822D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0B88547A1F020E6F0010822D /* LaunchScreen.storyboard */; }; 16 | 0B8854851F020EC30010822D /* ELCVFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B8854841F020EC30010822D /* ELCVFlowLayout.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 0B8854691F020E6E0010822D /* ElCVFlowLayout.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ElCVFlowLayout.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 0B88546D1F020E6E0010822D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 22 | 0B88546F1F020E6E0010822D /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | 0B8854701F020E6E0010822D /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | 0B8854721F020E6E0010822D /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 25 | 0B8854731F020E6E0010822D /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 26 | 0B8854761F020E6E0010822D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 27 | 0B8854781F020E6E0010822D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | 0B88547B1F020E6F0010822D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 29 | 0B88547D1F020E6F0010822D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | 0B8854831F020EC30010822D /* ELCVFlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELCVFlowLayout.h; sourceTree = ""; }; 31 | 0B8854841F020EC30010822D /* ELCVFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ELCVFlowLayout.m; sourceTree = ""; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 0B8854661F020E6E0010822D /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 0B8854601F020E6D0010822D = { 46 | isa = PBXGroup; 47 | children = ( 48 | 0B88546B1F020E6E0010822D /* ElCVFlowLayout */, 49 | 0B88546A1F020E6E0010822D /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 0B88546A1F020E6E0010822D /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 0B8854691F020E6E0010822D /* ElCVFlowLayout.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 0B88546B1F020E6E0010822D /* ElCVFlowLayout */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 0B88546F1F020E6E0010822D /* AppDelegate.h */, 65 | 0B8854701F020E6E0010822D /* AppDelegate.m */, 66 | 0B8854721F020E6E0010822D /* ViewController.h */, 67 | 0B8854731F020E6E0010822D /* ViewController.m */, 68 | 0B8854831F020EC30010822D /* ELCVFlowLayout.h */, 69 | 0B8854841F020EC30010822D /* ELCVFlowLayout.m */, 70 | 0B8854751F020E6E0010822D /* Main.storyboard */, 71 | 0B8854781F020E6E0010822D /* Assets.xcassets */, 72 | 0B88547A1F020E6F0010822D /* LaunchScreen.storyboard */, 73 | 0B88547D1F020E6F0010822D /* Info.plist */, 74 | 0B88546C1F020E6E0010822D /* Supporting Files */, 75 | ); 76 | path = ElCVFlowLayout; 77 | sourceTree = ""; 78 | }; 79 | 0B88546C1F020E6E0010822D /* Supporting Files */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 0B88546D1F020E6E0010822D /* main.m */, 83 | ); 84 | name = "Supporting Files"; 85 | sourceTree = ""; 86 | }; 87 | /* End PBXGroup section */ 88 | 89 | /* Begin PBXNativeTarget section */ 90 | 0B8854681F020E6E0010822D /* ElCVFlowLayout */ = { 91 | isa = PBXNativeTarget; 92 | buildConfigurationList = 0B8854801F020E6F0010822D /* Build configuration list for PBXNativeTarget "ElCVFlowLayout" */; 93 | buildPhases = ( 94 | 0B8854651F020E6E0010822D /* Sources */, 95 | 0B8854661F020E6E0010822D /* Frameworks */, 96 | 0B8854671F020E6E0010822D /* Resources */, 97 | ); 98 | buildRules = ( 99 | ); 100 | dependencies = ( 101 | ); 102 | name = ElCVFlowLayout; 103 | productName = ElCVFlowLayout; 104 | productReference = 0B8854691F020E6E0010822D /* ElCVFlowLayout.app */; 105 | productType = "com.apple.product-type.application"; 106 | }; 107 | /* End PBXNativeTarget section */ 108 | 109 | /* Begin PBXProject section */ 110 | 0B8854611F020E6E0010822D /* Project object */ = { 111 | isa = PBXProject; 112 | attributes = { 113 | LastUpgradeCheck = 0830; 114 | ORGANIZATIONNAME = "Liuminglu-Mac"; 115 | TargetAttributes = { 116 | 0B8854681F020E6E0010822D = { 117 | CreatedOnToolsVersion = 8.3.3; 118 | ProvisioningStyle = Automatic; 119 | }; 120 | }; 121 | }; 122 | buildConfigurationList = 0B8854641F020E6E0010822D /* Build configuration list for PBXProject "ElCVFlowLayout" */; 123 | compatibilityVersion = "Xcode 3.2"; 124 | developmentRegion = English; 125 | hasScannedForEncodings = 0; 126 | knownRegions = ( 127 | en, 128 | Base, 129 | ); 130 | mainGroup = 0B8854601F020E6D0010822D; 131 | productRefGroup = 0B88546A1F020E6E0010822D /* Products */; 132 | projectDirPath = ""; 133 | projectRoot = ""; 134 | targets = ( 135 | 0B8854681F020E6E0010822D /* ElCVFlowLayout */, 136 | ); 137 | }; 138 | /* End PBXProject section */ 139 | 140 | /* Begin PBXResourcesBuildPhase section */ 141 | 0B8854671F020E6E0010822D /* Resources */ = { 142 | isa = PBXResourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | 0B88547C1F020E6F0010822D /* LaunchScreen.storyboard in Resources */, 146 | 0B8854791F020E6E0010822D /* Assets.xcassets in Resources */, 147 | 0B8854771F020E6E0010822D /* Main.storyboard in Resources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXResourcesBuildPhase section */ 152 | 153 | /* Begin PBXSourcesBuildPhase section */ 154 | 0B8854651F020E6E0010822D /* Sources */ = { 155 | isa = PBXSourcesBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 0B8854741F020E6E0010822D /* ViewController.m in Sources */, 159 | 0B8854711F020E6E0010822D /* AppDelegate.m in Sources */, 160 | 0B88546E1F020E6E0010822D /* main.m in Sources */, 161 | 0B8854851F020EC30010822D /* ELCVFlowLayout.m in Sources */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXSourcesBuildPhase section */ 166 | 167 | /* Begin PBXVariantGroup section */ 168 | 0B8854751F020E6E0010822D /* Main.storyboard */ = { 169 | isa = PBXVariantGroup; 170 | children = ( 171 | 0B8854761F020E6E0010822D /* Base */, 172 | ); 173 | name = Main.storyboard; 174 | sourceTree = ""; 175 | }; 176 | 0B88547A1F020E6F0010822D /* LaunchScreen.storyboard */ = { 177 | isa = PBXVariantGroup; 178 | children = ( 179 | 0B88547B1F020E6F0010822D /* Base */, 180 | ); 181 | name = LaunchScreen.storyboard; 182 | sourceTree = ""; 183 | }; 184 | /* End PBXVariantGroup section */ 185 | 186 | /* Begin XCBuildConfiguration section */ 187 | 0B88547E1F020E6F0010822D /* Debug */ = { 188 | isa = XCBuildConfiguration; 189 | buildSettings = { 190 | ALWAYS_SEARCH_USER_PATHS = NO; 191 | CLANG_ANALYZER_NONNULL = YES; 192 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 193 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 194 | CLANG_CXX_LIBRARY = "libc++"; 195 | CLANG_ENABLE_MODULES = YES; 196 | CLANG_ENABLE_OBJC_ARC = YES; 197 | CLANG_WARN_BOOL_CONVERSION = YES; 198 | CLANG_WARN_CONSTANT_CONVERSION = YES; 199 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 200 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 201 | CLANG_WARN_EMPTY_BODY = YES; 202 | CLANG_WARN_ENUM_CONVERSION = YES; 203 | CLANG_WARN_INFINITE_RECURSION = YES; 204 | CLANG_WARN_INT_CONVERSION = YES; 205 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 206 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 207 | CLANG_WARN_UNREACHABLE_CODE = YES; 208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 209 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 210 | COPY_PHASE_STRIP = NO; 211 | DEBUG_INFORMATION_FORMAT = dwarf; 212 | ENABLE_STRICT_OBJC_MSGSEND = YES; 213 | ENABLE_TESTABILITY = YES; 214 | GCC_C_LANGUAGE_STANDARD = gnu99; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_NO_COMMON_BLOCKS = YES; 217 | GCC_OPTIMIZATION_LEVEL = 0; 218 | GCC_PREPROCESSOR_DEFINITIONS = ( 219 | "DEBUG=1", 220 | "$(inherited)", 221 | ); 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 224 | GCC_WARN_UNDECLARED_SELECTOR = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 226 | GCC_WARN_UNUSED_FUNCTION = YES; 227 | GCC_WARN_UNUSED_VARIABLE = YES; 228 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 229 | MTL_ENABLE_DEBUG_INFO = YES; 230 | ONLY_ACTIVE_ARCH = YES; 231 | SDKROOT = iphoneos; 232 | }; 233 | name = Debug; 234 | }; 235 | 0B88547F1F020E6F0010822D /* Release */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = NO; 239 | CLANG_ANALYZER_NONNULL = YES; 240 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 241 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 242 | CLANG_CXX_LIBRARY = "libc++"; 243 | CLANG_ENABLE_MODULES = YES; 244 | CLANG_ENABLE_OBJC_ARC = YES; 245 | CLANG_WARN_BOOL_CONVERSION = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 248 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 254 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 255 | CLANG_WARN_UNREACHABLE_CODE = YES; 256 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 257 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 258 | COPY_PHASE_STRIP = NO; 259 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 260 | ENABLE_NS_ASSERTIONS = NO; 261 | ENABLE_STRICT_OBJC_MSGSEND = YES; 262 | GCC_C_LANGUAGE_STANDARD = gnu99; 263 | GCC_NO_COMMON_BLOCKS = YES; 264 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 265 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 266 | GCC_WARN_UNDECLARED_SELECTOR = YES; 267 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 268 | GCC_WARN_UNUSED_FUNCTION = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 271 | MTL_ENABLE_DEBUG_INFO = NO; 272 | SDKROOT = iphoneos; 273 | VALIDATE_PRODUCT = YES; 274 | }; 275 | name = Release; 276 | }; 277 | 0B8854811F020E6F0010822D /* Debug */ = { 278 | isa = XCBuildConfiguration; 279 | buildSettings = { 280 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 281 | INFOPLIST_FILE = ElCVFlowLayout/Info.plist; 282 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 283 | PRODUCT_BUNDLE_IDENTIFIER = yjoy800.ElCVFlowLayout; 284 | PRODUCT_NAME = "$(TARGET_NAME)"; 285 | }; 286 | name = Debug; 287 | }; 288 | 0B8854821F020E6F0010822D /* Release */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 292 | INFOPLIST_FILE = ElCVFlowLayout/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = yjoy800.ElCVFlowLayout; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | }; 297 | name = Release; 298 | }; 299 | /* End XCBuildConfiguration section */ 300 | 301 | /* Begin XCConfigurationList section */ 302 | 0B8854641F020E6E0010822D /* Build configuration list for PBXProject "ElCVFlowLayout" */ = { 303 | isa = XCConfigurationList; 304 | buildConfigurations = ( 305 | 0B88547E1F020E6F0010822D /* Debug */, 306 | 0B88547F1F020E6F0010822D /* Release */, 307 | ); 308 | defaultConfigurationIsVisible = 0; 309 | defaultConfigurationName = Release; 310 | }; 311 | 0B8854801F020E6F0010822D /* Build configuration list for PBXNativeTarget "ElCVFlowLayout" */ = { 312 | isa = XCConfigurationList; 313 | buildConfigurations = ( 314 | 0B8854811F020E6F0010822D /* Debug */, 315 | 0B8854821F020E6F0010822D /* Release */, 316 | ); 317 | defaultConfigurationIsVisible = 0; 318 | defaultConfigurationName = Release; 319 | }; 320 | /* End XCConfigurationList section */ 321 | }; 322 | rootObject = 0B8854611F020E6E0010822D /* Project object */; 323 | } 324 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout.xcodeproj/project.xcworkspace/xcuserdata/Liuminglu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elite-kai/ELCVFlowLayout/0c2548dfa01a817e05c308e9c181c86aaac42e2f/ElCVFlowLayout/ElCVFlowLayout.xcodeproj/project.xcworkspace/xcuserdata/Liuminglu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout.xcodeproj/xcuserdata/Liuminglu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout.xcodeproj/xcuserdata/Liuminglu.xcuserdatad/xcschemes/ElCVFlowLayout.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout.xcodeproj/xcuserdata/Liuminglu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ElCVFlowLayout.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 0B8854681F020E6E0010822D 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ElCVFlowLayout 4 | // 5 | // Created by Parkin on 2017/6/27. 6 | // Copyright © 2017年 Parkin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ElCVFlowLayout 4 | // 5 | // Created by Parkin on 2017/6/27. 6 | // Copyright © 2017年 Parkin. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/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 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/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 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/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 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/ELCVFlowLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ELCVFlowLayout.h 3 | // ElCVFlowLayout 4 | // 5 | // Created by Parkin on 2017/6/27. 6 | // Copyright © 2017年 Parkin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ELCVFlowLayout : UICollectionViewFlowLayout 12 | 13 | 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/ELCVFlowLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ELCVFlowLayout.m 3 | // ElCVFlowLayout 4 | // 5 | // Created by Parkin on 2017/6/27. 6 | // Copyright © 2017年 Parkin. All rights reserved. 7 | // 8 | 9 | #import "ELCVFlowLayout.h" 10 | 11 | @interface ELCVFlowLayout () 12 | 13 | @property (nonatomic, copy) NSMutableDictionary *sectionDic; 14 | @property (strong, nonatomic) NSMutableArray *allAttributes; 15 | 16 | @end 17 | 18 | @implementation ELCVFlowLayout 19 | 20 | 21 | - (instancetype)init 22 | { 23 | self = [super init]; 24 | if (self) { 25 | self.scrollDirection = UICollectionViewScrollDirectionHorizontal; 26 | } 27 | return self; 28 | } 29 | 30 | 31 | - (void)prepareLayout 32 | { 33 | [super prepareLayout]; 34 | 35 | _sectionDic = [NSMutableDictionary dictionary]; 36 | self.allAttributes = [NSMutableArray array]; 37 | //获取section的数量 38 | NSUInteger section = [self.collectionView numberOfSections]; 39 | 40 | for (int sec = 0; sec < section; sec++) { 41 | //获取每个section的cell个数 42 | NSUInteger count = [self.collectionView numberOfItemsInSection:sec]; 43 | 44 | for (NSUInteger item = 0; item *)layoutAttributesForElementsInRect:(CGRect)rect 159 | { 160 | return self.allAttributes; 161 | } 162 | 163 | @end 164 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ElCVFlowLayout 4 | // 5 | // Created by Parkin on 2017/6/27. 6 | // Copyright © 2017年 Parkin. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ElCVFlowLayout 4 | // 5 | // Created by Parkin on 2017/6/27. 6 | // Copyright © 2017年 Parkin. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ELCVFlowLayout.h" 11 | 12 | #define kScreenHeight [[UIScreen mainScreen] bounds].size.height 13 | #define kScreenWidth [[UIScreen mainScreen] bounds].size.width 14 | 15 | @interface ViewController () 16 | 17 | //数据源数组 18 | @property (nonatomic, strong) NSMutableArray* dateArray; 19 | 20 | //日历视图 21 | @property (nonatomic, strong) UICollectionView* collectionView; 22 | 23 | @end 24 | 25 | @implementation ViewController 26 | 27 | - (void)viewDidLoad { 28 | [super viewDidLoad]; 29 | // Do any additional setup after loading the view, typically from a nib. 30 | _dateArray = [@[@1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12, @13] mutableCopy]; 31 | //横向滚动 32 | ELCVFlowLayout *horizontalLayout = [[ELCVFlowLayout alloc] init]; 33 | 34 | horizontalLayout.itemSize = CGSizeMake(kScreenWidth/3.0, kScreenWidth/4.0); 35 | 36 | _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, kScreenWidth) collectionViewLayout:horizontalLayout]; 37 | _collectionView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); 38 | _collectionView.pagingEnabled = YES; 39 | _collectionView.dataSource = self; 40 | _collectionView.delegate = self; 41 | _collectionView.showsVerticalScrollIndicator = NO; 42 | _collectionView.showsHorizontalScrollIndicator = NO; 43 | _collectionView.bounces = NO; 44 | _collectionView.pagingEnabled = YES; 45 | _collectionView.backgroundColor = [UIColor blueColor]; 46 | 47 | [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cell"]; 48 | [self.view addSubview:_collectionView]; 49 | } 50 | 51 | #pragma mark 数据源方法 52 | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView*)collectionView 53 | { 54 | return 4; 55 | } 56 | 57 | - (NSInteger)collectionView:(UICollectionView*)collectionView numberOfItemsInSection:(NSInteger)section 58 | { 59 | if (section == 0) { 60 | return 9; 61 | } 62 | else if (section == 1) { 63 | return 17; 64 | } 65 | else if (section == 2) { 66 | return 25; 67 | } 68 | return 1; 69 | 70 | } 71 | 72 | - (UICollectionViewCell*)collectionView:(UICollectionView*)collectionView cellForItemAtIndexPath:(NSIndexPath*)indexPath 73 | { 74 | UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; 75 | 76 | cell.backgroundColor = [UIColor redColor]; 77 | UILabel *label = [[UILabel alloc] initWithFrame:cell.bounds]; 78 | label.backgroundColor = [UIColor redColor]; 79 | label.textAlignment = NSTextAlignmentCenter; 80 | label.font = [UIFont systemFontOfSize:15]; 81 | label.text = [NSString stringWithFormat:@"%ld", indexPath.row]; 82 | label.textColor = [UIColor blueColor]; 83 | label.numberOfLines = 0; 84 | [cell.contentView addSubview:label]; 85 | 86 | return cell; 87 | } 88 | 89 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 90 | { 91 | NSLog(@"section %ld row --- %ld",indexPath.section, indexPath.row); 92 | } 93 | 94 | - (void)didReceiveMemoryWarning { 95 | [super didReceiveMemoryWarning]; 96 | // Dispose of any resources that can be recreated. 97 | } 98 | 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /ElCVFlowLayout/ElCVFlowLayout/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ElCVFlowLayout 4 | // 5 | // Created by Parkin on 2017/6/27. 6 | // Copyright © 2017年 Parkin. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ELCVFlowLayout 2 | 实现了UICollectionView横向滑动和UICollectionViewCell的横向排列 只需要将ELCVFlowLayout文件拖入项目,将UICollectionViewFlowLayout替换为ELCVFlowLayout即可 我的博客地址http://www.jianshu.com/u/e50ecd81ad38 3 | --------------------------------------------------------------------------------