├── .gitignore ├── CLTableWithFooterViewController.podspec ├── CLTableWithFooterViewController.xcodeproj └── project.pbxproj ├── Example.gif ├── Example ├── Assets │ ├── .DS_Store │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Footer.png │ └── Footer@2x.png ├── Classes │ ├── CLAppDelegate.h │ ├── CLAppDelegate.m │ ├── CLViewController.h │ └── CLViewController.m └── Other Sources │ ├── CLTableWithFooterViewController-Info.plist │ ├── CLTableWithFooterViewController-Prefix.pch │ └── main.m ├── LICENSE ├── README.markdown └── Src ├── CLTableWithFooterViewController.h └── CLTableWithFooterViewController.m /.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.pbxuser 3 | *.perspectivev3 4 | *.xcworkspace 5 | xcuserdata 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /CLTableWithFooterViewController.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "CLTableWithFooterViewController" 3 | s.version = "0.2.0" 4 | s.summary = "Easily add a stationary footer image when you reach the bottom of your UIScrollView or UITableView" 5 | s.description = <<-DESC 6 | Easily add a stationary footer image when you reach the bottom of your UIScrollView or UITableView. 7 | It will remain put when the content bounces up and hide when scrolling up. 8 | DESC 9 | s.homepage = "https://github.com/chrisledet/CLTableWithFooterViewController" 10 | s.screenshots = "https://github.com/chrisledet/CLTableWithFooterViewController/blob/master/Example.gif" 11 | s.license = 'MIT' 12 | s.author = { "Chris Ledet" => "me@chrisledet.com" } 13 | s.platform = :ios 14 | s.source = { :git => "https://github.com/chrisledet/CLTableWithFooterViewController.git", :tag => "v0.2.0" } 15 | s.source_files = 'Src', 'Src/**/*.{h,m}' 16 | s.requires_arc = true 17 | end 18 | -------------------------------------------------------------------------------- /CLTableWithFooterViewController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8384087A1786929D00A966DF /* Footer.png in Resources */ = {isa = PBXBuildFile; fileRef = 838408781786929D00A966DF /* Footer.png */; }; 11 | 8384087B1786929D00A966DF /* Footer@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 838408791786929D00A966DF /* Footer@2x.png */; }; 12 | 83E533B717868BC400D4BA92 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E533B617868BC400D4BA92 /* UIKit.framework */; }; 13 | 83E533B917868BC400D4BA92 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E533B817868BC400D4BA92 /* Foundation.framework */; }; 14 | 83E533BB17868BC400D4BA92 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E533BA17868BC400D4BA92 /* CoreGraphics.framework */; }; 15 | 83E533E417868C3B00D4BA92 /* CLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E533E117868C3B00D4BA92 /* CLAppDelegate.m */; }; 16 | 83E533E517868C3B00D4BA92 /* CLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E533E317868C3B00D4BA92 /* CLViewController.m */; }; 17 | 83E533EA17868C5900D4BA92 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E533E717868C5900D4BA92 /* Default-568h@2x.png */; }; 18 | 83E533EB17868C5900D4BA92 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E533E817868C5900D4BA92 /* Default.png */; }; 19 | 83E533EC17868C5900D4BA92 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 83E533E917868C5900D4BA92 /* Default@2x.png */; }; 20 | 83E533F217868C6400D4BA92 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E533F017868C6400D4BA92 /* main.m */; }; 21 | 83E533F617868D3D00D4BA92 /* CLTableWithFooterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E533F517868D3D00D4BA92 /* CLTableWithFooterViewController.m */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | 838408781786929D00A966DF /* Footer.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Footer.png; sourceTree = ""; }; 26 | 838408791786929D00A966DF /* Footer@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Footer@2x.png"; sourceTree = ""; }; 27 | 83E533B317868BC400D4BA92 /* CLTableWithFooterViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CLTableWithFooterViewController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 83E533B617868BC400D4BA92 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29 | 83E533B817868BC400D4BA92 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 30 | 83E533BA17868BC400D4BA92 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 31 | 83E533E017868C3B00D4BA92 /* CLAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLAppDelegate.h; sourceTree = ""; }; 32 | 83E533E117868C3B00D4BA92 /* CLAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLAppDelegate.m; sourceTree = ""; }; 33 | 83E533E217868C3B00D4BA92 /* CLViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLViewController.h; sourceTree = ""; }; 34 | 83E533E317868C3B00D4BA92 /* CLViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLViewController.m; sourceTree = ""; }; 35 | 83E533E717868C5900D4BA92 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 36 | 83E533E817868C5900D4BA92 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 37 | 83E533E917868C5900D4BA92 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 38 | 83E533EE17868C6400D4BA92 /* CLTableWithFooterViewController-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CLTableWithFooterViewController-Info.plist"; sourceTree = ""; }; 39 | 83E533EF17868C6400D4BA92 /* CLTableWithFooterViewController-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CLTableWithFooterViewController-Prefix.pch"; sourceTree = ""; }; 40 | 83E533F017868C6400D4BA92 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 41 | 83E533F417868D3D00D4BA92 /* CLTableWithFooterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLTableWithFooterViewController.h; sourceTree = ""; }; 42 | 83E533F517868D3D00D4BA92 /* CLTableWithFooterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CLTableWithFooterViewController.m; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 83E533B017868BC400D4BA92 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | 83E533B717868BC400D4BA92 /* UIKit.framework in Frameworks */, 51 | 83E533B917868BC400D4BA92 /* Foundation.framework in Frameworks */, 52 | 83E533BB17868BC400D4BA92 /* CoreGraphics.framework in Frameworks */, 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | /* End PBXFrameworksBuildPhase section */ 57 | 58 | /* Begin PBXGroup section */ 59 | 83E533AA17868BC400D4BA92 = { 60 | isa = PBXGroup; 61 | children = ( 62 | 83E533F317868D3D00D4BA92 /* Src */, 63 | 83E533BC17868BC400D4BA92 /* Example */, 64 | 83E533B517868BC400D4BA92 /* Frameworks */, 65 | 83E533B417868BC400D4BA92 /* Products */, 66 | ); 67 | sourceTree = ""; 68 | }; 69 | 83E533B417868BC400D4BA92 /* Products */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 83E533B317868BC400D4BA92 /* CLTableWithFooterViewController.app */, 73 | ); 74 | name = Products; 75 | sourceTree = ""; 76 | }; 77 | 83E533B517868BC400D4BA92 /* Frameworks */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 83E533B617868BC400D4BA92 /* UIKit.framework */, 81 | 83E533B817868BC400D4BA92 /* Foundation.framework */, 82 | 83E533BA17868BC400D4BA92 /* CoreGraphics.framework */, 83 | ); 84 | name = Frameworks; 85 | sourceTree = ""; 86 | }; 87 | 83E533BC17868BC400D4BA92 /* Example */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 83E533E617868C5900D4BA92 /* Assets */, 91 | 83E533DF17868C3B00D4BA92 /* Classes */, 92 | 83E533ED17868C6400D4BA92 /* Other Sources */, 93 | ); 94 | name = Example; 95 | path = CLTableWithFooterViewController; 96 | sourceTree = ""; 97 | }; 98 | 83E533DF17868C3B00D4BA92 /* Classes */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 83E533E017868C3B00D4BA92 /* CLAppDelegate.h */, 102 | 83E533E117868C3B00D4BA92 /* CLAppDelegate.m */, 103 | 83E533E217868C3B00D4BA92 /* CLViewController.h */, 104 | 83E533E317868C3B00D4BA92 /* CLViewController.m */, 105 | ); 106 | name = Classes; 107 | path = Example/Classes; 108 | sourceTree = SOURCE_ROOT; 109 | }; 110 | 83E533E617868C5900D4BA92 /* Assets */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 83E533E717868C5900D4BA92 /* Default-568h@2x.png */, 114 | 83E533E817868C5900D4BA92 /* Default.png */, 115 | 83E533E917868C5900D4BA92 /* Default@2x.png */, 116 | 838408781786929D00A966DF /* Footer.png */, 117 | 838408791786929D00A966DF /* Footer@2x.png */, 118 | ); 119 | name = Assets; 120 | path = Example/Assets; 121 | sourceTree = SOURCE_ROOT; 122 | }; 123 | 83E533ED17868C6400D4BA92 /* Other Sources */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 83E533EE17868C6400D4BA92 /* CLTableWithFooterViewController-Info.plist */, 127 | 83E533EF17868C6400D4BA92 /* CLTableWithFooterViewController-Prefix.pch */, 128 | 83E533F017868C6400D4BA92 /* main.m */, 129 | ); 130 | name = "Other Sources"; 131 | path = "Example/Other Sources"; 132 | sourceTree = SOURCE_ROOT; 133 | }; 134 | 83E533F317868D3D00D4BA92 /* Src */ = { 135 | isa = PBXGroup; 136 | children = ( 137 | 83E533F417868D3D00D4BA92 /* CLTableWithFooterViewController.h */, 138 | 83E533F517868D3D00D4BA92 /* CLTableWithFooterViewController.m */, 139 | ); 140 | path = Src; 141 | sourceTree = ""; 142 | }; 143 | /* End PBXGroup section */ 144 | 145 | /* Begin PBXNativeTarget section */ 146 | 83E533B217868BC400D4BA92 /* CLTableWithFooterViewController */ = { 147 | isa = PBXNativeTarget; 148 | buildConfigurationList = 83E533D617868BC400D4BA92 /* Build configuration list for PBXNativeTarget "CLTableWithFooterViewController" */; 149 | buildPhases = ( 150 | 83E533AF17868BC400D4BA92 /* Sources */, 151 | 83E533B017868BC400D4BA92 /* Frameworks */, 152 | 83E533B117868BC400D4BA92 /* Resources */, 153 | ); 154 | buildRules = ( 155 | ); 156 | dependencies = ( 157 | ); 158 | name = CLTableWithFooterViewController; 159 | productName = CLTableWithFooterViewController; 160 | productReference = 83E533B317868BC400D4BA92 /* CLTableWithFooterViewController.app */; 161 | productType = "com.apple.product-type.application"; 162 | }; 163 | /* End PBXNativeTarget section */ 164 | 165 | /* Begin PBXProject section */ 166 | 83E533AB17868BC400D4BA92 /* Project object */ = { 167 | isa = PBXProject; 168 | attributes = { 169 | CLASSPREFIX = CL; 170 | LastUpgradeCheck = 0460; 171 | ORGANIZATIONNAME = "Chris Ledet"; 172 | }; 173 | buildConfigurationList = 83E533AE17868BC400D4BA92 /* Build configuration list for PBXProject "CLTableWithFooterViewController" */; 174 | compatibilityVersion = "Xcode 3.2"; 175 | developmentRegion = English; 176 | hasScannedForEncodings = 0; 177 | knownRegions = ( 178 | en, 179 | ); 180 | mainGroup = 83E533AA17868BC400D4BA92; 181 | productRefGroup = 83E533B417868BC400D4BA92 /* Products */; 182 | projectDirPath = ""; 183 | projectRoot = ""; 184 | targets = ( 185 | 83E533B217868BC400D4BA92 /* CLTableWithFooterViewController */, 186 | ); 187 | }; 188 | /* End PBXProject section */ 189 | 190 | /* Begin PBXResourcesBuildPhase section */ 191 | 83E533B117868BC400D4BA92 /* Resources */ = { 192 | isa = PBXResourcesBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | 83E533EA17868C5900D4BA92 /* Default-568h@2x.png in Resources */, 196 | 83E533EB17868C5900D4BA92 /* Default.png in Resources */, 197 | 83E533EC17868C5900D4BA92 /* Default@2x.png in Resources */, 198 | 8384087A1786929D00A966DF /* Footer.png in Resources */, 199 | 8384087B1786929D00A966DF /* Footer@2x.png in Resources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXResourcesBuildPhase section */ 204 | 205 | /* Begin PBXSourcesBuildPhase section */ 206 | 83E533AF17868BC400D4BA92 /* Sources */ = { 207 | isa = PBXSourcesBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | 83E533E417868C3B00D4BA92 /* CLAppDelegate.m in Sources */, 211 | 83E533E517868C3B00D4BA92 /* CLViewController.m in Sources */, 212 | 83E533F217868C6400D4BA92 /* main.m in Sources */, 213 | 83E533F617868D3D00D4BA92 /* CLTableWithFooterViewController.m in Sources */, 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | }; 217 | /* End PBXSourcesBuildPhase section */ 218 | 219 | /* Begin XCBuildConfiguration section */ 220 | 83E533D417868BC400D4BA92 /* Debug */ = { 221 | isa = XCBuildConfiguration; 222 | buildSettings = { 223 | ALWAYS_SEARCH_USER_PATHS = NO; 224 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 225 | CLANG_CXX_LIBRARY = "libc++"; 226 | CLANG_ENABLE_OBJC_ARC = YES; 227 | CLANG_WARN_CONSTANT_CONVERSION = YES; 228 | CLANG_WARN_EMPTY_BODY = YES; 229 | CLANG_WARN_ENUM_CONVERSION = YES; 230 | CLANG_WARN_INT_CONVERSION = YES; 231 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 232 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 233 | COPY_PHASE_STRIP = NO; 234 | GCC_C_LANGUAGE_STANDARD = gnu99; 235 | GCC_DYNAMIC_NO_PIC = NO; 236 | GCC_OPTIMIZATION_LEVEL = 0; 237 | GCC_PREPROCESSOR_DEFINITIONS = ( 238 | "DEBUG=1", 239 | "$(inherited)", 240 | ); 241 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 242 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 243 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 244 | GCC_WARN_UNUSED_VARIABLE = YES; 245 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 246 | ONLY_ACTIVE_ARCH = YES; 247 | SDKROOT = iphoneos; 248 | }; 249 | name = Debug; 250 | }; 251 | 83E533D517868BC400D4BA92 /* Release */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | ALWAYS_SEARCH_USER_PATHS = NO; 255 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 256 | CLANG_CXX_LIBRARY = "libc++"; 257 | CLANG_ENABLE_OBJC_ARC = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_EMPTY_BODY = YES; 260 | CLANG_WARN_ENUM_CONVERSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 263 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 264 | COPY_PHASE_STRIP = YES; 265 | GCC_C_LANGUAGE_STANDARD = gnu99; 266 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 267 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 268 | GCC_WARN_UNUSED_VARIABLE = YES; 269 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 270 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 271 | SDKROOT = iphoneos; 272 | VALIDATE_PRODUCT = YES; 273 | }; 274 | name = Release; 275 | }; 276 | 83E533D717868BC400D4BA92 /* Debug */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 280 | GCC_PREFIX_HEADER = "Example/Other Sources/CLTableWithFooterViewController-Prefix.pch"; 281 | INFOPLIST_FILE = "Example/Other Sources/CLTableWithFooterViewController-Info.plist"; 282 | PRODUCT_NAME = "$(TARGET_NAME)"; 283 | WRAPPER_EXTENSION = app; 284 | }; 285 | name = Debug; 286 | }; 287 | 83E533D817868BC400D4BA92 /* Release */ = { 288 | isa = XCBuildConfiguration; 289 | buildSettings = { 290 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 291 | GCC_PREFIX_HEADER = "Example/Other Sources/CLTableWithFooterViewController-Prefix.pch"; 292 | INFOPLIST_FILE = "Example/Other Sources/CLTableWithFooterViewController-Info.plist"; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | WRAPPER_EXTENSION = app; 295 | }; 296 | name = Release; 297 | }; 298 | /* End XCBuildConfiguration section */ 299 | 300 | /* Begin XCConfigurationList section */ 301 | 83E533AE17868BC400D4BA92 /* Build configuration list for PBXProject "CLTableWithFooterViewController" */ = { 302 | isa = XCConfigurationList; 303 | buildConfigurations = ( 304 | 83E533D417868BC400D4BA92 /* Debug */, 305 | 83E533D517868BC400D4BA92 /* Release */, 306 | ); 307 | defaultConfigurationIsVisible = 0; 308 | defaultConfigurationName = Release; 309 | }; 310 | 83E533D617868BC400D4BA92 /* Build configuration list for PBXNativeTarget "CLTableWithFooterViewController" */ = { 311 | isa = XCConfigurationList; 312 | buildConfigurations = ( 313 | 83E533D717868BC400D4BA92 /* Debug */, 314 | 83E533D817868BC400D4BA92 /* Release */, 315 | ); 316 | defaultConfigurationIsVisible = 0; 317 | defaultConfigurationName = Release; 318 | }; 319 | /* End XCConfigurationList section */ 320 | }; 321 | rootObject = 83E533AB17868BC400D4BA92 /* Project object */; 322 | } 323 | -------------------------------------------------------------------------------- /Example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisledet/CLTableWithFooterViewController/804ec738e33b51448e8a89f458d040eb772b4600/Example.gif -------------------------------------------------------------------------------- /Example/Assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisledet/CLTableWithFooterViewController/804ec738e33b51448e8a89f458d040eb772b4600/Example/Assets/.DS_Store -------------------------------------------------------------------------------- /Example/Assets/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisledet/CLTableWithFooterViewController/804ec738e33b51448e8a89f458d040eb772b4600/Example/Assets/Default-568h@2x.png -------------------------------------------------------------------------------- /Example/Assets/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisledet/CLTableWithFooterViewController/804ec738e33b51448e8a89f458d040eb772b4600/Example/Assets/Default.png -------------------------------------------------------------------------------- /Example/Assets/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisledet/CLTableWithFooterViewController/804ec738e33b51448e8a89f458d040eb772b4600/Example/Assets/Default@2x.png -------------------------------------------------------------------------------- /Example/Assets/Footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisledet/CLTableWithFooterViewController/804ec738e33b51448e8a89f458d040eb772b4600/Example/Assets/Footer.png -------------------------------------------------------------------------------- /Example/Assets/Footer@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrisledet/CLTableWithFooterViewController/804ec738e33b51448e8a89f458d040eb772b4600/Example/Assets/Footer@2x.png -------------------------------------------------------------------------------- /Example/Classes/CLAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLAppDelegate.h 3 | // CLTableWithFooterViewController 4 | // 5 | // Created by Chris Ledet on 7/5/13. 6 | // Copyright (c) 2013 Chris Ledet. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class CLViewController; 12 | 13 | @interface CLAppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | 17 | @property (strong, nonatomic) CLViewController *viewController; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Classes/CLAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLAppDelegate.m 3 | // CLTableWithFooterViewController 4 | // 5 | // Created by Chris Ledet on 7/5/13. 6 | // Copyright (c) 2013 Chris Ledet. All rights reserved. 7 | // 8 | 9 | #import "CLAppDelegate.h" 10 | 11 | #import "CLViewController.h" 12 | 13 | @implementation CLAppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 18 | // Override point for customization after application launch. 19 | 20 | self.viewController = [[CLViewController alloc] init]; 21 | 22 | self.window.rootViewController = self.viewController; 23 | [self.window makeKeyAndVisible]; 24 | 25 | return YES; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Example/Classes/CLViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CLViewController.h 3 | // CLTableWithFooterViewController 4 | // 5 | // Created by Chris Ledet on 7/5/13. 6 | // Copyright (c) 2013 Chris Ledet. All rights reserved. 7 | // 8 | 9 | #import "CLTableWithFooterViewController.h" 10 | 11 | @interface CLViewController : CLTableWithFooterViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Classes/CLViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CLViewController.m 3 | // CLTableWithFooterViewController 4 | // 5 | // Created by Chris Ledet on 7/5/13. 6 | // Copyright (c) 2013 Chris Ledet. All rights reserved. 7 | // 8 | 9 | #import "CLViewController.h" 10 | 11 | #define MAX_CELL_COUNT 15 12 | 13 | @implementation CLViewController 14 | 15 | - (void)viewDidLoad 16 | { 17 | [super viewDidLoad]; 18 | 19 | self.footerImage = [UIImage imageNamed:@"Footer.png"]; 20 | 21 | // Customize table view 22 | self.tableView.backgroundColor = [UIColor colorWithRed:237/255.0 green:97/255.0 blue:97/255.0 alpha:1.0]; 23 | self.tableView.separatorColor = [UIColor clearColor]; 24 | } 25 | 26 | #pragma mark UITableView DataSource 27 | 28 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 29 | { 30 | return MAX_CELL_COUNT + 1; 31 | } 32 | 33 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 34 | { 35 | return 1; 36 | } 37 | 38 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 39 | { 40 | static NSString *cellIdentifier = @"CLTableCell"; 41 | 42 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 43 | 44 | if (!cell) { 45 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 46 | cell.textLabel.textColor = [UIColor whiteColor]; 47 | } 48 | 49 | if (indexPath.section < MAX_CELL_COUNT) { 50 | cell.textLabel.text = [NSString stringWithFormat:@"Cell #%d", indexPath.section]; 51 | } else { 52 | cell.textLabel.text = @""; 53 | } 54 | 55 | return cell; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Example/Other Sources/CLTableWithFooterViewController-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | ledet.${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 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Example/Other Sources/CLTableWithFooterViewController-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CLTableWithFooterViewController' target in the 'CLTableWithFooterViewController' 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 | -------------------------------------------------------------------------------- /Example/Other Sources/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CLTableWithFooterViewController 4 | // 5 | // Created by Chris Ledet on 7/5/13. 6 | // Copyright (c) 2013 Chris Ledet. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CLAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CLAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Chris Ledet 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | ## CLTableWithFooterViewController 2 | 3 | Easily add a stationary footer image when you reach the bottom of your UIScrollView or UITableView. It will remain put when the content bounces up and hide when scrolling up. 4 | 5 | ## Installation 6 | 7 | Simply add all the files in the [Src](https://github.com/chrisledet/CLTableWithFooterViewController/tree/master/Src) directory to your project. 8 | 9 | ## Usage 10 | 11 | * Just import the `CLTableWithFooterViewController.h` header file into your UIViewController class. 12 | * Create a UIViewController that is a subclass of CLTableWithFooterViewController. 13 | * Now just sent the footer image by calling the `footerImage` property. 14 | 15 | Here's an example 16 | 17 | ```objective-c 18 | #import "CLTableWithFooterViewController.h" 19 | 20 | @interface MyViewController : CLTableWithFooterViewController 21 | @end 22 | 23 | @implementation MyViewController 24 | 25 | - (void)viewDidLoad { 26 | self.footerImage = [UIImage imageNamed:@"my_footer.png"]; 27 | } 28 | 29 | @end 30 | 31 | ``` 32 | 33 | 34 | ### Example 35 | 36 | ![image](https://raw.github.com/chrisledet/CLTableWithFooterViewController/master/Example.gif) 37 | 38 | Also, I included an example app. Just open the Xcode project, build, and run. 39 | 40 | ### License 41 | 42 | Released under the MIT license. 43 | -------------------------------------------------------------------------------- /Src/CLTableWithFooterViewController.h: -------------------------------------------------------------------------------- 1 | /* 2 | CLTableWithFooterViewController.h 3 | 4 | Copyright (c) 2013 Chris Ledet 5 | Licensed under the MIT license 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 8 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation 9 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 10 | to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 16 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 18 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | */ 21 | 22 | @interface CLTableWithFooterViewController : UIViewController 23 | 24 | /* A handy UITableView already setup on load if you don't assign one yourself */ 25 | @property (nonatomic, strong) UITableView *tableView; 26 | 27 | /* Required UIImage for the footer. It will remain move as you scroll until you reach the bottom */ 28 | @property (nonatomic, strong) UIImage *footerImage; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Src/CLTableWithFooterViewController.m: -------------------------------------------------------------------------------- 1 | /* 2 | CLTableWithFooterViewController.m 3 | 4 | Copyright (c) 2013 Chris Ledet 5 | Licensed under the MIT license 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 8 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation 9 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 10 | to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 16 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 18 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | */ 21 | 22 | #import "CLTableWithFooterViewController.h" 23 | 24 | @interface CLTableWithFooterViewController() 25 | 26 | @property (nonatomic, strong) UIImageView *footerImageView; 27 | 28 | @end 29 | 30 | @implementation CLTableWithFooterViewController 31 | 32 | #pragma mark Layout 33 | 34 | - (void)viewDidLoad 35 | { 36 | [super viewDidLoad]; 37 | 38 | if (!self.tableView) { 39 | [self setUpTableView]; 40 | } 41 | 42 | self.footerImageView = [[UIImageView alloc] initWithFrame:CGRectZero]; 43 | [self.view addSubview:self.footerImageView]; 44 | } 45 | 46 | - (void)setUpTableView 47 | { 48 | self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; 49 | self.tableView.delegate = self; 50 | self.tableView.dataSource = self; 51 | [self.view addSubview:self.tableView]; 52 | } 53 | 54 | #pragma mark Properties 55 | 56 | - (void)setFooterImage:(UIImage *)footerImage 57 | { 58 | if (_footerImage != footerImage) { 59 | _footerImage = footerImage; 60 | 61 | self.footerImageView.image = self.footerImage; 62 | self.footerImageView.frame = CGRectZero; 63 | } 64 | } 65 | 66 | #pragma mark UIScrollView Delegate 67 | 68 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 69 | { 70 | int totalHeightOfScrollView = scrollView.contentSize.height - self.footerImageView.image.size.height; 71 | float footerImageViewY = (totalHeightOfScrollView - scrollView.contentOffset.y); 72 | float footerImageViewX = 0; 73 | float bottomEdge = scrollView.contentOffset.y + scrollView.frame.size.height; 74 | 75 | if (bottomEdge >= scrollView.contentSize.height) { 76 | footerImageViewY = scrollView.frame.size.height - self.footerImageView.image.size.height; 77 | } 78 | 79 | if (self.footerImageView.image.size.width < self.view.frame.size.width) { 80 | footerImageViewX = (self.view.frame.size.width/2)-(self.footerImageView.image.size.width/2); 81 | } 82 | 83 | [self.view addSubview:self.footerImageView]; 84 | self.footerImageView.frame = CGRectMake(footerImageViewX, footerImageViewY, self.footerImageView.image.size.width, self.footerImageView.image.size.height); 85 | } 86 | 87 | @end 88 | --------------------------------------------------------------------------------