├── .gitignore ├── .swift-version ├── LICENSE ├── PagedHorizontalView-Example.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── PagedHorizontalView.xcscheme ├── PagedHorizontalView-Example ├── AppDelegate.swift ├── Assets.xcassets │ ├── 1.imageset │ │ ├── 1.jpg │ │ └── Contents.json │ ├── 2.imageset │ │ ├── 2.jpg │ │ └── Contents.json │ ├── 3.imageset │ │ ├── 3.jpg │ │ └── Contents.json │ ├── 4.imageset │ │ ├── 4.jpg │ │ └── Contents.json │ ├── 5.imageset │ │ ├── 5.jpg │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── left-arrow.imageset │ │ ├── Contents.json │ │ ├── left-arrow.png │ │ ├── left-arrow@2x.png │ │ └── left-arrow@3x.png │ └── right-arrow.imageset │ │ ├── Contents.json │ │ ├── right-arrow.png │ │ ├── right-arrow@2x.png │ │ └── right-arrow@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CustomCollectionViewCell.swift ├── Info.plist └── ViewController.swift ├── PagedHorizontalView.podspec ├── PagedHorizontalView ├── Info.plist ├── PagedHorizontalView.h └── PagedHorizontalView.swift ├── README.md └── screenshots ├── demo.gif ├── step1.png └── step2.gif /.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 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 mohamede1945 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 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 54433BAA1DAA5CD50032AF9C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54433BA91DAA5CD50032AF9C /* AppDelegate.swift */; }; 11 | 54433BAC1DAA5CD50032AF9C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54433BAB1DAA5CD50032AF9C /* ViewController.swift */; }; 12 | 54433BAF1DAA5CD50032AF9C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 54433BAD1DAA5CD50032AF9C /* Main.storyboard */; }; 13 | 54433BB11DAA5CD50032AF9C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 54433BB01DAA5CD50032AF9C /* Assets.xcassets */; }; 14 | 54433BB41DAA5CD50032AF9C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 54433BB21DAA5CD50032AF9C /* LaunchScreen.storyboard */; }; 15 | 54433BC41DAA5CEC0032AF9C /* PagedHorizontalView.h in Headers */ = {isa = PBXBuildFile; fileRef = 54433BC21DAA5CEC0032AF9C /* PagedHorizontalView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | 54433BC71DAA5CEC0032AF9C /* PagedHorizontalView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54433BC01DAA5CEC0032AF9C /* PagedHorizontalView.framework */; }; 17 | 54433BC81DAA5CEC0032AF9C /* PagedHorizontalView.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 54433BC01DAA5CEC0032AF9C /* PagedHorizontalView.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | 54433BCE1DAA5D020032AF9C /* PagedHorizontalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54433BCD1DAA5D020032AF9C /* PagedHorizontalView.swift */; }; 19 | 54433BD01DAA5D390032AF9C /* CustomCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54433BCF1DAA5D390032AF9C /* CustomCollectionViewCell.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 54433BC51DAA5CEC0032AF9C /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 54433B9E1DAA5CD50032AF9C /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 54433BBF1DAA5CEC0032AF9C; 28 | remoteInfo = PagedHorizontalView; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXCopyFilesBuildPhase section */ 33 | 54433BCC1DAA5CEC0032AF9C /* Embed Frameworks */ = { 34 | isa = PBXCopyFilesBuildPhase; 35 | buildActionMask = 2147483647; 36 | dstPath = ""; 37 | dstSubfolderSpec = 10; 38 | files = ( 39 | 54433BC81DAA5CEC0032AF9C /* PagedHorizontalView.framework in Embed Frameworks */, 40 | ); 41 | name = "Embed Frameworks"; 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXCopyFilesBuildPhase section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 54433BA61DAA5CD50032AF9C /* PagedHorizontalView-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "PagedHorizontalView-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 54433BA91DAA5CD50032AF9C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 49 | 54433BAB1DAA5CD50032AF9C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 50 | 54433BAE1DAA5CD50032AF9C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 51 | 54433BB01DAA5CD50032AF9C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 52 | 54433BB31DAA5CD50032AF9C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 53 | 54433BB51DAA5CD50032AF9C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 54433BC01DAA5CEC0032AF9C /* PagedHorizontalView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PagedHorizontalView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 54433BC21DAA5CEC0032AF9C /* PagedHorizontalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PagedHorizontalView.h; sourceTree = ""; }; 56 | 54433BC31DAA5CEC0032AF9C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | 54433BCD1DAA5D020032AF9C /* PagedHorizontalView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PagedHorizontalView.swift; sourceTree = ""; }; 58 | 54433BCF1DAA5D390032AF9C /* CustomCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomCollectionViewCell.swift; sourceTree = ""; }; 59 | 54433BD21DAA5DC10032AF9C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; }; 60 | 54433BD31DAA5DC10032AF9C /* PagedHorizontalView.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; path = PagedHorizontalView.podspec; sourceTree = ""; }; 61 | 54433BD41DAA5DC10032AF9C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 54433BA31DAA5CD50032AF9C /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 54433BC71DAA5CEC0032AF9C /* PagedHorizontalView.framework in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 54433BBC1DAA5CEC0032AF9C /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 54433B9D1DAA5CD50032AF9C = { 84 | isa = PBXGroup; 85 | children = ( 86 | 54433BD11DAA5DAF0032AF9C /* ... */, 87 | 54433BA81DAA5CD50032AF9C /* PagedHorizontalView-Example */, 88 | 54433BC11DAA5CEC0032AF9C /* PagedHorizontalView */, 89 | 54433BA71DAA5CD50032AF9C /* Products */, 90 | ); 91 | sourceTree = ""; 92 | }; 93 | 54433BA71DAA5CD50032AF9C /* Products */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 54433BA61DAA5CD50032AF9C /* PagedHorizontalView-Example.app */, 97 | 54433BC01DAA5CEC0032AF9C /* PagedHorizontalView.framework */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 54433BA81DAA5CD50032AF9C /* PagedHorizontalView-Example */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 54433BCF1DAA5D390032AF9C /* CustomCollectionViewCell.swift */, 106 | 54433BA91DAA5CD50032AF9C /* AppDelegate.swift */, 107 | 54433BAB1DAA5CD50032AF9C /* ViewController.swift */, 108 | 54433BAD1DAA5CD50032AF9C /* Main.storyboard */, 109 | 54433BB01DAA5CD50032AF9C /* Assets.xcassets */, 110 | 54433BB21DAA5CD50032AF9C /* LaunchScreen.storyboard */, 111 | 54433BB51DAA5CD50032AF9C /* Info.plist */, 112 | ); 113 | path = "PagedHorizontalView-Example"; 114 | sourceTree = ""; 115 | }; 116 | 54433BC11DAA5CEC0032AF9C /* PagedHorizontalView */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 54433BCD1DAA5D020032AF9C /* PagedHorizontalView.swift */, 120 | 54433BC21DAA5CEC0032AF9C /* PagedHorizontalView.h */, 121 | 54433BC31DAA5CEC0032AF9C /* Info.plist */, 122 | ); 123 | path = PagedHorizontalView; 124 | sourceTree = ""; 125 | }; 126 | 54433BD11DAA5DAF0032AF9C /* ... */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 54433BD21DAA5DC10032AF9C /* LICENSE */, 130 | 54433BD31DAA5DC10032AF9C /* PagedHorizontalView.podspec */, 131 | 54433BD41DAA5DC10032AF9C /* README.md */, 132 | ); 133 | name = ...; 134 | sourceTree = ""; 135 | }; 136 | /* End PBXGroup section */ 137 | 138 | /* Begin PBXHeadersBuildPhase section */ 139 | 54433BBD1DAA5CEC0032AF9C /* Headers */ = { 140 | isa = PBXHeadersBuildPhase; 141 | buildActionMask = 2147483647; 142 | files = ( 143 | 54433BC41DAA5CEC0032AF9C /* PagedHorizontalView.h in Headers */, 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | }; 147 | /* End PBXHeadersBuildPhase section */ 148 | 149 | /* Begin PBXNativeTarget section */ 150 | 54433BA51DAA5CD50032AF9C /* PagedHorizontalView-Example */ = { 151 | isa = PBXNativeTarget; 152 | buildConfigurationList = 54433BB81DAA5CD50032AF9C /* Build configuration list for PBXNativeTarget "PagedHorizontalView-Example" */; 153 | buildPhases = ( 154 | 54433BA21DAA5CD50032AF9C /* Sources */, 155 | 54433BA31DAA5CD50032AF9C /* Frameworks */, 156 | 54433BA41DAA5CD50032AF9C /* Resources */, 157 | 54433BCC1DAA5CEC0032AF9C /* Embed Frameworks */, 158 | ); 159 | buildRules = ( 160 | ); 161 | dependencies = ( 162 | 54433BC61DAA5CEC0032AF9C /* PBXTargetDependency */, 163 | ); 164 | name = "PagedHorizontalView-Example"; 165 | productName = "PagedHorizontalView-Example"; 166 | productReference = 54433BA61DAA5CD50032AF9C /* PagedHorizontalView-Example.app */; 167 | productType = "com.apple.product-type.application"; 168 | }; 169 | 54433BBF1DAA5CEC0032AF9C /* PagedHorizontalView */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = 54433BC91DAA5CEC0032AF9C /* Build configuration list for PBXNativeTarget "PagedHorizontalView" */; 172 | buildPhases = ( 173 | 54433BBB1DAA5CEC0032AF9C /* Sources */, 174 | 54433BBC1DAA5CEC0032AF9C /* Frameworks */, 175 | 54433BBD1DAA5CEC0032AF9C /* Headers */, 176 | 54433BBE1DAA5CEC0032AF9C /* Resources */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | ); 182 | name = PagedHorizontalView; 183 | productName = PagedHorizontalView; 184 | productReference = 54433BC01DAA5CEC0032AF9C /* PagedHorizontalView.framework */; 185 | productType = "com.apple.product-type.framework"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | 54433B9E1DAA5CD50032AF9C /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | LastSwiftUpdateCheck = 0800; 194 | LastUpgradeCheck = 0800; 195 | ORGANIZATIONNAME = Varaw; 196 | TargetAttributes = { 197 | 54433BA51DAA5CD50032AF9C = { 198 | CreatedOnToolsVersion = 8.0; 199 | ProvisioningStyle = Automatic; 200 | }; 201 | 54433BBF1DAA5CEC0032AF9C = { 202 | CreatedOnToolsVersion = 8.0; 203 | LastSwiftMigration = 0940; 204 | ProvisioningStyle = Automatic; 205 | }; 206 | }; 207 | }; 208 | buildConfigurationList = 54433BA11DAA5CD50032AF9C /* Build configuration list for PBXProject "PagedHorizontalView-Example" */; 209 | compatibilityVersion = "Xcode 3.2"; 210 | developmentRegion = English; 211 | hasScannedForEncodings = 0; 212 | knownRegions = ( 213 | en, 214 | Base, 215 | ); 216 | mainGroup = 54433B9D1DAA5CD50032AF9C; 217 | productRefGroup = 54433BA71DAA5CD50032AF9C /* Products */; 218 | projectDirPath = ""; 219 | projectRoot = ""; 220 | targets = ( 221 | 54433BA51DAA5CD50032AF9C /* PagedHorizontalView-Example */, 222 | 54433BBF1DAA5CEC0032AF9C /* PagedHorizontalView */, 223 | ); 224 | }; 225 | /* End PBXProject section */ 226 | 227 | /* Begin PBXResourcesBuildPhase section */ 228 | 54433BA41DAA5CD50032AF9C /* Resources */ = { 229 | isa = PBXResourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 54433BB41DAA5CD50032AF9C /* LaunchScreen.storyboard in Resources */, 233 | 54433BB11DAA5CD50032AF9C /* Assets.xcassets in Resources */, 234 | 54433BAF1DAA5CD50032AF9C /* Main.storyboard in Resources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | 54433BBE1DAA5CEC0032AF9C /* Resources */ = { 239 | isa = PBXResourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | }; 245 | /* End PBXResourcesBuildPhase section */ 246 | 247 | /* Begin PBXSourcesBuildPhase section */ 248 | 54433BA21DAA5CD50032AF9C /* Sources */ = { 249 | isa = PBXSourcesBuildPhase; 250 | buildActionMask = 2147483647; 251 | files = ( 252 | 54433BAC1DAA5CD50032AF9C /* ViewController.swift in Sources */, 253 | 54433BD01DAA5D390032AF9C /* CustomCollectionViewCell.swift in Sources */, 254 | 54433BAA1DAA5CD50032AF9C /* AppDelegate.swift in Sources */, 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | 54433BBB1DAA5CEC0032AF9C /* Sources */ = { 259 | isa = PBXSourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | 54433BCE1DAA5D020032AF9C /* PagedHorizontalView.swift in Sources */, 263 | ); 264 | runOnlyForDeploymentPostprocessing = 0; 265 | }; 266 | /* End PBXSourcesBuildPhase section */ 267 | 268 | /* Begin PBXTargetDependency section */ 269 | 54433BC61DAA5CEC0032AF9C /* PBXTargetDependency */ = { 270 | isa = PBXTargetDependency; 271 | target = 54433BBF1DAA5CEC0032AF9C /* PagedHorizontalView */; 272 | targetProxy = 54433BC51DAA5CEC0032AF9C /* PBXContainerItemProxy */; 273 | }; 274 | /* End PBXTargetDependency section */ 275 | 276 | /* Begin PBXVariantGroup section */ 277 | 54433BAD1DAA5CD50032AF9C /* Main.storyboard */ = { 278 | isa = PBXVariantGroup; 279 | children = ( 280 | 54433BAE1DAA5CD50032AF9C /* Base */, 281 | ); 282 | name = Main.storyboard; 283 | sourceTree = ""; 284 | }; 285 | 54433BB21DAA5CD50032AF9C /* LaunchScreen.storyboard */ = { 286 | isa = PBXVariantGroup; 287 | children = ( 288 | 54433BB31DAA5CD50032AF9C /* Base */, 289 | ); 290 | name = LaunchScreen.storyboard; 291 | sourceTree = ""; 292 | }; 293 | /* End PBXVariantGroup section */ 294 | 295 | /* Begin XCBuildConfiguration section */ 296 | 54433BB61DAA5CD50032AF9C /* Debug */ = { 297 | isa = XCBuildConfiguration; 298 | buildSettings = { 299 | ALWAYS_SEARCH_USER_PATHS = NO; 300 | CLANG_ANALYZER_NONNULL = YES; 301 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 302 | CLANG_CXX_LIBRARY = "libc++"; 303 | CLANG_ENABLE_MODULES = YES; 304 | CLANG_ENABLE_OBJC_ARC = YES; 305 | CLANG_WARN_BOOL_CONVERSION = YES; 306 | CLANG_WARN_CONSTANT_CONVERSION = YES; 307 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 308 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 309 | CLANG_WARN_EMPTY_BODY = YES; 310 | CLANG_WARN_ENUM_CONVERSION = YES; 311 | CLANG_WARN_INFINITE_RECURSION = YES; 312 | CLANG_WARN_INT_CONVERSION = YES; 313 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 314 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 315 | CLANG_WARN_UNREACHABLE_CODE = YES; 316 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 317 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 318 | COPY_PHASE_STRIP = NO; 319 | DEBUG_INFORMATION_FORMAT = dwarf; 320 | ENABLE_STRICT_OBJC_MSGSEND = YES; 321 | ENABLE_TESTABILITY = YES; 322 | GCC_C_LANGUAGE_STANDARD = gnu99; 323 | GCC_DYNAMIC_NO_PIC = NO; 324 | GCC_NO_COMMON_BLOCKS = YES; 325 | GCC_OPTIMIZATION_LEVEL = 0; 326 | GCC_PREPROCESSOR_DEFINITIONS = ( 327 | "DEBUG=1", 328 | "$(inherited)", 329 | ); 330 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 331 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 332 | GCC_WARN_UNDECLARED_SELECTOR = YES; 333 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 334 | GCC_WARN_UNUSED_FUNCTION = YES; 335 | GCC_WARN_UNUSED_VARIABLE = YES; 336 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 337 | MTL_ENABLE_DEBUG_INFO = YES; 338 | ONLY_ACTIVE_ARCH = YES; 339 | SDKROOT = iphoneos; 340 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 341 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 342 | TARGETED_DEVICE_FAMILY = "1,2"; 343 | }; 344 | name = Debug; 345 | }; 346 | 54433BB71DAA5CD50032AF9C /* Release */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ALWAYS_SEARCH_USER_PATHS = NO; 350 | CLANG_ANALYZER_NONNULL = YES; 351 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 352 | CLANG_CXX_LIBRARY = "libc++"; 353 | CLANG_ENABLE_MODULES = YES; 354 | CLANG_ENABLE_OBJC_ARC = YES; 355 | CLANG_WARN_BOOL_CONVERSION = YES; 356 | CLANG_WARN_CONSTANT_CONVERSION = YES; 357 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 358 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 359 | CLANG_WARN_EMPTY_BODY = YES; 360 | CLANG_WARN_ENUM_CONVERSION = YES; 361 | CLANG_WARN_INFINITE_RECURSION = YES; 362 | CLANG_WARN_INT_CONVERSION = YES; 363 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 364 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 365 | CLANG_WARN_UNREACHABLE_CODE = YES; 366 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 367 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 368 | COPY_PHASE_STRIP = NO; 369 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 370 | ENABLE_NS_ASSERTIONS = NO; 371 | ENABLE_STRICT_OBJC_MSGSEND = YES; 372 | GCC_C_LANGUAGE_STANDARD = gnu99; 373 | GCC_NO_COMMON_BLOCKS = YES; 374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 376 | GCC_WARN_UNDECLARED_SELECTOR = YES; 377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 378 | GCC_WARN_UNUSED_FUNCTION = YES; 379 | GCC_WARN_UNUSED_VARIABLE = YES; 380 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 381 | MTL_ENABLE_DEBUG_INFO = NO; 382 | SDKROOT = iphoneos; 383 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 384 | TARGETED_DEVICE_FAMILY = "1,2"; 385 | VALIDATE_PRODUCT = YES; 386 | }; 387 | name = Release; 388 | }; 389 | 54433BB91DAA5CD50032AF9C /* Debug */ = { 390 | isa = XCBuildConfiguration; 391 | buildSettings = { 392 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 393 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 394 | INFOPLIST_FILE = "PagedHorizontalView-Example/Info.plist"; 395 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 396 | PRODUCT_BUNDLE_IDENTIFIER = "com.varaw.PagedHorizontalView-Example"; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | SWIFT_VERSION = 3.0; 399 | }; 400 | name = Debug; 401 | }; 402 | 54433BBA1DAA5CD50032AF9C /* Release */ = { 403 | isa = XCBuildConfiguration; 404 | buildSettings = { 405 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 406 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 407 | INFOPLIST_FILE = "PagedHorizontalView-Example/Info.plist"; 408 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 409 | PRODUCT_BUNDLE_IDENTIFIER = "com.varaw.PagedHorizontalView-Example"; 410 | PRODUCT_NAME = "$(TARGET_NAME)"; 411 | SWIFT_VERSION = 3.0; 412 | }; 413 | name = Release; 414 | }; 415 | 54433BCA1DAA5CEC0032AF9C /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | CLANG_ENABLE_MODULES = YES; 419 | CODE_SIGN_IDENTITY = ""; 420 | CURRENT_PROJECT_VERSION = 1; 421 | DEFINES_MODULE = YES; 422 | DYLIB_COMPATIBILITY_VERSION = 1; 423 | DYLIB_CURRENT_VERSION = 1; 424 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 425 | INFOPLIST_FILE = PagedHorizontalView/Info.plist; 426 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 427 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 428 | PRODUCT_BUNDLE_IDENTIFIER = com.varaw.PagedHorizontalView; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | SKIP_INSTALL = YES; 431 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 432 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 433 | SWIFT_VERSION = 4.0; 434 | VERSIONING_SYSTEM = "apple-generic"; 435 | VERSION_INFO_PREFIX = ""; 436 | }; 437 | name = Debug; 438 | }; 439 | 54433BCB1DAA5CEC0032AF9C /* Release */ = { 440 | isa = XCBuildConfiguration; 441 | buildSettings = { 442 | CLANG_ENABLE_MODULES = YES; 443 | CODE_SIGN_IDENTITY = ""; 444 | CURRENT_PROJECT_VERSION = 1; 445 | DEFINES_MODULE = YES; 446 | DYLIB_COMPATIBILITY_VERSION = 1; 447 | DYLIB_CURRENT_VERSION = 1; 448 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 449 | INFOPLIST_FILE = PagedHorizontalView/Info.plist; 450 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 451 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 452 | PRODUCT_BUNDLE_IDENTIFIER = com.varaw.PagedHorizontalView; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | SKIP_INSTALL = YES; 455 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 456 | SWIFT_VERSION = 4.0; 457 | VERSIONING_SYSTEM = "apple-generic"; 458 | VERSION_INFO_PREFIX = ""; 459 | }; 460 | name = Release; 461 | }; 462 | /* End XCBuildConfiguration section */ 463 | 464 | /* Begin XCConfigurationList section */ 465 | 54433BA11DAA5CD50032AF9C /* Build configuration list for PBXProject "PagedHorizontalView-Example" */ = { 466 | isa = XCConfigurationList; 467 | buildConfigurations = ( 468 | 54433BB61DAA5CD50032AF9C /* Debug */, 469 | 54433BB71DAA5CD50032AF9C /* Release */, 470 | ); 471 | defaultConfigurationIsVisible = 0; 472 | defaultConfigurationName = Release; 473 | }; 474 | 54433BB81DAA5CD50032AF9C /* Build configuration list for PBXNativeTarget "PagedHorizontalView-Example" */ = { 475 | isa = XCConfigurationList; 476 | buildConfigurations = ( 477 | 54433BB91DAA5CD50032AF9C /* Debug */, 478 | 54433BBA1DAA5CD50032AF9C /* Release */, 479 | ); 480 | defaultConfigurationIsVisible = 0; 481 | defaultConfigurationName = Release; 482 | }; 483 | 54433BC91DAA5CEC0032AF9C /* Build configuration list for PBXNativeTarget "PagedHorizontalView" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 54433BCA1DAA5CEC0032AF9C /* Debug */, 487 | 54433BCB1DAA5CEC0032AF9C /* Release */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 54433B9E1DAA5CD50032AF9C /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example.xcodeproj/xcshareddata/xcschemes/PagedHorizontalView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 65 | 66 | 72 | 73 | 74 | 75 | 77 | 78 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PagedHorizontalView-Example 4 | // 5 | // Created by Mohamed Afifi on 10/9/16. 6 | // Copyright © 2016 Varaw. 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 invalidate graphics rendering callbacks. 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 active 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 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/1.imageset/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/1.imageset/1.jpg -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "1.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode", 20 | "template-rendering-intent" : "original" 21 | } 22 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/2.imageset/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/2.imageset/2.jpg -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "2.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode", 20 | "template-rendering-intent" : "original" 21 | } 22 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/3.imageset/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/3.imageset/3.jpg -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "3.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode", 20 | "template-rendering-intent" : "original" 21 | } 22 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/4.imageset/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/4.imageset/4.jpg -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "4.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode", 20 | "template-rendering-intent" : "original" 21 | } 22 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/5.imageset/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/5.imageset/5.jpg -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "5.jpg" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode", 20 | "template-rendering-intent" : "original" 21 | } 22 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/left-arrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "left-arrow.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "left-arrow@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "left-arrow@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/left-arrow.imageset/left-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/left-arrow.imageset/left-arrow.png -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/left-arrow.imageset/left-arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/left-arrow.imageset/left-arrow@2x.png -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/left-arrow.imageset/left-arrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/left-arrow.imageset/left-arrow@3x.png -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/right-arrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "right-arrow.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x", 11 | "filename" : "right-arrow@2x.png" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x", 16 | "filename" : "right-arrow@3x.png" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/right-arrow.imageset/right-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/right-arrow.imageset/right-arrow.png -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/right-arrow.imageset/right-arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/right-arrow.imageset/right-arrow@2x.png -------------------------------------------------------------------------------- /PagedHorizontalView-Example/Assets.xcassets/right-arrow.imageset/right-arrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/PagedHorizontalView-Example/Assets.xcassets/right-arrow.imageset/right-arrow@3x.png -------------------------------------------------------------------------------- /PagedHorizontalView-Example/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 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example/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 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 77 | 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 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example/CustomCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CustomCollectionViewCell.swift 3 | // PagedHorizontalView 4 | // 5 | // Created by Mohamed Afifi on 6/27/15. 6 | // Copyright (c) 2015 CocoaPods. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CustomCollectionViewCell: UICollectionViewCell { 12 | 13 | @IBOutlet weak var imageView: UIImageView! 14 | @IBOutlet weak var label: UILabel! 15 | } 16 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example/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 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /PagedHorizontalView-Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // PagedHorizontalView 4 | // 5 | // Created by Mohamed Afifi on 06/27/2015. 6 | // Copyright (c) 06/27/2015 Mohamed Afifi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import PagedHorizontalView 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet weak var horizontalView: PagedHorizontalView! 15 | 16 | let items: [(image: String, label: String)] = [ 17 | ("1", "The first image from space"), 18 | ("2", "The second image from space"), 19 | ("3", "The third image from space"), 20 | ("4", "The fourth image from space"), 21 | ("5", "The fifth image from space")] 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | // horizontalView.pageControl?.numberOfPages = items.count 27 | } 28 | } 29 | 30 | extension ViewController : UICollectionViewDataSource { 31 | 32 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 33 | return items.count 34 | } 35 | 36 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 37 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as! CustomCollectionViewCell 38 | let item = items[(indexPath as NSIndexPath).item] 39 | cell.imageView.image = UIImage(named: item.image) 40 | cell.label.text = item.label 41 | return cell 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /PagedHorizontalView.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint PagedHorizontalView.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "PagedHorizontalView" 12 | s.version = "2.0.0" 13 | s.summary = "A horizontal scroller with optional pageControl and/or next and previous buttons" 14 | s.description = <<-DESC 15 | A horizontal scoller view that makes its collection view cells full screen 16 | and can optionally wire UIPageControl and a previous and next UIbuttons. 17 | 18 | It doesn't affect the appearance of the controls and doesn't implement the collection view data source to keep full flexibility while doing the repeated work for a horizontal scroller. 19 | DESC 20 | s.homepage = "https://github.com/mohamede1945/PagedHorizontalView" 21 | # s.screenshots = "https://github.com/mohamede1945/PagedHorizontalView/raw/master/screenshots/demo.gif" 22 | s.license = 'MIT' 23 | s.author = { "Mohamed Afifi" => "mohamede1945" } 24 | s.source = { :git => "https://github.com/mohamede1945/PagedHorizontalView.git", :tag => s.version.to_s } 25 | # s.social_media_url = 'https://twitter.com/mohamede1945' 26 | 27 | s.platform = :ios, '8.0' 28 | s.requires_arc = true 29 | 30 | s.source_files = 'PagedHorizontalView/**/*' 31 | 32 | end 33 | -------------------------------------------------------------------------------- /PagedHorizontalView/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /PagedHorizontalView/PagedHorizontalView.h: -------------------------------------------------------------------------------- 1 | // 2 | // PagedHorizontalView.h 3 | // PagedHorizontalView 4 | // 5 | // Created by Mohamed Afifi on 10/9/16. 6 | // Copyright © 2016 Varaw. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for PagedHorizontalView. 12 | FOUNDATION_EXPORT double PagedHorizontalViewVersionNumber; 13 | 14 | //! Project version string for PagedHorizontalView. 15 | FOUNDATION_EXPORT const unsigned char PagedHorizontalViewVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /PagedHorizontalView/PagedHorizontalView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PagedHorizontalView.swift 3 | // PagedHorizontalView 4 | // 5 | // Created by mohamede1945 on 6/20/15. 6 | // Copyright (c) 2015 Varaw. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /** 12 | Represents a horizontal scoller view that makes its collection view cells full screen 13 | and can optionally wire UIPageControl and a previous and next UIButtons. 14 | 15 | It doesn't affect the appearance of the controls and doesn't implement the collection view data source 16 | to keep full flexibility while doing the repeated work for a horizontal scroller. 17 | 18 | @author mohamede1945 19 | 20 | @version 1.0 21 | */ 22 | open class PagedHorizontalView: UIView { 23 | 24 | /// Represents the page control property. 25 | @IBOutlet open weak var pageControl: UIPageControl? { 26 | didSet { 27 | pageControl?.addTarget(self, action: #selector(PagedHorizontalView.pageChanged(_:)), for: .valueChanged) 28 | } 29 | } 30 | 31 | /// Represents the next button property. 32 | @IBOutlet open weak var nextButton: UIButton? { 33 | didSet { 34 | nextButton?.addTarget(self, action: #selector(PagedHorizontalView.goToNextPage(_:)), for: .touchUpInside) 35 | } 36 | } 37 | 38 | /// Represents the previous button property. 39 | @IBOutlet open weak var previousButton: UIButton? { 40 | didSet { 41 | previousButton?.addTarget(self, action: #selector(PagedHorizontalView.goToPreviousPage(_:)), for: .touchUpInside) 42 | } 43 | } 44 | 45 | /// Represents the collection view property. 46 | @IBOutlet open weak var collectionView: UICollectionView! { 47 | didSet { 48 | assert(collectionView.collectionViewLayout is UICollectionViewFlowLayout, 49 | "collectionViewLayout should be of type 'UICollectionViewFlowLayout'") 50 | let flowLayout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout 51 | flowLayout.scrollDirection = .horizontal 52 | flowLayout.minimumInteritemSpacing = 0 53 | flowLayout.minimumLineSpacing = 0 54 | 55 | collectionView.isPagingEnabled = true 56 | collectionView.showsHorizontalScrollIndicator = false 57 | collectionView.delegate = self 58 | } 59 | } 60 | 61 | /// whether or not dragging has ended 62 | fileprivate var endDragging = false 63 | 64 | /// the current page 65 | @objc open dynamic var currentIndex: Int = 0 { 66 | didSet { 67 | updateAccessoryViews() 68 | } 69 | } 70 | 71 | /** 72 | Currnet page changed. 73 | 74 | - parameter sender: the page control of the action. 75 | */ 76 | @IBAction open func pageChanged(_ sender: UIPageControl) { 77 | moveToPage(sender.currentPage, animated: true) 78 | } 79 | 80 | /** 81 | Go to next page. 82 | 83 | - parameter sender: The sender of the action parameter. 84 | */ 85 | @IBAction open func goToNextPage(_ sender: AnyObject) { 86 | moveToPage(currentIndex + 1, animated: true) 87 | } 88 | 89 | /** 90 | Go to previous page. 91 | 92 | - parameter sender: The sender of the action parameter. 93 | */ 94 | @IBAction open func goToPreviousPage(_ sender: AnyObject) { 95 | moveToPage(currentIndex - 1, animated: true) 96 | } 97 | 98 | /** 99 | Move to a specific page. 100 | 101 | - parameter page: The page parameter. 102 | - parameter animated: The animated parameter to control whether the transition should be animated or not. 103 | */ 104 | open func moveToPage(_ page: Int, animated: Bool) { 105 | // outside the range 106 | if page < 0 || page >= collectionView.numberOfItems(inSection: 0) { 107 | return 108 | } 109 | 110 | currentIndex = page 111 | collectionView.scrollToItem(at: IndexPath(item: currentIndex, section: 0), 112 | at: .left, animated: animated) 113 | } 114 | 115 | override open func layoutSubviews() { 116 | super.layoutSubviews() 117 | collectionView.performBatchUpdates(nil, completion: nil) 118 | moveToPage(currentIndex, animated: false) 119 | } 120 | 121 | /** 122 | Update accessory views (i.e. UIPageControl, UIButtons). 123 | */ 124 | func updateAccessoryViews() { 125 | pageControl?.numberOfPages = collectionView.numberOfItems(inSection: 0) 126 | pageControl?.currentPage = currentIndex 127 | nextButton?.isEnabled = currentIndex < collectionView.numberOfItems(inSection: 0) - 1 128 | previousButton?.isEnabled = currentIndex > 0 129 | } 130 | } 131 | 132 | 133 | extension PagedHorizontalView : UICollectionViewDelegateFlowLayout { 134 | 135 | /** 136 | size of the collection view 137 | 138 | - parameter collectionView: the collection view 139 | - parameter collectionViewLayout: the collection view flow layout 140 | - parameter indexPath: the index path 141 | */ 142 | public func collectionView(_ collectionView: UICollectionView, 143 | layout collectionViewLayout: UICollectionViewLayout, 144 | sizeForItemAt indexPath: IndexPath) -> CGSize { 145 | return collectionView.bounds.size 146 | } 147 | 148 | /** 149 | scroll view did end dragging 150 | 151 | - parameter scrollView: the scroll view 152 | - parameter decelerate: wether the view is decelerating or not. 153 | */ 154 | public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) { 155 | if !decelerate { 156 | endScrolling(scrollView) 157 | } else { 158 | endDragging = true 159 | } 160 | } 161 | 162 | /** 163 | Scroll view did end decelerating 164 | */ 165 | public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { 166 | if endDragging { 167 | endDragging = false 168 | endScrolling(scrollView) 169 | } 170 | } 171 | 172 | /** 173 | end scrolling 174 | */ 175 | fileprivate func endScrolling(_ scrollView: UIScrollView) { 176 | let width = scrollView.bounds.width 177 | let page = (scrollView.contentOffset.x + (0.5 * width)) / width 178 | currentIndex = Int(page) 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PagedHorizontalView 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/PagedHorizontalView.svg?style=flat)](http://cocoapods.org/pods/PagedHorizontalView) 4 | [![License](https://img.shields.io/cocoapods/l/PagedHorizontalView.svg?style=flat)](http://cocoapods.org/pods/PagedHorizontalView) 5 | [![Platform](https://img.shields.io/cocoapods/p/PagedHorizontalView.svg?style=flat)](http://cocoapods.org/pods/PagedHorizontalView) 6 | 7 | **Supports Swift 3** 8 | 9 | A horizontal scoller view that makes its collection view cells full screen 10 | and can optionally wire UIPageControl and a previous and next UIbuttons. 11 | 12 | It doesn't affect the appearance of the controls and doesn't implement the collection view data source to keep full flexibility while doing the repeated work for a horizontal scroller. 13 | 14 | ## Requirements 15 | 16 | - iOS 7.0+ / Mac OS X 10.9+ 17 | - Xcode 8.0 18 | - Swift 3.0 19 | 20 | ## Usage 21 | 22 | ###### Interface builder: 23 | 24 | 1. Drag and drop a `UIView`. 25 | 2. Change the class name to `PagedHorizontalView` from identity inspector. 26 | ![Step 2](screenshots/step1.png) 27 | 3. Drag and drop a `UICollectionView`, use the defaults. 28 | 4. Optionally drag and drop a `UIPageControl` 29 | 5. Optionally drag and drop 2 `UIButtons` for next and previous 30 | 4. Wire the `UICollectionView` to the `PagedHorizontalView` 31 | ![Step 4](screenshots/step2.gif) 32 | 5. Wire the `UIPageControl` to the `PagedHorizontalView` either the reference outlet `pageControl` or the `pageChanged:` action. But not both. 33 | 6. Wire the 2 `UIButtons` either the reference outlet `nextButton` and `previousButton` or touch up inside action with `goToNextPage` and `goToPreviousPage`. But not both, wiring the action and the reference outlet will give unexpected behavior. 34 | 35 | ###### Programmatically: 36 | Alternatively, you can create it from code just as you create a normal UIView 37 | and set the properties instead of wiring them as described above for `collectionView`, `pageControl`, etc. 38 | 39 | You need to set a layout object of kind `UICollectionViewFlowLayout` for the `UICollectionView`. 40 | 41 | ### IMPORTANT 42 | In both cases programmatically or using interface builder, you should set the `dataSource` for the `UICollectionView` yourself. This way, you have full flexibility to specify the layout of the scrolling content. 43 | 44 | ## Demo 45 | ![Step 4](screenshots/demo.gif) 46 | 47 | ## Installation 48 | 49 | **For iOS 8 or later:** 50 | 51 | PagedHorizontalView is available through [CocoaPods](http://cocoapods.org). To install 52 | it, simply add the following line to your Podfile: 53 | 54 | ```ruby 55 | pod "PagedHorizontalView" 56 | ``` 57 | 58 | **For iOS 7.x:** 59 | 60 | > Embedded frameworks require a minimum deployment target of iOS 8. 61 | 62 | To use PagedHorizontalView with a project targeting iOS 7, you must include PagedHorizontalView.swift directly into your project. 63 | 64 | ## Author 65 | 66 | Mohamed Afifi, mohamede1945@gmail.com 67 | 68 | ## License 69 | 70 | PagedHorizontalView is available under the MIT license. See the LICENSE file for more info. 71 | -------------------------------------------------------------------------------- /screenshots/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/screenshots/demo.gif -------------------------------------------------------------------------------- /screenshots/step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/screenshots/step1.png -------------------------------------------------------------------------------- /screenshots/step2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mohamede1945/PagedHorizontalView/f52867038d485892261b529e93e09566381eccfc/screenshots/step2.gif --------------------------------------------------------------------------------