├── .gitignore ├── DDScrollViewController Example ├── DDScrollViewController Example.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── Hirat.xcuserdatad │ │ └── xcschemes │ │ ├── DDScrollViewController Example.xcscheme │ │ └── xcschememanagement.plist └── DDScrollViewController Example │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Classes │ └── Controllers │ │ ├── DemoTableViewController.h │ │ ├── DemoTableViewController.m │ │ ├── HomeViewController.h │ │ └── HomeViewController.m │ ├── DDScrollViewController Example-Info.plist │ ├── DDScrollViewController Example-Prefix.pch │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json │ ├── en.lproj │ └── InfoPlist.strings │ ├── iPhone.storyboard │ └── main.m ├── DDScrollViewController.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── Hirat.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── DDScrollViewController ├── DDScrollViewController.h └── DDScrollViewController.m └── README.md /.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 | *.moved-aside 17 | DerivedData 18 | *.hmap 19 | *.xccheckout 20 | project.xcworkspace 21 | Pods/ 22 | 23 | # Documentation 24 | docs/docset-installed.txt 25 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 73E86F35182CA1F500D79286 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73E86F34182CA1F500D79286 /* Foundation.framework */; }; 11 | 73E86F37182CA1F500D79286 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73E86F36182CA1F500D79286 /* CoreGraphics.framework */; }; 12 | 73E86F39182CA1F500D79286 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 73E86F38182CA1F500D79286 /* UIKit.framework */; }; 13 | 73E86F3F182CA1F500D79286 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 73E86F3D182CA1F500D79286 /* InfoPlist.strings */; }; 14 | 73E86F41182CA1F500D79286 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73E86F40182CA1F500D79286 /* main.m */; }; 15 | 73E86F45182CA1F500D79286 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73E86F44182CA1F500D79286 /* AppDelegate.m */; }; 16 | 73E86F47182CA1F500D79286 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 73E86F46182CA1F500D79286 /* Images.xcassets */; }; 17 | 73E86F70182CA45700D79286 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73E86F6F182CA45700D79286 /* HomeViewController.m */; }; 18 | 73E86F72182CA46800D79286 /* iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73E86F71182CA46800D79286 /* iPhone.storyboard */; }; 19 | A13CADFB19B4131B00C44284 /* DDScrollViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A13CADF919B4131B00C44284 /* DDScrollViewController.m */; }; 20 | A13CADFE19B4149F00C44284 /* DemoTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A13CADFD19B4149F00C44284 /* DemoTableViewController.m */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 73E86F31182CA1F500D79286 /* DDScrollViewController Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DDScrollViewController Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 73E86F34182CA1F500D79286 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 26 | 73E86F36182CA1F500D79286 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 27 | 73E86F38182CA1F500D79286 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28 | 73E86F3C182CA1F500D79286 /* DDScrollViewController Example-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DDScrollViewController Example-Info.plist"; sourceTree = ""; }; 29 | 73E86F3E182CA1F500D79286 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 30 | 73E86F40182CA1F500D79286 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 31 | 73E86F42182CA1F500D79286 /* DDScrollViewController Example-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DDScrollViewController Example-Prefix.pch"; sourceTree = ""; }; 32 | 73E86F43182CA1F500D79286 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 33 | 73E86F44182CA1F500D79286 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 34 | 73E86F46182CA1F500D79286 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 35 | 73E86F4D182CA1F500D79286 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 36 | 73E86F6E182CA45700D79286 /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = ""; }; 37 | 73E86F6F182CA45700D79286 /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = ""; }; 38 | 73E86F71182CA46800D79286 /* iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = iPhone.storyboard; sourceTree = ""; }; 39 | A13CADF819B4131B00C44284 /* DDScrollViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DDScrollViewController.h; sourceTree = ""; }; 40 | A13CADF919B4131B00C44284 /* DDScrollViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDScrollViewController.m; sourceTree = ""; }; 41 | A13CADFC19B4149F00C44284 /* DemoTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DemoTableViewController.h; sourceTree = ""; }; 42 | A13CADFD19B4149F00C44284 /* DemoTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DemoTableViewController.m; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 73E86F2E182CA1F500D79286 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | 73E86F37182CA1F500D79286 /* CoreGraphics.framework in Frameworks */, 51 | 73E86F39182CA1F500D79286 /* UIKit.framework in Frameworks */, 52 | 73E86F35182CA1F500D79286 /* Foundation.framework in Frameworks */, 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 73E86F28182CA1F500D79286 = { 60 | isa = PBXGroup; 61 | children = ( 62 | A13CADFA19B4131B00C44284 /* DDScrollViewController */, 63 | 73E86F3A182CA1F500D79286 /* DDScrollViewController Example */, 64 | 73E86F33182CA1F500D79286 /* Frameworks */, 65 | 73E86F32182CA1F500D79286 /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | 73E86F32182CA1F500D79286 /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 73E86F31182CA1F500D79286 /* DDScrollViewController Example.app */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | 73E86F33182CA1F500D79286 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 73E86F34182CA1F500D79286 /* Foundation.framework */, 81 | 73E86F36182CA1F500D79286 /* CoreGraphics.framework */, 82 | 73E86F38182CA1F500D79286 /* UIKit.framework */, 83 | 73E86F4D182CA1F500D79286 /* XCTest.framework */, 84 | ); 85 | name = Frameworks; 86 | sourceTree = ""; 87 | }; 88 | 73E86F3A182CA1F500D79286 /* DDScrollViewController Example */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 73E86F43182CA1F500D79286 /* AppDelegate.h */, 92 | 73E86F44182CA1F500D79286 /* AppDelegate.m */, 93 | 73E86F71182CA46800D79286 /* iPhone.storyboard */, 94 | 73E86F46182CA1F500D79286 /* Images.xcassets */, 95 | 73E86F6C182CA44000D79286 /* Classes */, 96 | 73E86F3B182CA1F500D79286 /* Supporting Files */, 97 | ); 98 | path = "DDScrollViewController Example"; 99 | sourceTree = ""; 100 | }; 101 | 73E86F3B182CA1F500D79286 /* Supporting Files */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 73E86F3C182CA1F500D79286 /* DDScrollViewController Example-Info.plist */, 105 | 73E86F3D182CA1F500D79286 /* InfoPlist.strings */, 106 | 73E86F40182CA1F500D79286 /* main.m */, 107 | 73E86F42182CA1F500D79286 /* DDScrollViewController Example-Prefix.pch */, 108 | ); 109 | name = "Supporting Files"; 110 | sourceTree = ""; 111 | }; 112 | 73E86F6C182CA44000D79286 /* Classes */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 73E86F6D182CA44000D79286 /* Controllers */, 116 | ); 117 | path = Classes; 118 | sourceTree = ""; 119 | }; 120 | 73E86F6D182CA44000D79286 /* Controllers */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 73E86F6E182CA45700D79286 /* HomeViewController.h */, 124 | 73E86F6F182CA45700D79286 /* HomeViewController.m */, 125 | A13CADFC19B4149F00C44284 /* DemoTableViewController.h */, 126 | A13CADFD19B4149F00C44284 /* DemoTableViewController.m */, 127 | ); 128 | path = Controllers; 129 | sourceTree = ""; 130 | }; 131 | A13CADFA19B4131B00C44284 /* DDScrollViewController */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | A13CADF819B4131B00C44284 /* DDScrollViewController.h */, 135 | A13CADF919B4131B00C44284 /* DDScrollViewController.m */, 136 | ); 137 | name = DDScrollViewController; 138 | path = ../DDScrollViewController; 139 | sourceTree = ""; 140 | }; 141 | /* End PBXGroup section */ 142 | 143 | /* Begin PBXNativeTarget section */ 144 | 73E86F30182CA1F500D79286 /* DDScrollViewController Example */ = { 145 | isa = PBXNativeTarget; 146 | buildConfigurationList = 73E86F5D182CA1F500D79286 /* Build configuration list for PBXNativeTarget "DDScrollViewController Example" */; 147 | buildPhases = ( 148 | 73E86F2D182CA1F500D79286 /* Sources */, 149 | 73E86F2E182CA1F500D79286 /* Frameworks */, 150 | 73E86F2F182CA1F500D79286 /* Resources */, 151 | ); 152 | buildRules = ( 153 | ); 154 | dependencies = ( 155 | ); 156 | name = "DDScrollViewController Example"; 157 | productName = "DDScrollViewController Example"; 158 | productReference = 73E86F31182CA1F500D79286 /* DDScrollViewController Example.app */; 159 | productType = "com.apple.product-type.application"; 160 | }; 161 | /* End PBXNativeTarget section */ 162 | 163 | /* Begin PBXProject section */ 164 | 73E86F29182CA1F500D79286 /* Project object */ = { 165 | isa = PBXProject; 166 | attributes = { 167 | LastUpgradeCheck = 0500; 168 | ORGANIZATIONNAME = Hirat; 169 | }; 170 | buildConfigurationList = 73E86F2C182CA1F500D79286 /* Build configuration list for PBXProject "DDScrollViewController Example" */; 171 | compatibilityVersion = "Xcode 3.2"; 172 | developmentRegion = English; 173 | hasScannedForEncodings = 0; 174 | knownRegions = ( 175 | en, 176 | ); 177 | mainGroup = 73E86F28182CA1F500D79286; 178 | productRefGroup = 73E86F32182CA1F500D79286 /* Products */; 179 | projectDirPath = ""; 180 | projectRoot = ""; 181 | targets = ( 182 | 73E86F30182CA1F500D79286 /* DDScrollViewController Example */, 183 | ); 184 | }; 185 | /* End PBXProject section */ 186 | 187 | /* Begin PBXResourcesBuildPhase section */ 188 | 73E86F2F182CA1F500D79286 /* Resources */ = { 189 | isa = PBXResourcesBuildPhase; 190 | buildActionMask = 2147483647; 191 | files = ( 192 | 73E86F3F182CA1F500D79286 /* InfoPlist.strings in Resources */, 193 | 73E86F72182CA46800D79286 /* iPhone.storyboard in Resources */, 194 | 73E86F47182CA1F500D79286 /* Images.xcassets in Resources */, 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXSourcesBuildPhase section */ 201 | 73E86F2D182CA1F500D79286 /* Sources */ = { 202 | isa = PBXSourcesBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | 73E86F45182CA1F500D79286 /* AppDelegate.m in Sources */, 206 | 73E86F41182CA1F500D79286 /* main.m in Sources */, 207 | A13CADFE19B4149F00C44284 /* DemoTableViewController.m in Sources */, 208 | A13CADFB19B4131B00C44284 /* DDScrollViewController.m in Sources */, 209 | 73E86F70182CA45700D79286 /* HomeViewController.m in Sources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | /* End PBXSourcesBuildPhase section */ 214 | 215 | /* Begin PBXVariantGroup section */ 216 | 73E86F3D182CA1F500D79286 /* InfoPlist.strings */ = { 217 | isa = PBXVariantGroup; 218 | children = ( 219 | 73E86F3E182CA1F500D79286 /* en */, 220 | ); 221 | name = InfoPlist.strings; 222 | sourceTree = ""; 223 | }; 224 | /* End PBXVariantGroup section */ 225 | 226 | /* Begin XCBuildConfiguration section */ 227 | 73E86F5B182CA1F500D79286 /* Debug */ = { 228 | isa = XCBuildConfiguration; 229 | buildSettings = { 230 | ALWAYS_SEARCH_USER_PATHS = NO; 231 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 232 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 233 | CLANG_CXX_LIBRARY = "libc++"; 234 | CLANG_ENABLE_MODULES = YES; 235 | CLANG_ENABLE_OBJC_ARC = YES; 236 | CLANG_WARN_BOOL_CONVERSION = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 239 | CLANG_WARN_EMPTY_BODY = YES; 240 | CLANG_WARN_ENUM_CONVERSION = YES; 241 | CLANG_WARN_INT_CONVERSION = YES; 242 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 245 | COPY_PHASE_STRIP = NO; 246 | GCC_C_LANGUAGE_STANDARD = gnu99; 247 | GCC_DYNAMIC_NO_PIC = NO; 248 | GCC_OPTIMIZATION_LEVEL = 0; 249 | GCC_PREPROCESSOR_DEFINITIONS = ( 250 | "DEBUG=1", 251 | "$(inherited)", 252 | ); 253 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 254 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 255 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 256 | GCC_WARN_UNDECLARED_SELECTOR = YES; 257 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 258 | GCC_WARN_UNUSED_FUNCTION = YES; 259 | GCC_WARN_UNUSED_VARIABLE = YES; 260 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 261 | ONLY_ACTIVE_ARCH = YES; 262 | SDKROOT = iphoneos; 263 | }; 264 | name = Debug; 265 | }; 266 | 73E86F5C182CA1F500D79286 /* Release */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ALWAYS_SEARCH_USER_PATHS = NO; 270 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 271 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 272 | CLANG_CXX_LIBRARY = "libc++"; 273 | CLANG_ENABLE_MODULES = YES; 274 | CLANG_ENABLE_OBJC_ARC = YES; 275 | CLANG_WARN_BOOL_CONVERSION = YES; 276 | CLANG_WARN_CONSTANT_CONVERSION = YES; 277 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 278 | CLANG_WARN_EMPTY_BODY = YES; 279 | CLANG_WARN_ENUM_CONVERSION = YES; 280 | CLANG_WARN_INT_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = YES; 285 | ENABLE_NS_ASSERTIONS = NO; 286 | GCC_C_LANGUAGE_STANDARD = gnu99; 287 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 288 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 289 | GCC_WARN_UNDECLARED_SELECTOR = YES; 290 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 291 | GCC_WARN_UNUSED_FUNCTION = YES; 292 | GCC_WARN_UNUSED_VARIABLE = YES; 293 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 294 | SDKROOT = iphoneos; 295 | VALIDATE_PRODUCT = YES; 296 | }; 297 | name = Release; 298 | }; 299 | 73E86F5E182CA1F500D79286 /* Debug */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 303 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 304 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 305 | GCC_PREFIX_HEADER = "DDScrollViewController Example/DDScrollViewController Example-Prefix.pch"; 306 | INFOPLIST_FILE = "DDScrollViewController Example/DDScrollViewController Example-Info.plist"; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | WRAPPER_EXTENSION = app; 309 | }; 310 | name = Debug; 311 | }; 312 | 73E86F5F182CA1F500D79286 /* Release */ = { 313 | isa = XCBuildConfiguration; 314 | buildSettings = { 315 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 316 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 317 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 318 | GCC_PREFIX_HEADER = "DDScrollViewController Example/DDScrollViewController Example-Prefix.pch"; 319 | INFOPLIST_FILE = "DDScrollViewController Example/DDScrollViewController Example-Info.plist"; 320 | PRODUCT_NAME = "$(TARGET_NAME)"; 321 | WRAPPER_EXTENSION = app; 322 | }; 323 | name = Release; 324 | }; 325 | /* End XCBuildConfiguration section */ 326 | 327 | /* Begin XCConfigurationList section */ 328 | 73E86F2C182CA1F500D79286 /* Build configuration list for PBXProject "DDScrollViewController Example" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | 73E86F5B182CA1F500D79286 /* Debug */, 332 | 73E86F5C182CA1F500D79286 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | 73E86F5D182CA1F500D79286 /* Build configuration list for PBXNativeTarget "DDScrollViewController Example" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | 73E86F5E182CA1F500D79286 /* Debug */, 341 | 73E86F5F182CA1F500D79286 /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | /* End XCConfigurationList section */ 347 | }; 348 | rootObject = 73E86F29182CA1F500D79286 /* Project object */; 349 | } 350 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example.xcodeproj/xcuserdata/Hirat.xcuserdatad/xcschemes/DDScrollViewController Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example.xcodeproj/xcuserdata/Hirat.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DDScrollViewController Example.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 73E86F30182CA1F500D79286 16 | 17 | primary 18 | 19 | 20 | 73E86F4B182CA1F500D79286 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DDScrollViewController Example 4 | // 5 | // Created by Hirat on 13-11-8. 6 | // Copyright (c) 2013年 Hirat. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DDScrollViewController Example 4 | // 5 | // Created by Hirat on 13-11-8. 6 | // Copyright (c) 2013年 Hirat. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @implementation AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | return YES; 16 | } 17 | 18 | - (void)applicationWillResignActive:(UIApplication *)application 19 | { 20 | // 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. 21 | // 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. 22 | } 23 | 24 | - (void)applicationDidEnterBackground:(UIApplication *)application 25 | { 26 | // 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. 27 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 28 | } 29 | 30 | - (void)applicationWillEnterForeground:(UIApplication *)application 31 | { 32 | // 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. 33 | } 34 | 35 | - (void)applicationDidBecomeActive:(UIApplication *)application 36 | { 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 | - (void)applicationWillTerminate:(UIApplication *)application 41 | { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/Classes/Controllers/DemoTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DemoTableViewController.h 3 | // DDScrollViewController Example 4 | // 5 | // Created by Hirat on 14-9-1. 6 | // Copyright (c) 2014年 Hirat. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DemoTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/Classes/Controllers/DemoTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DemoTableViewController.m 3 | // DDScrollViewController Example 4 | // 5 | // Created by Hirat on 14-9-1. 6 | // Copyright (c) 2014年 Hirat. All rights reserved. 7 | // 8 | 9 | #import "DemoTableViewController.h" 10 | 11 | @interface DemoTableViewController () 12 | 13 | @end 14 | 15 | @implementation DemoTableViewController 16 | 17 | - (id)initWithStyle:(UITableViewStyle)style 18 | { 19 | self = [super initWithStyle:style]; 20 | if (self) { 21 | // Custom initialization 22 | } 23 | return self; 24 | } 25 | 26 | - (void)viewDidLoad 27 | { 28 | [super viewDidLoad]; 29 | 30 | // Uncomment the following line to preserve selection between presentations. 31 | // self.clearsSelectionOnViewWillAppear = NO; 32 | 33 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 34 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 35 | } 36 | 37 | - (void)didReceiveMemoryWarning 38 | { 39 | [super didReceiveMemoryWarning]; 40 | // Dispose of any resources that can be recreated. 41 | } 42 | 43 | #pragma mark - Table view data source 44 | 45 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 46 | { 47 | return 10; 48 | } 49 | 50 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 51 | { 52 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @"DemoTableViewCell" forIndexPath:indexPath]; 53 | 54 | cell.textLabel.text = [NSString stringWithFormat: @"(%d, %d)", indexPath.section, indexPath.row]; 55 | 56 | return cell; 57 | } 58 | 59 | /* 60 | // Override to support conditional editing of the table view. 61 | - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 62 | { 63 | // Return NO if you do not want the specified item to be editable. 64 | return YES; 65 | } 66 | */ 67 | 68 | /* 69 | // Override to support editing the table view. 70 | - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath 71 | { 72 | if (editingStyle == UITableViewCellEditingStyleDelete) { 73 | // Delete the row from the data source 74 | [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; 75 | } else if (editingStyle == UITableViewCellEditingStyleInsert) { 76 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 77 | } 78 | } 79 | */ 80 | 81 | /* 82 | // Override to support rearranging the table view. 83 | - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath 84 | { 85 | } 86 | */ 87 | 88 | /* 89 | // Override to support conditional rearranging of the table view. 90 | - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath 91 | { 92 | // Return NO if you do not want the item to be re-orderable. 93 | return YES; 94 | } 95 | */ 96 | 97 | /* 98 | #pragma mark - Navigation 99 | 100 | // In a storyboard-based application, you will often want to do a little preparation before navigation 101 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 102 | { 103 | // Get the new view controller using [segue destinationViewController]. 104 | // Pass the selected object to the new view controller. 105 | } 106 | */ 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/Classes/Controllers/HomeViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.h 3 | // DDScrollViewController Example 4 | // 5 | // Created by Hirat on 13-11-8. 6 | // Copyright (c) 2013年 Hirat. All rights reserved. 7 | // 8 | 9 | #import "DDScrollViewController.h" 10 | 11 | @interface HomeViewController : DDScrollViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/Classes/Controllers/HomeViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeViewController.m 3 | // DDScrollViewController Example 4 | // 5 | // Created by Hirat on 13-11-8. 6 | // Copyright (c) 2013年 Hirat. All rights reserved. 7 | // 8 | 9 | #import "HomeViewController.h" 10 | 11 | @interface HomeViewController () 12 | @property (nonatomic, strong) NSMutableArray* viewControllerArray; 13 | @end 14 | 15 | @implementation HomeViewController 16 | 17 | - (void)viewDidLoad 18 | { 19 | self.dataSource = self; 20 | 21 | [super viewDidLoad]; 22 | } 23 | 24 | - (void)awakeFromNib 25 | { 26 | NSUInteger numberOfPages = 5; 27 | self.viewControllerArray = [[NSMutableArray alloc] initWithCapacity:numberOfPages]; 28 | for (NSUInteger k = 0; k < numberOfPages; ++k) 29 | { 30 | [self.viewControllerArray addObject:[NSNull null]]; 31 | } 32 | 33 | [self.viewControllerArray replaceObjectAtIndex: 0 withObject: [self.storyboard instantiateViewControllerWithIdentifier:@"Top1"]]; 34 | [self.viewControllerArray replaceObjectAtIndex: 1 withObject: [self.storyboard instantiateViewControllerWithIdentifier:@"Top2"]]; 35 | [self.viewControllerArray replaceObjectAtIndex: 2 withObject: [self.storyboard instantiateViewControllerWithIdentifier:@"Top3"]]; 36 | [self.viewControllerArray replaceObjectAtIndex: 3 withObject: [self.storyboard instantiateViewControllerWithIdentifier:@"Top4"]]; 37 | [self.viewControllerArray replaceObjectAtIndex: 4 withObject: [self.storyboard instantiateViewControllerWithIdentifier:@"Top5"]]; 38 | } 39 | 40 | #pragma mark - DDScrollViewDataSource 41 | 42 | - (NSUInteger)numberOfViewControllerInDDScrollView:(DDScrollViewController *)DDScrollView 43 | { 44 | return [self.viewControllerArray count]; 45 | } 46 | 47 | - (UIViewController*)ddScrollView:(DDScrollViewController *)ddScrollView contentViewControllerAtIndex:(NSUInteger)index 48 | { 49 | return [self.viewControllerArray objectAtIndex:index]; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/DDScrollViewController Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.diandian.hirat.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | iPhone 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/DDScrollViewController Example-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/iPhone.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 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /DDScrollViewController Example/DDScrollViewController Example/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DDScrollViewController Example 4 | // 5 | // Created by Hirat on 13-11-8. 6 | // Copyright (c) 2013年 Hirat. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DDScrollViewController.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DDScrollViewController.xcworkspace/xcuserdata/Hirat.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hirat/DDScrollViewController/46f5867bf637750f91e7cc672d0affc8944f9a55/DDScrollViewController.xcworkspace/xcuserdata/Hirat.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DDScrollViewController.xcworkspace/xcuserdata/Hirat.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DDScrollViewController/DDScrollViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DDScrollViewController.h 3 | // 4 | // 5 | // Created by Hirat on 13-11-8. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @protocol DDScrollViewDataSource; 12 | 13 | @interface DDScrollViewController : UIViewController 14 | @property (nonatomic, weak) id dataSource; 15 | 16 | - (void)reloadData; 17 | @end 18 | 19 | 20 | #pragma mark - dataSource 21 | @protocol DDScrollViewDataSource 22 | 23 | - (NSUInteger)numberOfViewControllerInDDScrollView:(DDScrollViewController*)DDScrollView; 24 | - (UIViewController *)ddScrollView:(DDScrollViewController*)ddScrollView contentViewControllerAtIndex:(NSUInteger)index; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DDScrollViewController/DDScrollViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DDScrollViewController.m 3 | // 4 | // 5 | // Created by Hirat on 13-11-8. 6 | // 7 | // 8 | 9 | #import "DDScrollViewController.h" 10 | 11 | @interface DDScrollViewController () 12 | @property UIScrollView *scrollView; 13 | @property NSMutableArray *contents; 14 | @property (nonatomic) CGFloat offsetRatio; 15 | @property (nonatomic) NSInteger activeIndex; 16 | @end 17 | 18 | @implementation DDScrollViewController 19 | 20 | - (void)viewDidLoad 21 | { 22 | [super viewDidLoad]; 23 | 24 | [self initControl]; 25 | 26 | [self reloadData]; 27 | } 28 | 29 | - (void)initControl 30 | { 31 | self.contents = [[NSMutableArray alloc] init]; 32 | for (int i = 0; i < 3; i ++) 33 | { 34 | [self.contents addObject:[NSNull null]]; 35 | } 36 | 37 | self.scrollView = [[UIScrollView alloc] initWithFrame: self.view.bounds]; 38 | self.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.view.frame) * 3, CGRectGetHeight(self.view.frame)); 39 | self.scrollView.backgroundColor = [UIColor clearColor]; 40 | self.scrollView.pagingEnabled = YES; 41 | self.scrollView.showsHorizontalScrollIndicator = NO; 42 | self.scrollView.showsVerticalScrollIndicator = NO; 43 | self.scrollView.delegate = self; 44 | [self.view addSubview: self.scrollView]; 45 | } 46 | 47 | #pragma mark - 48 | 49 | - (void)reloadData 50 | { 51 | [self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; 52 | 53 | for (int i = 0; i < 3; i ++) 54 | { 55 | NSInteger thisPage = [self validIndexValue: self.activeIndex - 1 + i]; 56 | [self.contents replaceObjectAtIndex: i withObject:[self.dataSource ddScrollView:self contentViewControllerAtIndex:thisPage]]; 57 | } 58 | 59 | for (int i = 0; i < 3; i++) 60 | { 61 | UIViewController* viewController = [self.contents objectAtIndex:i]; 62 | UIView* view = viewController.view; 63 | view.userInteractionEnabled = YES; 64 | view.frame = self.view.bounds; 65 | view.frame = CGRectOffset(self.scrollView.frame, view.frame.size.width * i, 0); 66 | [self.scrollView addSubview: view]; 67 | } 68 | 69 | [self.scrollView setContentOffset:CGPointMake(self.scrollView.frame.size.width + self.scrollView.frame.size.width * self.offsetRatio, 0)]; 70 | } 71 | 72 | - (NSInteger)validIndexValue:(NSInteger)value 73 | { 74 | if(value == -1) 75 | { 76 | value = self.numberOfControllers - 1; 77 | } 78 | 79 | if(value == self.numberOfControllers) 80 | { 81 | value = 0; 82 | } 83 | 84 | return value; 85 | } 86 | 87 | - (void)setActiveIndex:(NSInteger)activeIndex 88 | { 89 | if (_activeIndex != activeIndex) 90 | { 91 | _activeIndex = activeIndex; 92 | [self reloadData]; 93 | } 94 | } 95 | 96 | - (NSInteger)numberOfControllers 97 | { 98 | return [self.dataSource numberOfViewControllerInDDScrollView:self]; 99 | } 100 | 101 | - (void)setOffsetRatio:(CGFloat)offsetRatio 102 | { 103 | if (_offsetRatio != offsetRatio) 104 | { 105 | _offsetRatio = offsetRatio; 106 | 107 | [self.scrollView setContentOffset:CGPointMake(self.scrollView.frame.size.width + self.scrollView.frame.size.width * offsetRatio, 0)]; 108 | if (offsetRatio > 0.5) 109 | { 110 | _offsetRatio = offsetRatio - 1; 111 | self.activeIndex = [self validIndexValue: self.activeIndex + 1]; 112 | } 113 | 114 | if (offsetRatio < -0.5) 115 | { 116 | _offsetRatio = offsetRatio + 1; 117 | self.activeIndex = [self validIndexValue: self.activeIndex - 1]; 118 | } 119 | } 120 | } 121 | 122 | #pragma mark - UIScrollViewDelegate 123 | 124 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 125 | { 126 | self.offsetRatio = scrollView.contentOffset.x/CGRectGetWidth(scrollView.frame) - 1; 127 | } 128 | 129 | @end 130 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DDScrollViewController 2 | ====================== 3 | 4 | 将多个ViewController加入到ScrollView中,支持循环滚动 5 | --------------------------------------------------------------------------------