├── .gitignore ├── DAAutoScroll ├── DAAutoScroll.h └── DAAutoScroll.m ├── DAAutoScrollExample ├── DAAutoScrollExample.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcuserdata │ │ └── danielamitay.xcuserdatad │ │ └── xcschemes │ │ ├── DAAutoScrollExample.xcscheme │ │ └── xcschememanagement.plist ├── DAAutoScrollExample │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── DAAutoScrollExample-Info.plist │ ├── DAAutoScrollExample-Prefix.pch │ ├── MasterViewController.h │ ├── MasterViewController.m │ ├── TableViewController.h │ ├── TableViewController.m │ ├── TableViewController.xib │ ├── TextViewController.h │ ├── TextViewController.m │ ├── TextViewController.xib │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── MasterViewController.xib │ └── main.m └── Default-568h@2x.png ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OS X 2 | *.DS_Store 3 | *.psd 4 | 5 | # Xcode 6 | *.pbxuser 7 | *.mode1v3 8 | *.mode2v3 9 | *.perspectivev3 10 | *.xcuserstate 11 | project.xcworkspace/ 12 | xcuserdata/ 13 | 14 | # Generated files 15 | build/ 16 | *.[oa] 17 | *.pyc 18 | 19 | # Backup files 20 | *~.nib 21 | / graphics/ -------------------------------------------------------------------------------- /DAAutoScroll/DAAutoScroll.h: -------------------------------------------------------------------------------- 1 | // 2 | // DAAutoScroll.h 3 | // DAAutoScroll 4 | // 5 | // Created by Daniel Amitay on 3/30/13. 6 | // Copyright (c) 2013 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIScrollView (DAAutoScroll) 12 | 13 | @property (nonatomic) CGFloat scrollPointsPerSecond; 14 | @property (nonatomic, getter = isScrolling) BOOL scrolling; 15 | 16 | - (void)startScrolling; 17 | - (void)stopScrolling; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DAAutoScroll/DAAutoScroll.m: -------------------------------------------------------------------------------- 1 | // 2 | // DAAutoScroll.m 3 | // DAAutoScroll 4 | // 5 | // Created by Daniel Amitay on 3/30/13. 6 | // Copyright (c) 2013 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import "DAAutoScroll.h" 10 | #import 11 | #import 12 | 13 | static CGFloat UIScrollViewDefaultScrollPointsPerSecond = 15.0f; 14 | static char UIScrollViewScrollPointsPerSecondNumber; 15 | static char UIScrollViewAutoScrollDisplayLink; 16 | 17 | @interface UIScrollView (DAAutoScroll_Internal) 18 | 19 | @property (nonatomic, strong) CADisplayLink *autoScrollDisplayLink; 20 | 21 | @end 22 | 23 | @implementation UIScrollView (DAAutoScroll) 24 | 25 | - (void)startScrolling 26 | { 27 | [self stopScrolling]; 28 | 29 | self.autoScrollDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(_displayTick:)]; 30 | [self.autoScrollDisplayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; 31 | } 32 | 33 | - (void)stopScrolling 34 | { 35 | [self.autoScrollDisplayLink invalidate]; 36 | self.autoScrollDisplayLink = nil; 37 | } 38 | 39 | - (void)_displayTick:(CADisplayLink *)displayLink 40 | { 41 | if (self.window == nil) { 42 | [self stopScrolling]; 43 | } 44 | 45 | CGFloat animationDuration = displayLink.duration; 46 | CGFloat pointChange = self.scrollPointsPerSecond * animationDuration; 47 | CGPoint newOffset = (CGPoint) { 48 | .x = self.contentOffset.x, 49 | .y = self.contentOffset.y + pointChange 50 | }; 51 | CGFloat maximumYOffset = self.contentSize.height - self.bounds.size.height; 52 | if (newOffset.y > maximumYOffset) { 53 | [self stopScrolling]; 54 | } else { 55 | self.contentOffset = newOffset; 56 | } 57 | } 58 | 59 | #pragma mark - Property Methods 60 | 61 | - (void)setScrolling:(BOOL)scrolling 62 | { 63 | if (scrolling) { 64 | [self startScrolling]; 65 | } else { 66 | [self stopScrolling]; 67 | } 68 | } 69 | 70 | - (BOOL)isScrolling 71 | { 72 | return (self.autoScrollDisplayLink != nil); 73 | } 74 | 75 | - (CGFloat)scrollPointsPerSecond 76 | { 77 | NSNumber *scrollPointsPerSecondNumber = objc_getAssociatedObject(self, &UIScrollViewScrollPointsPerSecondNumber); 78 | if (scrollPointsPerSecondNumber) { 79 | return [scrollPointsPerSecondNumber floatValue]; 80 | } else { 81 | return UIScrollViewDefaultScrollPointsPerSecond; 82 | } 83 | } 84 | 85 | - (void)setScrollPointsPerSecond:(CGFloat)scrollPointsPerSecond 86 | { 87 | [self willChangeValueForKey:@"scrollPointsPerSecond"]; 88 | objc_setAssociatedObject(self, 89 | &UIScrollViewScrollPointsPerSecondNumber, 90 | [NSNumber numberWithFloat:scrollPointsPerSecond], 91 | OBJC_ASSOCIATION_RETAIN_NONATOMIC); 92 | [self didChangeValueForKey:@"scrollPointsPerSecond"]; 93 | } 94 | 95 | - (CADisplayLink *)autoScrollDisplayLink 96 | { 97 | return objc_getAssociatedObject(self, &UIScrollViewAutoScrollDisplayLink); 98 | } 99 | 100 | - (void)setAutoScrollDisplayLink:(CADisplayLink *)autoScrollDisplayLink 101 | { 102 | [self willChangeValueForKey:@"autoScrollDisplayLink"]; 103 | objc_setAssociatedObject(self, 104 | &UIScrollViewAutoScrollDisplayLink, 105 | autoScrollDisplayLink, 106 | OBJC_ASSOCIATION_ASSIGN); 107 | [self didChangeValueForKey:@"autoScrollDisplayLink"]; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 631E3F421F530D5300FAA33F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 631E3F411F530D5300FAA33F /* QuartzCore.framework */; }; 11 | 639BEBD7173B427500BBA289 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 639BEBD6173B427500BBA289 /* Default-568h@2x.png */; }; 12 | 63DFB67814E9C6B100B050DA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63DFB67714E9C6B100B050DA /* UIKit.framework */; }; 13 | 63DFB67A14E9C6B100B050DA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63DFB67914E9C6B100B050DA /* Foundation.framework */; }; 14 | 63DFB67C14E9C6B100B050DA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63DFB67B14E9C6B100B050DA /* CoreGraphics.framework */; }; 15 | 63DFB68214E9C6B100B050DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 63DFB68014E9C6B100B050DA /* InfoPlist.strings */; }; 16 | 63DFB68414E9C6B100B050DA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 63DFB68314E9C6B100B050DA /* main.m */; }; 17 | 63DFB68814E9C6B100B050DA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 63DFB68714E9C6B100B050DA /* AppDelegate.m */; }; 18 | 63DFB68B14E9C6B100B050DA /* MasterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 63DFB68A14E9C6B100B050DA /* MasterViewController.m */; }; 19 | 63DFB69114E9C6B100B050DA /* MasterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63DFB68F14E9C6B100B050DA /* MasterViewController.xib */; }; 20 | 63DFB6AB14E9E69000B050DA /* TextViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 63DFB6A914E9E69000B050DA /* TextViewController.m */; }; 21 | 63DFB6AC14E9E69000B050DA /* TextViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63DFB6AA14E9E69000B050DA /* TextViewController.xib */; }; 22 | 63DFB6B014E9E6BF00B050DA /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 63DFB6AE14E9E6BF00B050DA /* TableViewController.m */; }; 23 | 63DFB6B114E9E6BF00B050DA /* TableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 63DFB6AF14E9E6BF00B050DA /* TableViewController.xib */; }; 24 | 63E97C3B170902AB004B1933 /* DAAutoScroll.m in Sources */ = {isa = PBXBuildFile; fileRef = 63E97C3A170902AB004B1933 /* DAAutoScroll.m */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXFileReference section */ 28 | 631E3F411F530D5300FAA33F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 29 | 639BEBD6173B427500BBA289 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; 30 | 63DFB67314E9C6B100B050DA /* DAAutoScrollExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DAAutoScrollExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 63DFB67714E9C6B100B050DA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 32 | 63DFB67914E9C6B100B050DA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 33 | 63DFB67B14E9C6B100B050DA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 34 | 63DFB67F14E9C6B100B050DA /* DAAutoScrollExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DAAutoScrollExample-Info.plist"; sourceTree = ""; }; 35 | 63DFB68114E9C6B100B050DA /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 36 | 63DFB68314E9C6B100B050DA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 37 | 63DFB68514E9C6B100B050DA /* DAAutoScrollExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DAAutoScrollExample-Prefix.pch"; sourceTree = ""; }; 38 | 63DFB68614E9C6B100B050DA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | 63DFB68714E9C6B100B050DA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | 63DFB68914E9C6B100B050DA /* MasterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MasterViewController.h; sourceTree = ""; }; 41 | 63DFB68A14E9C6B100B050DA /* MasterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MasterViewController.m; sourceTree = ""; }; 42 | 63DFB69014E9C6B100B050DA /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MasterViewController.xib; sourceTree = ""; }; 43 | 63DFB6A814E9E69000B050DA /* TextViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextViewController.h; sourceTree = ""; }; 44 | 63DFB6A914E9E69000B050DA /* TextViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextViewController.m; sourceTree = ""; }; 45 | 63DFB6AA14E9E69000B050DA /* TextViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TextViewController.xib; sourceTree = ""; }; 46 | 63DFB6AD14E9E6BF00B050DA /* TableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController.h; sourceTree = ""; }; 47 | 63DFB6AE14E9E6BF00B050DA /* TableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController.m; sourceTree = ""; }; 48 | 63DFB6AF14E9E6BF00B050DA /* TableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TableViewController.xib; sourceTree = ""; }; 49 | 63E97C39170902AB004B1933 /* DAAutoScroll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DAAutoScroll.h; sourceTree = ""; }; 50 | 63E97C3A170902AB004B1933 /* DAAutoScroll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DAAutoScroll.m; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 63DFB67014E9C6B100B050DA /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | 631E3F421F530D5300FAA33F /* QuartzCore.framework in Frameworks */, 59 | 63DFB67814E9C6B100B050DA /* UIKit.framework in Frameworks */, 60 | 63DFB67A14E9C6B100B050DA /* Foundation.framework in Frameworks */, 61 | 63DFB67C14E9C6B100B050DA /* CoreGraphics.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 63DFB66814E9C6B100B050DA = { 69 | isa = PBXGroup; 70 | children = ( 71 | 63DFB69A14E9DF8600B050DA /* DAAutoScroll */, 72 | 63DFB67D14E9C6B100B050DA /* DAAutoScrollExample */, 73 | 63DFB67614E9C6B100B050DA /* Frameworks */, 74 | 63DFB67414E9C6B100B050DA /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 63DFB67414E9C6B100B050DA /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 63DFB67314E9C6B100B050DA /* DAAutoScrollExample.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 63DFB67614E9C6B100B050DA /* Frameworks */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 631E3F411F530D5300FAA33F /* QuartzCore.framework */, 90 | 63DFB67714E9C6B100B050DA /* UIKit.framework */, 91 | 63DFB67914E9C6B100B050DA /* Foundation.framework */, 92 | 63DFB67B14E9C6B100B050DA /* CoreGraphics.framework */, 93 | ); 94 | name = Frameworks; 95 | sourceTree = ""; 96 | }; 97 | 63DFB67D14E9C6B100B050DA /* DAAutoScrollExample */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 63DFB68614E9C6B100B050DA /* AppDelegate.h */, 101 | 63DFB68714E9C6B100B050DA /* AppDelegate.m */, 102 | 63DFB68914E9C6B100B050DA /* MasterViewController.h */, 103 | 63DFB68A14E9C6B100B050DA /* MasterViewController.m */, 104 | 63DFB68F14E9C6B100B050DA /* MasterViewController.xib */, 105 | 63DFB6A814E9E69000B050DA /* TextViewController.h */, 106 | 63DFB6A914E9E69000B050DA /* TextViewController.m */, 107 | 63DFB6AA14E9E69000B050DA /* TextViewController.xib */, 108 | 63DFB6AD14E9E6BF00B050DA /* TableViewController.h */, 109 | 63DFB6AE14E9E6BF00B050DA /* TableViewController.m */, 110 | 63DFB6AF14E9E6BF00B050DA /* TableViewController.xib */, 111 | 63DFB67E14E9C6B100B050DA /* Supporting Files */, 112 | ); 113 | path = DAAutoScrollExample; 114 | sourceTree = ""; 115 | }; 116 | 63DFB67E14E9C6B100B050DA /* Supporting Files */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 639BEBD6173B427500BBA289 /* Default-568h@2x.png */, 120 | 63DFB67F14E9C6B100B050DA /* DAAutoScrollExample-Info.plist */, 121 | 63DFB68014E9C6B100B050DA /* InfoPlist.strings */, 122 | 63DFB68314E9C6B100B050DA /* main.m */, 123 | 63DFB68514E9C6B100B050DA /* DAAutoScrollExample-Prefix.pch */, 124 | ); 125 | name = "Supporting Files"; 126 | sourceTree = ""; 127 | }; 128 | 63DFB69A14E9DF8600B050DA /* DAAutoScroll */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 63E97C39170902AB004B1933 /* DAAutoScroll.h */, 132 | 63E97C3A170902AB004B1933 /* DAAutoScroll.m */, 133 | ); 134 | name = DAAutoScroll; 135 | path = ../DAAutoScroll; 136 | sourceTree = ""; 137 | }; 138 | /* End PBXGroup section */ 139 | 140 | /* Begin PBXNativeTarget section */ 141 | 63DFB67214E9C6B100B050DA /* DAAutoScrollExample */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = 63DFB69714E9C6B100B050DA /* Build configuration list for PBXNativeTarget "DAAutoScrollExample" */; 144 | buildPhases = ( 145 | 63DFB66F14E9C6B100B050DA /* Sources */, 146 | 63DFB67014E9C6B100B050DA /* Frameworks */, 147 | 63DFB67114E9C6B100B050DA /* Resources */, 148 | ); 149 | buildRules = ( 150 | ); 151 | dependencies = ( 152 | ); 153 | name = DAAutoScrollExample; 154 | productName = DAAutoScrollExample; 155 | productReference = 63DFB67314E9C6B100B050DA /* DAAutoScrollExample.app */; 156 | productType = "com.apple.product-type.application"; 157 | }; 158 | /* End PBXNativeTarget section */ 159 | 160 | /* Begin PBXProject section */ 161 | 63DFB66A14E9C6B100B050DA /* Project object */ = { 162 | isa = PBXProject; 163 | attributes = { 164 | LastUpgradeCheck = 0420; 165 | ORGANIZATIONNAME = "Shout Messenger"; 166 | }; 167 | buildConfigurationList = 63DFB66D14E9C6B100B050DA /* Build configuration list for PBXProject "DAAutoScrollExample" */; 168 | compatibilityVersion = "Xcode 3.2"; 169 | developmentRegion = English; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | ); 174 | mainGroup = 63DFB66814E9C6B100B050DA; 175 | productRefGroup = 63DFB67414E9C6B100B050DA /* Products */; 176 | projectDirPath = ""; 177 | projectRoot = ""; 178 | targets = ( 179 | 63DFB67214E9C6B100B050DA /* DAAutoScrollExample */, 180 | ); 181 | }; 182 | /* End PBXProject section */ 183 | 184 | /* Begin PBXResourcesBuildPhase section */ 185 | 63DFB67114E9C6B100B050DA /* Resources */ = { 186 | isa = PBXResourcesBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | 63DFB68214E9C6B100B050DA /* InfoPlist.strings in Resources */, 190 | 63DFB69114E9C6B100B050DA /* MasterViewController.xib in Resources */, 191 | 63DFB6AC14E9E69000B050DA /* TextViewController.xib in Resources */, 192 | 63DFB6B114E9E6BF00B050DA /* TableViewController.xib in Resources */, 193 | 639BEBD7173B427500BBA289 /* Default-568h@2x.png in Resources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXResourcesBuildPhase section */ 198 | 199 | /* Begin PBXSourcesBuildPhase section */ 200 | 63DFB66F14E9C6B100B050DA /* Sources */ = { 201 | isa = PBXSourcesBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | 63DFB68414E9C6B100B050DA /* main.m in Sources */, 205 | 63DFB68814E9C6B100B050DA /* AppDelegate.m in Sources */, 206 | 63DFB68B14E9C6B100B050DA /* MasterViewController.m in Sources */, 207 | 63DFB6AB14E9E69000B050DA /* TextViewController.m in Sources */, 208 | 63DFB6B014E9E6BF00B050DA /* TableViewController.m in Sources */, 209 | 63E97C3B170902AB004B1933 /* DAAutoScroll.m in Sources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | /* End PBXSourcesBuildPhase section */ 214 | 215 | /* Begin PBXVariantGroup section */ 216 | 63DFB68014E9C6B100B050DA /* InfoPlist.strings */ = { 217 | isa = PBXVariantGroup; 218 | children = ( 219 | 63DFB68114E9C6B100B050DA /* en */, 220 | ); 221 | name = InfoPlist.strings; 222 | sourceTree = ""; 223 | }; 224 | 63DFB68F14E9C6B100B050DA /* MasterViewController.xib */ = { 225 | isa = PBXVariantGroup; 226 | children = ( 227 | 63DFB69014E9C6B100B050DA /* en */, 228 | ); 229 | name = MasterViewController.xib; 230 | sourceTree = ""; 231 | }; 232 | /* End PBXVariantGroup section */ 233 | 234 | /* Begin XCBuildConfiguration section */ 235 | 63DFB69514E9C6B100B050DA /* Debug */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = NO; 239 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 240 | CLANG_ENABLE_OBJC_ARC = YES; 241 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 242 | COPY_PHASE_STRIP = NO; 243 | GCC_C_LANGUAGE_STANDARD = gnu99; 244 | GCC_DYNAMIC_NO_PIC = NO; 245 | GCC_OPTIMIZATION_LEVEL = 0; 246 | GCC_PREPROCESSOR_DEFINITIONS = ( 247 | "DEBUG=1", 248 | "$(inherited)", 249 | ); 250 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 251 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 252 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 253 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 256 | SDKROOT = iphoneos; 257 | }; 258 | name = Debug; 259 | }; 260 | 63DFB69614E9C6B100B050DA /* Release */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ALWAYS_SEARCH_USER_PATHS = NO; 264 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 267 | COPY_PHASE_STRIP = YES; 268 | GCC_C_LANGUAGE_STANDARD = gnu99; 269 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 270 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 271 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 272 | GCC_WARN_UNUSED_VARIABLE = YES; 273 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 274 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 275 | SDKROOT = iphoneos; 276 | VALIDATE_PRODUCT = YES; 277 | }; 278 | name = Release; 279 | }; 280 | 63DFB69814E9C6B100B050DA /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 284 | GCC_PREFIX_HEADER = "DAAutoScrollExample/DAAutoScrollExample-Prefix.pch"; 285 | INFOPLIST_FILE = "DAAutoScrollExample/DAAutoScrollExample-Info.plist"; 286 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 287 | PRODUCT_NAME = "$(TARGET_NAME)"; 288 | WRAPPER_EXTENSION = app; 289 | }; 290 | name = Debug; 291 | }; 292 | 63DFB69914E9C6B100B050DA /* Release */ = { 293 | isa = XCBuildConfiguration; 294 | buildSettings = { 295 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 296 | GCC_PREFIX_HEADER = "DAAutoScrollExample/DAAutoScrollExample-Prefix.pch"; 297 | INFOPLIST_FILE = "DAAutoScrollExample/DAAutoScrollExample-Info.plist"; 298 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 299 | PRODUCT_NAME = "$(TARGET_NAME)"; 300 | WRAPPER_EXTENSION = app; 301 | }; 302 | name = Release; 303 | }; 304 | /* End XCBuildConfiguration section */ 305 | 306 | /* Begin XCConfigurationList section */ 307 | 63DFB66D14E9C6B100B050DA /* Build configuration list for PBXProject "DAAutoScrollExample" */ = { 308 | isa = XCConfigurationList; 309 | buildConfigurations = ( 310 | 63DFB69514E9C6B100B050DA /* Debug */, 311 | 63DFB69614E9C6B100B050DA /* Release */, 312 | ); 313 | defaultConfigurationIsVisible = 0; 314 | defaultConfigurationName = Release; 315 | }; 316 | 63DFB69714E9C6B100B050DA /* Build configuration list for PBXNativeTarget "DAAutoScrollExample" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | 63DFB69814E9C6B100B050DA /* Debug */, 320 | 63DFB69914E9C6B100B050DA /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | /* End XCConfigurationList section */ 326 | }; 327 | rootObject = 63DFB66A14E9C6B100B050DA /* Project object */; 328 | } 329 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/DAAutoScrollExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 38 | 39 | 40 | 41 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 67 | 68 | 74 | 75 | 76 | 77 | 79 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DAAutoScrollExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 63DFB67214E9C6B100B050DA 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @property (strong, nonatomic) UINavigationController *navigationController; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "MasterViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | @synthesize window = _window; 16 | @synthesize navigationController = _navigationController; 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 19 | { 20 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 21 | 22 | MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; 23 | self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController]; 24 | self.window.rootViewController = self.navigationController; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/DAAutoScrollExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | DAAutoScroll 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | us.amitay.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/DAAutoScrollExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DAAutoScrollExample' target in the 'DAAutoScrollExample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_4_0 8 | #warning "This project uses features only available in iOS SDK 4.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/MasterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.h 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MasterViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/MasterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MasterViewController.m 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import "MasterViewController.h" 10 | 11 | #import "TextViewController.h" 12 | #import "TableViewController.h" 13 | 14 | @implementation MasterViewController 15 | 16 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 17 | { 18 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 19 | if (self) { 20 | self.title = NSLocalizedString(@"Master", @"Master"); 21 | } 22 | return self; 23 | } 24 | 25 | #pragma mark - View lifecycle 26 | 27 | - (void)viewDidLoad 28 | { 29 | [super viewDidLoad]; 30 | self.title = @"DAAutoScroll"; 31 | } 32 | 33 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 34 | { 35 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 36 | } 37 | 38 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 39 | { 40 | return 1; 41 | } 42 | 43 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 44 | { 45 | return 2; 46 | } 47 | 48 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 49 | { 50 | static NSString *CellIdentifier = @"Cell"; 51 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 52 | if (cell == nil) { 53 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 54 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 55 | } 56 | 57 | switch (indexPath.row) { 58 | case 0: 59 | cell.textLabel.text = @"TableView Example"; 60 | break; 61 | case 1: 62 | cell.textLabel.text = @"TextView Example"; 63 | break; 64 | default: 65 | break; 66 | } 67 | 68 | return cell; 69 | } 70 | 71 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 72 | { 73 | UIViewController *controller = nil; 74 | 75 | switch (indexPath.row) { 76 | case 0: 77 | controller = [[TableViewController alloc] initWithNibName:@"TableViewController" bundle:nil]; 78 | break; 79 | case 1: 80 | controller = [[TextViewController alloc] init]; 81 | break; 82 | default: 83 | break; 84 | } 85 | 86 | [self.navigationController pushViewController:controller animated:YES]; 87 | } 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/TableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.h 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/TableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.m 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import "TableViewController.h" 10 | 11 | #import "DAAutoScroll.h" 12 | 13 | @implementation TableViewController 14 | 15 | #pragma mark - View lifecycle 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | self.title = @"Table View"; 21 | 22 | self.tableView.scrollPointsPerSecond = 90.0f; 23 | [self.tableView startScrolling]; 24 | } 25 | 26 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate 27 | { 28 | if (!decelerate) { 29 | [self.tableView startScrolling]; 30 | } 31 | } 32 | 33 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView 34 | { 35 | [self.tableView startScrolling]; 36 | } 37 | 38 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 39 | { 40 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 41 | } 42 | 43 | #pragma mark - Table view data source 44 | 45 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 46 | { 47 | return 1; 48 | } 49 | 50 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 51 | { 52 | return 100; 53 | } 54 | 55 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 56 | { 57 | static NSString *CellIdentifier = @"Cell"; 58 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 59 | if (cell == nil) { 60 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 61 | } 62 | 63 | cell.textLabel.text = [NSString stringWithFormat:@"Row %i", indexPath.row]; 64 | 65 | return cell; 66 | } 67 | 68 | #pragma mark - Table view delegate 69 | 70 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 71 | { 72 | 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/TableViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12C60 6 | 3084 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 64}, {320, 416}} 37 | 38 | 39 | 40 | 3 41 | MQA 42 | 43 | NO 44 | YES 45 | NO 46 | 47 | 48 | NO 49 | 50 | IBCocoaTouchFramework 51 | NO 52 | 1 53 | 0 54 | YES 55 | 44 56 | 22 57 | 22 58 | 59 | 60 | 61 | 62 | 63 | 64 | view 65 | 66 | 67 | 68 | 5 69 | 70 | 71 | 72 | dataSource 73 | 74 | 75 | 76 | 6 77 | 78 | 79 | 80 | delegate 81 | 82 | 83 | 84 | 7 85 | 86 | 87 | 88 | 89 | 90 | 0 91 | 92 | 93 | 94 | 95 | 96 | -1 97 | 98 | 99 | File's Owner 100 | 101 | 102 | -2 103 | 104 | 105 | 106 | 107 | 4 108 | 109 | 110 | 111 | 112 | 113 | 114 | TableViewController 115 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 116 | UIResponder 117 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 118 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 119 | 120 | 121 | 122 | 123 | 124 | 7 125 | 126 | 127 | 128 | 129 | TableViewController 130 | UITableViewController 131 | 132 | IBProjectSource 133 | ./Classes/TableViewController.h 134 | 135 | 136 | 137 | 138 | 0 139 | IBCocoaTouchFramework 140 | YES 141 | 3 142 | 2083 143 | 144 | 145 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/TextViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TextViewController.h 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TextViewController : UIViewController 12 | 13 | @property (nonatomic, strong) IBOutlet UITextView *textView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/TextViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TextViewController.m 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. All rights reserved. 7 | // 8 | 9 | #import "TextViewController.h" 10 | #import "DAAutoScroll.h" 11 | 12 | @implementation TextViewController 13 | 14 | @synthesize textView; 15 | 16 | #pragma mark - View lifecycle 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | self.title = @"Text View"; 22 | 23 | textView.delegate = self; 24 | [textView startScrolling]; 25 | } 26 | 27 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 28 | { 29 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 30 | } 31 | 32 | - (void)textViewDidBeginEditing:(UITextView *)aTextView 33 | { 34 | [textView stopScrolling]; 35 | } 36 | 37 | - (void)textViewDidEndEditing:(UITextView *)aTextView 38 | { 39 | [textView startScrolling]; 40 | } 41 | 42 | - (BOOL)textView:(UITextView *)aTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text 43 | { 44 | if ([text isEqualToString:@"\n"]) { 45 | [textView resignFirstResponder]; 46 | return NO; 47 | } 48 | return YES; 49 | } 50 | 51 | - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate 52 | { 53 | if (!decelerate && !textView.isFirstResponder) { 54 | [textView startScrolling]; 55 | } 56 | } 57 | 58 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView 59 | { 60 | if (!textView.isFirstResponder) { 61 | [textView startScrolling]; 62 | } 63 | } 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/TextViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 12C60 6 | 3084 7 | 1187.34 8 | 625.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | IBProxyObject 15 | IBUITextView 16 | IBUIView 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 274 41 | {320, 416} 42 | 43 | 44 | 45 | _NS:639 46 | 47 | 1 48 | MSAxIDEAA 49 | 50 | YES 51 | YES 52 | IBCocoaTouchFramework 53 | 54 | Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. 55 | 56 | 57 | 2 58 | IBCocoaTouchFramework 59 | 60 | 61 | 1 62 | 14 63 | 64 | 65 | Helvetica 66 | 14 67 | 16 68 | 69 | 70 | 71 | {{0, 64}, {320, 416}} 72 | 73 | 74 | 75 | 76 | 3 77 | MQA 78 | 79 | 2 80 | 81 | 82 | 83 | 84 | NO 85 | 86 | IBCocoaTouchFramework 87 | 88 | 89 | 90 | 91 | 92 | 93 | view 94 | 95 | 96 | 97 | 3 98 | 99 | 100 | 101 | textView 102 | 103 | 104 | 105 | 5 106 | 107 | 108 | 109 | 110 | 111 | 0 112 | 113 | 114 | 115 | 116 | 117 | 1 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | -1 126 | 127 | 128 | File's Owner 129 | 130 | 131 | -2 132 | 133 | 134 | 135 | 136 | 4 137 | 138 | 139 | 140 | 141 | 142 | 143 | TextViewController 144 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 145 | UIResponder 146 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 147 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 148 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 149 | 150 | 151 | 152 | 153 | 154 | 5 155 | 156 | 157 | 158 | 159 | DAAutoTextView 160 | UITextView 161 | 162 | IBProjectSource 163 | ./Classes/DAAutoTextView.h 164 | 165 | 166 | 167 | TextViewController 168 | UIViewController 169 | 170 | textView 171 | DAAutoTextView 172 | 173 | 174 | textView 175 | 176 | textView 177 | DAAutoTextView 178 | 179 | 180 | 181 | IBProjectSource 182 | ./Classes/TextViewController.h 183 | 184 | 185 | 186 | 187 | 0 188 | IBCocoaTouchFramework 189 | YES 190 | 3 191 | 2083 192 | 193 | 194 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/en.lproj/MasterViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C25 6 | 1919 7 | 1138.11 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 916 12 | 13 | 14 | IBProxyObject 15 | IBUITableView 16 | 17 | 18 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | IBFilesOwner 27 | IBCocoaTouchFramework 28 | 29 | 30 | IBFirstResponder 31 | IBCocoaTouchFramework 32 | 33 | 34 | 35 | 274 36 | {{0, 20}, {320, 460}} 37 | 38 | 39 | 40 | 3 41 | MQA 42 | 43 | YES 44 | 45 | IBCocoaTouchFramework 46 | YES 47 | 1 48 | 0 49 | YES 50 | 44 51 | 22 52 | 22 53 | 54 | 55 | 56 | 57 | 58 | 59 | view 60 | 61 | 62 | 63 | 3 64 | 65 | 66 | 67 | dataSource 68 | 69 | 70 | 71 | 4 72 | 73 | 74 | 75 | delegate 76 | 77 | 78 | 79 | 5 80 | 81 | 82 | 83 | 84 | 85 | 0 86 | 87 | 88 | 89 | 90 | 91 | -1 92 | 93 | 94 | File's Owner 95 | 96 | 97 | -2 98 | 99 | 100 | 101 | 102 | 2 103 | 104 | 105 | 106 | 107 | 108 | 109 | MasterViewController 110 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 111 | UIResponder 112 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 113 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 114 | 115 | 116 | 117 | 118 | 119 | 5 120 | 121 | 122 | 123 | 124 | MasterViewController 125 | UITableViewController 126 | 127 | IBProjectSource 128 | ./Classes/MasterViewController.h 129 | 130 | 131 | 132 | 133 | 0 134 | IBCocoaTouchFramework 135 | YES 136 | 3 137 | 916 138 | 139 | 140 | -------------------------------------------------------------------------------- /DAAutoScrollExample/DAAutoScrollExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DAAutoScrollExample 4 | // 5 | // Created by Daniel Amitay on 2/13/12. 6 | // Copyright (c) 2012 Daniel Amitay. 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 | -------------------------------------------------------------------------------- /DAAutoScrollExample/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielamitay/DAAutoScroll/c8ed560b8fd4f137e4b030fab929891ed1e1de0c/DAAutoScrollExample/Default-568h@2x.png -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | ## MIT License 4 | 5 | Copyright (c) 2013 Daniel Amitay (http://www.danielamitay.com) 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## DAAutoScroll 2 | 3 | `DAAutoScroll` is a `UIScrollView` category that allows any chosen `UIScrollView` (or subclass thereof) to automatically scroll itself with adjustable speed. When the user interacts with the view, the scrolling automatically stops. 4 | 5 | View the included example project for a demonstration. 6 | 7 | ## Installation 8 | 9 | - Copy over the `DAAutoScroll` folder to your project folder. 10 | - `#import "DAAutoScroll.h"` where desired 11 | 12 | ## Usage 13 | 14 | Example project included (DAAutoScrollExample) 15 | 16 | To restart scrolling after user interaction, you need to support the `UIScrollView` delegate methods `scrollViewDidEndDragging:` and `scrollViewDidEndDecelerating:`, and call `startScrolling` again. The example does this by default. 17 | 18 | ### Automatic Reference Counting (ARC) support 19 | 20 | `DAAutoScroll` was made with ARC enabled by default. 21 | 22 | ## Contact 23 | 24 | - [Personal website](http://danielamitay.com) 25 | - [GitHub](http://github.com/danielamitay) 26 | - [Twitter](http://twitter.com/danielamitay) 27 | - [LinkedIn](http://www.linkedin.com/in/danielamitay) 28 | - [Email](mailto:hello@danielamitay.com) 29 | 30 | If you use/enjoy `DAAutoScroll`, let me know! 31 | 32 | ## License 33 | 34 | ### MIT License 35 | 36 | Copyright (c) 2013 Daniel Amitay (http://www.danielamitay.com) 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy 39 | of this software and associated documentation files (the "Software"), to deal 40 | in the Software without restriction, including without limitation the rights 41 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 42 | copies of the Software, and to permit persons to whom the Software is 43 | furnished to do so, subject to the following conditions: 44 | 45 | The above copyright notice and this permission notice shall be included in 46 | all copies or substantial portions of the Software. 47 | 48 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 49 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 50 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 51 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 52 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 53 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 54 | THE SOFTWARE. 55 | --------------------------------------------------------------------------------