├── .gitignore ├── LICENSE ├── README.md ├── TableViewReloadAnimation.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── TableViewReloadAnimation ├── AppDelegate.swift ├── Assets.xcassets │ ├── 1024x1024.imageset │ │ ├── 1024x1024.jpg │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CustomCell.swift ├── Info.plist ├── UITableView+Extension.swift └── ViewController.swift ├── TableViewReloadAnimationTests ├── Info.plist └── TableViewReloadAnimationTests.swift ├── TableViewReloadAnimationUITests ├── Info.plist └── TableViewReloadAnimationUITests.swift └── gifs ├── bottom.gif ├── capitanMarvel.gif ├── daredevil.gif ├── deadpool.gif ├── doctorStrange.gif ├── headerFooter.gif ├── hulk.gif ├── ironMan.gif ├── left.gif ├── right.gif ├── rotate.gif ├── spiderMan.gif ├── thor.gif └── top.gif /.gitignore: -------------------------------------------------------------------------------- 1 | ## OS X files 2 | .DS_Store 3 | .DS_Store? 4 | .Trashes 5 | .Spotlight-V100 6 | *.swp 7 | 8 | ## Xcode build files 9 | DerivedData/ 10 | build/ 11 | 12 | ## Xcode private settings 13 | *.pbxuser 14 | !default.pbxuser 15 | *.mode1v3 16 | !default.mode1v3 17 | *.mode2v3 18 | !default.mode2v3 19 | *.perspectivev3 20 | !default.perspectivev3 21 | 22 | xcuserdata/ 23 | 24 | ## Other 25 | *.xccheckout 26 | *.moved-aside 27 | *.xcuserstate 28 | *.xcscmblueprint 29 | 30 | ## Obj-C/Swift specific 31 | *.hmap 32 | *.ipa 33 | *.dSYM.zip 34 | *.dSYM 35 | 36 | ## Swift Package Manager 37 | .build/ 38 | 39 | ## Carthage 40 | Carthage/Build 41 | 42 | # fastlane 43 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 44 | 45 | fastlane/report.xml 46 | fastlane/Preview.html 47 | fastlane/screenshots 48 | fastlane/test_output 49 | 50 | ## Playgrounds 51 | timeline.xctimeline 52 | playground.xcworkspace 53 | 54 | ## Cocoapods 55 | *.podspec -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Shota Ioramashvili 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Reload tableview with animation

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 |
right to leftbottom to topleft to righttop to bottom
with header and footer.rotation3D(type: .ironMan).rotation3D(type: .thor).rotation3D(type: .spiderMan)
.rotation3D(type: .captainMarvel).rotation3D(type: .doctorStrange).rotation3D(type: .daredevil).rotation3D(type: .deadpool)
40 | 41 | ## Requirements 42 | 43 | - iOS 9.0+ 44 | 45 | ## Installation 46 | 47 | ### CocoaPods 48 | 49 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: 50 | 51 | ```bash 52 | $ gem install cocoapods 53 | ``` 54 | 55 | To integrate TableViewReloadAnimation into your Xcode project using CocoaPods, specify it in your `Podfile`: 56 | 57 | ```ruby 58 | source 'https://github.com/CocoaPods/Specs.git' 59 | platform :ios, '9.0' 60 | use_frameworks! 61 | 62 | target '' do 63 | pod 'TableViewReloadAnimation', '~> 0.0.5' 64 | end 65 | ``` 66 | 67 | Then, run the following command: 68 | 69 | ```bash 70 | $ pod install 71 | ``` 72 | 73 | ## Usage 74 | 75 | ```swift 76 | import TableViewReloadAnimation 77 | 78 | ``` 79 | in viewDidAppear 80 | 81 | ```swift 82 | // left animation 83 | tableView.reloadData( 84 | with: .simple(duration: 0.45, direction: .left(useCellsFrame: true), 85 | constantDelay: 0)) 86 | 87 | // right with spring 88 | tableView.reloadData( 89 | with: .spring(duration: 0.45, damping: 0.65, velocity: 1, direction: .right(useCellsFrame: false), 90 | constantDelay: 0)) 91 | 92 | // rotation with spring 93 | tableView.reloadData( 94 | with: .spring(duration: 0.45, damping: 0.65, velocity: 1, direction: .rotation(angle: Double.pi / 2), 95 | constantDelay: 0)) 96 | 97 | // rotation 3d 98 | tableView.reloadData( 99 | with: .simple(duration: 0.75, direction: .rotation3D(type: .ironMan), 100 | constantDelay: 0)) 101 | ``` 102 | -------------------------------------------------------------------------------- /TableViewReloadAnimation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 430E21C01EA10BB000990711 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430E21BF1EA10BB000990711 /* AppDelegate.swift */; }; 11 | 430E21C21EA10BB000990711 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430E21C11EA10BB000990711 /* ViewController.swift */; }; 12 | 430E21C51EA10BB000990711 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 430E21C31EA10BB000990711 /* Main.storyboard */; }; 13 | 430E21C71EA10BB000990711 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 430E21C61EA10BB000990711 /* Assets.xcassets */; }; 14 | 430E21CA1EA10BB000990711 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 430E21C81EA10BB000990711 /* LaunchScreen.storyboard */; }; 15 | 430E21D51EA10BB000990711 /* TableViewReloadAnimationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430E21D41EA10BB000990711 /* TableViewReloadAnimationTests.swift */; }; 16 | 430E21E01EA10BB000990711 /* TableViewReloadAnimationUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430E21DF1EA10BB000990711 /* TableViewReloadAnimationUITests.swift */; }; 17 | 430E21EE1EA10CD800990711 /* CustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430E21ED1EA10CD800990711 /* CustomCell.swift */; }; 18 | 430E21F01EA10DE300990711 /* UITableView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 430E21EF1EA10DE300990711 /* UITableView+Extension.swift */; }; 19 | 432C4F781EA61FC200D96DEB /* TableViewReloadAnimation.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 432C4F771EA61FC200D96DEB /* TableViewReloadAnimation.podspec */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 430E21D11EA10BB000990711 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 430E21B41EA10BAF00990711 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 430E21BB1EA10BB000990711; 28 | remoteInfo = TableViewReloadAnimation; 29 | }; 30 | 430E21DC1EA10BB000990711 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 430E21B41EA10BAF00990711 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 430E21BB1EA10BB000990711; 35 | remoteInfo = TableViewReloadAnimation; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 430E21BC1EA10BB000990711 /* TableViewReloadAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TableViewReloadAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 430E21BF1EA10BB000990711 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 42 | 430E21C11EA10BB000990711 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 43 | 430E21C41EA10BB000990711 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 430E21C61EA10BB000990711 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 430E21C91EA10BB000990711 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 430E21CB1EA10BB000990711 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 430E21D01EA10BB000990711 /* TableViewReloadAnimationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TableViewReloadAnimationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 430E21D41EA10BB000990711 /* TableViewReloadAnimationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewReloadAnimationTests.swift; sourceTree = ""; }; 49 | 430E21D61EA10BB000990711 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 430E21DB1EA10BB000990711 /* TableViewReloadAnimationUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TableViewReloadAnimationUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 430E21DF1EA10BB000990711 /* TableViewReloadAnimationUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewReloadAnimationUITests.swift; sourceTree = ""; }; 52 | 430E21E11EA10BB000990711 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 430E21ED1EA10CD800990711 /* CustomCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomCell.swift; sourceTree = ""; }; 54 | 430E21EF1EA10DE300990711 /* UITableView+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITableView+Extension.swift"; sourceTree = ""; }; 55 | 432C4F771EA61FC200D96DEB /* TableViewReloadAnimation.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TableViewReloadAnimation.podspec; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 430E21B91EA10BB000990711 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | 430E21CD1EA10BB000990711 /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | 430E21D81EA10BB000990711 /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 430E21B31EA10BAF00990711 = { 84 | isa = PBXGroup; 85 | children = ( 86 | 432C4F771EA61FC200D96DEB /* TableViewReloadAnimation.podspec */, 87 | 430E21BE1EA10BB000990711 /* TableViewReloadAnimation */, 88 | 430E21D31EA10BB000990711 /* TableViewReloadAnimationTests */, 89 | 430E21DE1EA10BB000990711 /* TableViewReloadAnimationUITests */, 90 | 430E21BD1EA10BB000990711 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 430E21BD1EA10BB000990711 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 430E21BC1EA10BB000990711 /* TableViewReloadAnimation.app */, 98 | 430E21D01EA10BB000990711 /* TableViewReloadAnimationTests.xctest */, 99 | 430E21DB1EA10BB000990711 /* TableViewReloadAnimationUITests.xctest */, 100 | ); 101 | name = Products; 102 | sourceTree = ""; 103 | }; 104 | 430E21BE1EA10BB000990711 /* TableViewReloadAnimation */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 430E21BF1EA10BB000990711 /* AppDelegate.swift */, 108 | 430E21C11EA10BB000990711 /* ViewController.swift */, 109 | 430E21C31EA10BB000990711 /* Main.storyboard */, 110 | 430E21C61EA10BB000990711 /* Assets.xcassets */, 111 | 430E21C81EA10BB000990711 /* LaunchScreen.storyboard */, 112 | 430E21CB1EA10BB000990711 /* Info.plist */, 113 | 430E21ED1EA10CD800990711 /* CustomCell.swift */, 114 | 430E21EF1EA10DE300990711 /* UITableView+Extension.swift */, 115 | ); 116 | path = TableViewReloadAnimation; 117 | sourceTree = ""; 118 | }; 119 | 430E21D31EA10BB000990711 /* TableViewReloadAnimationTests */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 430E21D41EA10BB000990711 /* TableViewReloadAnimationTests.swift */, 123 | 430E21D61EA10BB000990711 /* Info.plist */, 124 | ); 125 | path = TableViewReloadAnimationTests; 126 | sourceTree = ""; 127 | }; 128 | 430E21DE1EA10BB000990711 /* TableViewReloadAnimationUITests */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 430E21DF1EA10BB000990711 /* TableViewReloadAnimationUITests.swift */, 132 | 430E21E11EA10BB000990711 /* Info.plist */, 133 | ); 134 | path = TableViewReloadAnimationUITests; 135 | sourceTree = ""; 136 | }; 137 | /* End PBXGroup section */ 138 | 139 | /* Begin PBXNativeTarget section */ 140 | 430E21BB1EA10BB000990711 /* TableViewReloadAnimation */ = { 141 | isa = PBXNativeTarget; 142 | buildConfigurationList = 430E21E41EA10BB000990711 /* Build configuration list for PBXNativeTarget "TableViewReloadAnimation" */; 143 | buildPhases = ( 144 | 430E21B81EA10BB000990711 /* Sources */, 145 | 430E21B91EA10BB000990711 /* Frameworks */, 146 | 430E21BA1EA10BB000990711 /* Resources */, 147 | ); 148 | buildRules = ( 149 | ); 150 | dependencies = ( 151 | ); 152 | name = TableViewReloadAnimation; 153 | productName = TableViewReloadAnimation; 154 | productReference = 430E21BC1EA10BB000990711 /* TableViewReloadAnimation.app */; 155 | productType = "com.apple.product-type.application"; 156 | }; 157 | 430E21CF1EA10BB000990711 /* TableViewReloadAnimationTests */ = { 158 | isa = PBXNativeTarget; 159 | buildConfigurationList = 430E21E71EA10BB000990711 /* Build configuration list for PBXNativeTarget "TableViewReloadAnimationTests" */; 160 | buildPhases = ( 161 | 430E21CC1EA10BB000990711 /* Sources */, 162 | 430E21CD1EA10BB000990711 /* Frameworks */, 163 | 430E21CE1EA10BB000990711 /* Resources */, 164 | ); 165 | buildRules = ( 166 | ); 167 | dependencies = ( 168 | 430E21D21EA10BB000990711 /* PBXTargetDependency */, 169 | ); 170 | name = TableViewReloadAnimationTests; 171 | productName = TableViewReloadAnimationTests; 172 | productReference = 430E21D01EA10BB000990711 /* TableViewReloadAnimationTests.xctest */; 173 | productType = "com.apple.product-type.bundle.unit-test"; 174 | }; 175 | 430E21DA1EA10BB000990711 /* TableViewReloadAnimationUITests */ = { 176 | isa = PBXNativeTarget; 177 | buildConfigurationList = 430E21EA1EA10BB000990711 /* Build configuration list for PBXNativeTarget "TableViewReloadAnimationUITests" */; 178 | buildPhases = ( 179 | 430E21D71EA10BB000990711 /* Sources */, 180 | 430E21D81EA10BB000990711 /* Frameworks */, 181 | 430E21D91EA10BB000990711 /* Resources */, 182 | ); 183 | buildRules = ( 184 | ); 185 | dependencies = ( 186 | 430E21DD1EA10BB000990711 /* PBXTargetDependency */, 187 | ); 188 | name = TableViewReloadAnimationUITests; 189 | productName = TableViewReloadAnimationUITests; 190 | productReference = 430E21DB1EA10BB000990711 /* TableViewReloadAnimationUITests.xctest */; 191 | productType = "com.apple.product-type.bundle.ui-testing"; 192 | }; 193 | /* End PBXNativeTarget section */ 194 | 195 | /* Begin PBXProject section */ 196 | 430E21B41EA10BAF00990711 /* Project object */ = { 197 | isa = PBXProject; 198 | attributes = { 199 | LastSwiftUpdateCheck = 0830; 200 | LastUpgradeCheck = 0830; 201 | ORGANIZATIONNAME = Shota; 202 | TargetAttributes = { 203 | 430E21BB1EA10BB000990711 = { 204 | CreatedOnToolsVersion = 8.3.1; 205 | DevelopmentTeam = P56L8EXYGW; 206 | ProvisioningStyle = Automatic; 207 | }; 208 | 430E21CF1EA10BB000990711 = { 209 | CreatedOnToolsVersion = 8.3.1; 210 | DevelopmentTeam = P56L8EXYGW; 211 | ProvisioningStyle = Automatic; 212 | TestTargetID = 430E21BB1EA10BB000990711; 213 | }; 214 | 430E21DA1EA10BB000990711 = { 215 | CreatedOnToolsVersion = 8.3.1; 216 | DevelopmentTeam = P56L8EXYGW; 217 | ProvisioningStyle = Automatic; 218 | TestTargetID = 430E21BB1EA10BB000990711; 219 | }; 220 | }; 221 | }; 222 | buildConfigurationList = 430E21B71EA10BAF00990711 /* Build configuration list for PBXProject "TableViewReloadAnimation" */; 223 | compatibilityVersion = "Xcode 3.2"; 224 | developmentRegion = English; 225 | hasScannedForEncodings = 0; 226 | knownRegions = ( 227 | en, 228 | Base, 229 | ); 230 | mainGroup = 430E21B31EA10BAF00990711; 231 | productRefGroup = 430E21BD1EA10BB000990711 /* Products */; 232 | projectDirPath = ""; 233 | projectRoot = ""; 234 | targets = ( 235 | 430E21BB1EA10BB000990711 /* TableViewReloadAnimation */, 236 | 430E21CF1EA10BB000990711 /* TableViewReloadAnimationTests */, 237 | 430E21DA1EA10BB000990711 /* TableViewReloadAnimationUITests */, 238 | ); 239 | }; 240 | /* End PBXProject section */ 241 | 242 | /* Begin PBXResourcesBuildPhase section */ 243 | 430E21BA1EA10BB000990711 /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 432C4F781EA61FC200D96DEB /* TableViewReloadAnimation.podspec in Resources */, 248 | 430E21CA1EA10BB000990711 /* LaunchScreen.storyboard in Resources */, 249 | 430E21C71EA10BB000990711 /* Assets.xcassets in Resources */, 250 | 430E21C51EA10BB000990711 /* Main.storyboard in Resources */, 251 | ); 252 | runOnlyForDeploymentPostprocessing = 0; 253 | }; 254 | 430E21CE1EA10BB000990711 /* Resources */ = { 255 | isa = PBXResourcesBuildPhase; 256 | buildActionMask = 2147483647; 257 | files = ( 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | 430E21D91EA10BB000990711 /* Resources */ = { 262 | isa = PBXResourcesBuildPhase; 263 | buildActionMask = 2147483647; 264 | files = ( 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXResourcesBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 430E21B81EA10BB000990711 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 430E21C21EA10BB000990711 /* ViewController.swift in Sources */, 276 | 430E21EE1EA10CD800990711 /* CustomCell.swift in Sources */, 277 | 430E21C01EA10BB000990711 /* AppDelegate.swift in Sources */, 278 | 430E21F01EA10DE300990711 /* UITableView+Extension.swift in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | 430E21CC1EA10BB000990711 /* Sources */ = { 283 | isa = PBXSourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | 430E21D51EA10BB000990711 /* TableViewReloadAnimationTests.swift in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | 430E21D71EA10BB000990711 /* Sources */ = { 291 | isa = PBXSourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | 430E21E01EA10BB000990711 /* TableViewReloadAnimationUITests.swift in Sources */, 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXSourcesBuildPhase section */ 299 | 300 | /* Begin PBXTargetDependency section */ 301 | 430E21D21EA10BB000990711 /* PBXTargetDependency */ = { 302 | isa = PBXTargetDependency; 303 | target = 430E21BB1EA10BB000990711 /* TableViewReloadAnimation */; 304 | targetProxy = 430E21D11EA10BB000990711 /* PBXContainerItemProxy */; 305 | }; 306 | 430E21DD1EA10BB000990711 /* PBXTargetDependency */ = { 307 | isa = PBXTargetDependency; 308 | target = 430E21BB1EA10BB000990711 /* TableViewReloadAnimation */; 309 | targetProxy = 430E21DC1EA10BB000990711 /* PBXContainerItemProxy */; 310 | }; 311 | /* End PBXTargetDependency section */ 312 | 313 | /* Begin PBXVariantGroup section */ 314 | 430E21C31EA10BB000990711 /* Main.storyboard */ = { 315 | isa = PBXVariantGroup; 316 | children = ( 317 | 430E21C41EA10BB000990711 /* Base */, 318 | ); 319 | name = Main.storyboard; 320 | sourceTree = ""; 321 | }; 322 | 430E21C81EA10BB000990711 /* LaunchScreen.storyboard */ = { 323 | isa = PBXVariantGroup; 324 | children = ( 325 | 430E21C91EA10BB000990711 /* Base */, 326 | ); 327 | name = LaunchScreen.storyboard; 328 | sourceTree = ""; 329 | }; 330 | /* End PBXVariantGroup section */ 331 | 332 | /* Begin XCBuildConfiguration section */ 333 | 430E21E21EA10BB000990711 /* Debug */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 346 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 352 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 353 | CLANG_WARN_UNREACHABLE_CODE = YES; 354 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 355 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 356 | COPY_PHASE_STRIP = NO; 357 | DEBUG_INFORMATION_FORMAT = dwarf; 358 | ENABLE_STRICT_OBJC_MSGSEND = YES; 359 | ENABLE_TESTABILITY = YES; 360 | GCC_C_LANGUAGE_STANDARD = gnu99; 361 | GCC_DYNAMIC_NO_PIC = NO; 362 | GCC_NO_COMMON_BLOCKS = YES; 363 | GCC_OPTIMIZATION_LEVEL = 0; 364 | GCC_PREPROCESSOR_DEFINITIONS = ( 365 | "DEBUG=1", 366 | "$(inherited)", 367 | ); 368 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 369 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 370 | GCC_WARN_UNDECLARED_SELECTOR = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 372 | GCC_WARN_UNUSED_FUNCTION = YES; 373 | GCC_WARN_UNUSED_VARIABLE = YES; 374 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 375 | MTL_ENABLE_DEBUG_INFO = YES; 376 | ONLY_ACTIVE_ARCH = YES; 377 | SDKROOT = iphoneos; 378 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 379 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 380 | }; 381 | name = Debug; 382 | }; 383 | 430E21E31EA10BB000990711 /* Release */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ALWAYS_SEARCH_USER_PATHS = NO; 387 | CLANG_ANALYZER_NONNULL = YES; 388 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 389 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 390 | CLANG_CXX_LIBRARY = "libc++"; 391 | CLANG_ENABLE_MODULES = YES; 392 | CLANG_ENABLE_OBJC_ARC = YES; 393 | CLANG_WARN_BOOL_CONVERSION = YES; 394 | CLANG_WARN_CONSTANT_CONVERSION = YES; 395 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 396 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 397 | CLANG_WARN_EMPTY_BODY = YES; 398 | CLANG_WARN_ENUM_CONVERSION = YES; 399 | CLANG_WARN_INFINITE_RECURSION = YES; 400 | CLANG_WARN_INT_CONVERSION = YES; 401 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 402 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 403 | CLANG_WARN_UNREACHABLE_CODE = YES; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 406 | COPY_PHASE_STRIP = NO; 407 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 408 | ENABLE_NS_ASSERTIONS = NO; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | GCC_C_LANGUAGE_STANDARD = gnu99; 411 | GCC_NO_COMMON_BLOCKS = YES; 412 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 413 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 414 | GCC_WARN_UNDECLARED_SELECTOR = YES; 415 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 416 | GCC_WARN_UNUSED_FUNCTION = YES; 417 | GCC_WARN_UNUSED_VARIABLE = YES; 418 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 419 | MTL_ENABLE_DEBUG_INFO = NO; 420 | SDKROOT = iphoneos; 421 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 422 | VALIDATE_PRODUCT = YES; 423 | }; 424 | name = Release; 425 | }; 426 | 430E21E51EA10BB000990711 /* Debug */ = { 427 | isa = XCBuildConfiguration; 428 | buildSettings = { 429 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 430 | DEVELOPMENT_TEAM = P56L8EXYGW; 431 | INFOPLIST_FILE = TableViewReloadAnimation/Info.plist; 432 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 434 | PRODUCT_BUNDLE_IDENTIFIER = com.shota.TableViewReloadAnimation; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_VERSION = 3.0; 437 | TARGETED_DEVICE_FAMILY = "1,2"; 438 | }; 439 | name = Debug; 440 | }; 441 | 430E21E61EA10BB000990711 /* Release */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | DEVELOPMENT_TEAM = P56L8EXYGW; 446 | INFOPLIST_FILE = TableViewReloadAnimation/Info.plist; 447 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 449 | PRODUCT_BUNDLE_IDENTIFIER = com.shota.TableViewReloadAnimation; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | SWIFT_VERSION = 3.0; 452 | TARGETED_DEVICE_FAMILY = "1,2"; 453 | }; 454 | name = Release; 455 | }; 456 | 430E21E81EA10BB000990711 /* Debug */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 460 | BUNDLE_LOADER = "$(TEST_HOST)"; 461 | DEVELOPMENT_TEAM = P56L8EXYGW; 462 | INFOPLIST_FILE = TableViewReloadAnimationTests/Info.plist; 463 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 464 | PRODUCT_BUNDLE_IDENTIFIER = com.shota.TableViewReloadAnimationTests; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | SWIFT_VERSION = 3.0; 467 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TableViewReloadAnimation.app/TableViewReloadAnimation"; 468 | }; 469 | name = Debug; 470 | }; 471 | 430E21E91EA10BB000990711 /* Release */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 475 | BUNDLE_LOADER = "$(TEST_HOST)"; 476 | DEVELOPMENT_TEAM = P56L8EXYGW; 477 | INFOPLIST_FILE = TableViewReloadAnimationTests/Info.plist; 478 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 479 | PRODUCT_BUNDLE_IDENTIFIER = com.shota.TableViewReloadAnimationTests; 480 | PRODUCT_NAME = "$(TARGET_NAME)"; 481 | SWIFT_VERSION = 3.0; 482 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TableViewReloadAnimation.app/TableViewReloadAnimation"; 483 | }; 484 | name = Release; 485 | }; 486 | 430E21EB1EA10BB000990711 /* Debug */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 490 | DEVELOPMENT_TEAM = P56L8EXYGW; 491 | INFOPLIST_FILE = TableViewReloadAnimationUITests/Info.plist; 492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 493 | PRODUCT_BUNDLE_IDENTIFIER = com.shota.TableViewReloadAnimationUITests; 494 | PRODUCT_NAME = "$(TARGET_NAME)"; 495 | SWIFT_VERSION = 3.0; 496 | TEST_TARGET_NAME = TableViewReloadAnimation; 497 | }; 498 | name = Debug; 499 | }; 500 | 430E21EC1EA10BB000990711 /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 504 | DEVELOPMENT_TEAM = P56L8EXYGW; 505 | INFOPLIST_FILE = TableViewReloadAnimationUITests/Info.plist; 506 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 507 | PRODUCT_BUNDLE_IDENTIFIER = com.shota.TableViewReloadAnimationUITests; 508 | PRODUCT_NAME = "$(TARGET_NAME)"; 509 | SWIFT_VERSION = 3.0; 510 | TEST_TARGET_NAME = TableViewReloadAnimation; 511 | }; 512 | name = Release; 513 | }; 514 | /* End XCBuildConfiguration section */ 515 | 516 | /* Begin XCConfigurationList section */ 517 | 430E21B71EA10BAF00990711 /* Build configuration list for PBXProject "TableViewReloadAnimation" */ = { 518 | isa = XCConfigurationList; 519 | buildConfigurations = ( 520 | 430E21E21EA10BB000990711 /* Debug */, 521 | 430E21E31EA10BB000990711 /* Release */, 522 | ); 523 | defaultConfigurationIsVisible = 0; 524 | defaultConfigurationName = Release; 525 | }; 526 | 430E21E41EA10BB000990711 /* Build configuration list for PBXNativeTarget "TableViewReloadAnimation" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | 430E21E51EA10BB000990711 /* Debug */, 530 | 430E21E61EA10BB000990711 /* Release */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | defaultConfigurationName = Release; 534 | }; 535 | 430E21E71EA10BB000990711 /* Build configuration list for PBXNativeTarget "TableViewReloadAnimationTests" */ = { 536 | isa = XCConfigurationList; 537 | buildConfigurations = ( 538 | 430E21E81EA10BB000990711 /* Debug */, 539 | 430E21E91EA10BB000990711 /* Release */, 540 | ); 541 | defaultConfigurationIsVisible = 0; 542 | defaultConfigurationName = Release; 543 | }; 544 | 430E21EA1EA10BB000990711 /* Build configuration list for PBXNativeTarget "TableViewReloadAnimationUITests" */ = { 545 | isa = XCConfigurationList; 546 | buildConfigurations = ( 547 | 430E21EB1EA10BB000990711 /* Debug */, 548 | 430E21EC1EA10BB000990711 /* Release */, 549 | ); 550 | defaultConfigurationIsVisible = 0; 551 | defaultConfigurationName = Release; 552 | }; 553 | /* End XCConfigurationList section */ 554 | }; 555 | rootObject = 430E21B41EA10BAF00990711 /* Project object */; 556 | } 557 | -------------------------------------------------------------------------------- /TableViewReloadAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TableViewReloadAnimation/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // TableViewReloadAnimation 4 | // 5 | // Created by Shota Ioramashvili on 4/14/17. 6 | // Copyright © 2017 Shota. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /TableViewReloadAnimation/Assets.xcassets/1024x1024.imageset/1024x1024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/TableViewReloadAnimation/Assets.xcassets/1024x1024.imageset/1024x1024.jpg -------------------------------------------------------------------------------- /TableViewReloadAnimation/Assets.xcassets/1024x1024.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "1024x1024.jpg", 6 | "scale" : "1x" 7 | } 8 | ], 9 | "info" : { 10 | "version" : 1, 11 | "author" : "xcode" 12 | } 13 | } -------------------------------------------------------------------------------- /TableViewReloadAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /TableViewReloadAnimation/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TableViewReloadAnimation/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /TableViewReloadAnimation/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 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 | 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 | -------------------------------------------------------------------------------- /TableViewReloadAnimation/CustomCell.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class CustomCell: UITableViewCell { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /TableViewReloadAnimation/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /TableViewReloadAnimation/UITableView+Extension.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import UIKit 3 | 4 | public extension UITableView { 5 | 6 | typealias Complition = (() -> Void) 7 | typealias HeaderFooterTuple = (header: UIView?, footer: UIView?) 8 | typealias VisibleHeaderFooter = [Int: HeaderFooterTuple] 9 | 10 | public enum AnimationType { 11 | case simple(duration: TimeInterval, direction: Direction, constantDelay: TimeInterval) 12 | case spring(duration: TimeInterval, damping: CGFloat, velocity: CGFloat, direction: Direction, constantDelay: TimeInterval) 13 | 14 | public func animate(tableView: UITableView, reversed: Bool = false, completion: Complition? = nil) { 15 | var duration: TimeInterval! 16 | var damping: CGFloat = 1 17 | var velocity: CGFloat = 0 18 | var constantDelay: TimeInterval! 19 | var direction: Direction! 20 | 21 | switch self { 22 | case .simple(let _duration, let _direction, let _constantDelay): 23 | duration = _duration 24 | direction = _direction 25 | constantDelay = _constantDelay 26 | case .spring(let _duration, let _damping, let _velocity, let _direction, let _constantDelay): 27 | duration = _duration 28 | damping = _damping 29 | velocity = _velocity 30 | direction = _direction 31 | constantDelay = _constantDelay 32 | } 33 | 34 | let _ = tableView.visibleCells 35 | let indexPathsForVisibleRows = tableView.indexPathsForVisibleRows 36 | let grouped = indexPathsForVisibleRows?.grouped(by: { (indexPath: IndexPath) -> Int in 37 | return indexPath.section 38 | }).sorted(by: { $0.key < $1.key }) 39 | 40 | let visibleHeaderFooter = tableView.visibleSectionIndexes() 41 | var visibleViews = [UIView]() 42 | 43 | for items in grouped! { 44 | var currentViews: [UIView] = items.value.flatMap { tableView.cellForRow(at: $0) } 45 | if let header = visibleHeaderFooter[items.key]?.header { 46 | currentViews.insert(header, at: 0) 47 | } 48 | 49 | if let footer = visibleHeaderFooter[items.key]?.footer { 50 | currentViews.append(footer) 51 | } 52 | 53 | visibleViews += currentViews 54 | } 55 | 56 | let visibleCellsCount = Double(visibleViews.count) 57 | let cells = direction.reverse(for: reversed ? visibleViews.reversed() : visibleViews) 58 | cells.enumerated().forEach { item in 59 | let delay: TimeInterval = duration / visibleCellsCount * Double(item.offset) + Double(item.offset) * constantDelay 60 | direction.startValues(tableView: tableView, for: item.element) 61 | let anchor = item.element.layer.anchorPoint 62 | 63 | UIView.animate( 64 | withDuration: duration, 65 | delay: delay, 66 | usingSpringWithDamping: damping, 67 | initialSpringVelocity: velocity, 68 | options: .curveEaseInOut, 69 | animations: { 70 | direction.endValues(tableView: tableView, for: item.element) 71 | }, completion: { finished in 72 | item.element.layer.anchorPoint = anchor 73 | completion?() 74 | }) 75 | 76 | // print(duration, delay) 77 | } 78 | 79 | } 80 | } 81 | 82 | public enum Direction { 83 | case left(useCellsFrame: Bool) 84 | case top(useCellsFrame: Bool) 85 | case right(useCellsFrame: Bool) 86 | case bottom(useCellsFrame: Bool) 87 | case rotation(angle: Double) 88 | case rotation3D(type: TransformType) 89 | 90 | // For testing only 91 | init?(rawValue: Int, useCellsFrame: Bool) { 92 | switch rawValue { 93 | case 0: 94 | self = Direction.left(useCellsFrame: useCellsFrame) 95 | case 1: 96 | self = Direction.top(useCellsFrame: useCellsFrame) 97 | case 2: 98 | self = Direction.right(useCellsFrame: useCellsFrame) 99 | case 3: 100 | self = Direction.bottom(useCellsFrame: useCellsFrame) 101 | case 4: 102 | self = Direction.rotation(angle: -Double.pi / 2) 103 | default: 104 | return nil 105 | } 106 | } 107 | 108 | func startValues(tableView: UITableView, for cell: UIView) { 109 | cell.alpha = 0 110 | switch self { 111 | case .left(let useCellsFrame): 112 | cell.frame.origin.x += useCellsFrame ? cell.frame.width : tableView.frame.width 113 | case .top(let useCellsFrame): 114 | cell.frame.origin.y += useCellsFrame ? cell.frame.height : tableView.frame.height 115 | case .right(let useCellsFrame): 116 | cell.frame.origin.x -= useCellsFrame ? cell.frame.width : tableView.frame.width 117 | case .bottom(let useCellsFrame): 118 | cell.frame.origin.y -= useCellsFrame ? cell.frame.height : tableView.frame.height 119 | case .rotation(let angle): 120 | cell.transform = CGAffineTransform(rotationAngle: CGFloat(angle)) 121 | case .rotation3D(let type): 122 | type.set(for: cell) 123 | } 124 | } 125 | 126 | func endValues(tableView: UITableView, for cell: UIView) { 127 | cell.alpha = 1 128 | switch self { 129 | case .left(let useCellsFrame): 130 | cell.frame.origin.x -= useCellsFrame ? cell.frame.width : tableView.frame.width 131 | case .top(let useCellsFrame): 132 | cell.frame.origin.y -= useCellsFrame ? cell.frame.height : tableView.frame.height 133 | case .right(let useCellsFrame): 134 | cell.frame.origin.x += useCellsFrame ? cell.frame.width : tableView.frame.width 135 | case .bottom(let useCellsFrame): 136 | cell.frame.origin.y += useCellsFrame ? cell.frame.height : tableView.frame.height 137 | case .rotation(_): 138 | cell.transform = .identity 139 | case .rotation3D(_): 140 | cell.layer.transform = CATransform3DIdentity 141 | } 142 | } 143 | 144 | func reverse(for cells: [UIView]) -> [UIView] { 145 | switch self { 146 | case .bottom(_): 147 | return cells.reversed() 148 | default: 149 | return cells 150 | } 151 | } 152 | 153 | public enum TransformType { 154 | case ironMan 155 | case thor 156 | case spiderMan 157 | case captainMarvel 158 | case hulk 159 | case daredevil 160 | case deadpool 161 | case doctorStrange 162 | 163 | func set(for cell: UIView) { 164 | let oldFrame = cell.frame 165 | var transform = CATransform3DIdentity 166 | transform.m34 = 1.0 / -500 167 | 168 | switch self { 169 | case .ironMan: 170 | cell.layer.anchorPoint = CGPoint(x: 0, y: 0.5) 171 | transform = CATransform3DRotate(transform, CGFloat(Double.pi / 2), 0, 1, 0) 172 | case .thor: 173 | cell.layer.anchorPoint = CGPoint(x: 0, y: 0.5) 174 | transform = CATransform3DRotate(transform, -CGFloat(Double.pi / 2), 0, 1, 0) 175 | case .spiderMan: 176 | cell.layer.anchorPoint = .zero 177 | transform = CATransform3DRotate(transform, CGFloat(Double.pi / 2), 0, 1, 1) 178 | case .captainMarvel: 179 | cell.layer.anchorPoint = CGPoint(x: 1, y: 1) 180 | transform = CATransform3DRotate(transform, -CGFloat(Double.pi / 2), 1, 1, 1) 181 | case .hulk: 182 | cell.layer.anchorPoint = CGPoint(x: 1, y: 1) 183 | transform = CATransform3DRotate(transform, CGFloat(Double.pi / 2), 1, 1, 1) 184 | case .daredevil: 185 | cell.layer.anchorPoint = CGPoint(x: 1, y: 0.5) 186 | transform = CATransform3DRotate(transform, CGFloat(Double.pi / 2), 0, 1, 0) 187 | case .deadpool: 188 | cell.layer.anchorPoint = CGPoint(x: 1, y: 0.5) 189 | transform = CATransform3DRotate(transform, CGFloat(Double.pi / 2), 1, 0, 1) 190 | case .doctorStrange: 191 | cell.layer.anchorPoint = CGPoint(x: 0.5, y: 0) 192 | transform = CATransform3DRotate(transform, -CGFloat(Double.pi / 2), 1, 0, 0) 193 | } 194 | 195 | cell.frame = oldFrame 196 | cell.layer.transform = transform 197 | } 198 | } 199 | } 200 | 201 | public func reloadData(with animation: AnimationType, reversed: Bool = false, completion: Complition? = nil) { 202 | reloadData() 203 | animation.animate(tableView: self, reversed: reversed, completion: completion) 204 | } 205 | } 206 | 207 | extension UITableView { 208 | fileprivate func visibleSectionIndexes() -> VisibleHeaderFooter { 209 | let visibleTableViewRect = CGRect(x: contentOffset.x, y: contentOffset.y, width: bounds.size.width, height: bounds.size.height) 210 | 211 | var visibleHeaderFooter: VisibleHeaderFooter = [:] 212 | (0..(by criteria: (Element) -> T) -> [T: [Element]] { 229 | var groups = [T: [Element]]() 230 | for element in self { 231 | let key = criteria(element) 232 | if groups.keys.contains(key) == false { 233 | groups[key] = [Element]() 234 | } 235 | groups[key]?.append(element) 236 | } 237 | return groups 238 | } 239 | } 240 | 241 | 242 | 243 | 244 | -------------------------------------------------------------------------------- /TableViewReloadAnimation/ViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class ViewController: UIViewController { 4 | 5 | @IBOutlet var tableView: UITableView! 6 | @IBOutlet var directionStackView: UIStackView! 7 | @IBOutlet var cellsOrderSwitch: UISwitch! 8 | var selectedDirection1: UITableView.Direction! 9 | var selectedDirection2: UITableView.Direction! 10 | 11 | override func viewDidLoad() { 12 | super.viewDidLoad() 13 | 14 | tableView.delegate = self 15 | tableView.dataSource = self 16 | tableView.rowHeight = UITableViewAutomaticDimension 17 | tableView.sectionHeaderHeight = UITableViewAutomaticDimension 18 | 19 | selectedDirection1 = UITableView.Direction.left(useCellsFrame: true) 20 | selectedDirection2 = UITableView.Direction.left(useCellsFrame: false) 21 | 22 | tableView.reloadData() 23 | } 24 | 25 | override func viewDidAppear(_ animated: Bool) { 26 | super.viewDidAppear(animated) 27 | } 28 | 29 | @IBAction func selectDirection(_ sender: UIButton) { 30 | directionStackView.subviews.forEach { 31 | ($0 as? UIButton)?.backgroundColor = UIColor.white 32 | } 33 | 34 | sender.backgroundColor = UIColor.purple 35 | selectedDirection1 = UITableView.Direction(rawValue: sender.tag, useCellsFrame: true)! 36 | selectedDirection2 = UITableView.Direction(rawValue: sender.tag, useCellsFrame: false)! 37 | 38 | showHideDirectionStackView(sender) 39 | } 40 | 41 | @IBAction func showHideDirectionStackView(_ sender: Any) { 42 | UIView.animate(withDuration: 0.2) { 43 | self.directionStackView.isHidden = !self.directionStackView.isHidden 44 | } 45 | } 46 | 47 | @IBAction func switchChanged(_ sender: Any) { 48 | showHideDirectionStackView(sender) 49 | } 50 | 51 | @IBAction func anim1(_ sender: Any) { 52 | tableView.reloadData(with: .simple(duration: 0.45, direction: selectedDirection1, constantDelay: 0), reversed: !cellsOrderSwitch.isOn) 53 | } 54 | 55 | @IBAction func anim2(_ sender: Any) { 56 | tableView.reloadData(with: .simple(duration: 0.45, direction: selectedDirection2, constantDelay: 0), reversed: !cellsOrderSwitch.isOn) 57 | } 58 | 59 | @IBAction func spring1(_ sender: Any) { 60 | tableView.reloadData(with: .spring(duration: 0.45, damping: 0.75, velocity: 1, direction: selectedDirection1, constantDelay: 0), reversed: !cellsOrderSwitch.isOn) 61 | } 62 | 63 | @IBAction func spring2(_ sender: Any) { 64 | tableView.reloadData(with: .spring(duration: 0.45, damping: 0.75, velocity: 1, direction: selectedDirection2, constantDelay: 0), reversed: !cellsOrderSwitch.isOn) 65 | } 66 | } 67 | 68 | extension ViewController: UITableViewDelegate, UITableViewDataSource { 69 | func numberOfSections(in tableView: UITableView) -> Int { 70 | return 3 71 | } 72 | 73 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 74 | return 3 75 | } 76 | 77 | func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { 78 | let v = UITableViewHeaderFooterView() 79 | v.contentView.backgroundColor = #colorLiteral(red: 0.2235294118, green: 0.6784313725, blue: 0.8196078431, alpha: 1) 80 | return v 81 | } 82 | 83 | func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { 84 | return 30 85 | } 86 | 87 | func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { 88 | let v = UITableViewHeaderFooterView() 89 | v.contentView.backgroundColor = #colorLiteral(red: 0.3254901961, green: 0.7333333333, blue: 0.7058823529, alpha: 1) 90 | return v 91 | } 92 | 93 | func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { 94 | return 30 95 | } 96 | 97 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 98 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) 99 | return cell 100 | } 101 | 102 | func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { 103 | return 50 104 | } 105 | } 106 | 107 | extension Bool { 108 | static var random: Bool { 109 | return arc4random_uniform(2) == 0 ? true : false 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /TableViewReloadAnimationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /TableViewReloadAnimationTests/TableViewReloadAnimationTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewReloadAnimationTests.swift 3 | // TableViewReloadAnimationTests 4 | // 5 | // Created by Shota Ioramashvili on 4/14/17. 6 | // Copyright © 2017 Shota. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import TableViewReloadAnimation 11 | 12 | class TableViewReloadAnimationTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /TableViewReloadAnimationUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /TableViewReloadAnimationUITests/TableViewReloadAnimationUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewReloadAnimationUITests.swift 3 | // TableViewReloadAnimationUITests 4 | // 5 | // Created by Shota Ioramashvili on 4/14/17. 6 | // Copyright © 2017 Shota. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class TableViewReloadAnimationUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /gifs/bottom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/bottom.gif -------------------------------------------------------------------------------- /gifs/capitanMarvel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/capitanMarvel.gif -------------------------------------------------------------------------------- /gifs/daredevil.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/daredevil.gif -------------------------------------------------------------------------------- /gifs/deadpool.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/deadpool.gif -------------------------------------------------------------------------------- /gifs/doctorStrange.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/doctorStrange.gif -------------------------------------------------------------------------------- /gifs/headerFooter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/headerFooter.gif -------------------------------------------------------------------------------- /gifs/hulk.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/hulk.gif -------------------------------------------------------------------------------- /gifs/ironMan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/ironMan.gif -------------------------------------------------------------------------------- /gifs/left.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/left.gif -------------------------------------------------------------------------------- /gifs/right.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/right.gif -------------------------------------------------------------------------------- /gifs/rotate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/rotate.gif -------------------------------------------------------------------------------- /gifs/spiderMan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/spiderMan.gif -------------------------------------------------------------------------------- /gifs/thor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/thor.gif -------------------------------------------------------------------------------- /gifs/top.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioramashvili/TableViewReloadAnimation/11579f78bc21b856071aa4aaf178ebbf9bcdf670/gifs/top.gif --------------------------------------------------------------------------------