In tutorials by 3 Comments

iOS UITableView Animation

Tutorial on how to create UITableView Animation using Objective-C

In today’s world of app development, where content and animations are the key element to the apps success.

Most of the applications in the market uses UITableView as their integral element for showing the contents. Previously Facebook used card layout to show the timeline content and now in Facebook paper they used the mild sliding in tableview to show the settings page to amaze users.

In this tutorial, we are going to learn and implement UITableView animation with simple, easy steps that too with minimal coding.
Download Source

Steps to create UITableView Animation

Step 1

  • Create a simple UITableView project in the Xcode or Create a Single View Application and Drag and drop the tableview controller into the UIView.

Step 2

  • Let’s connect the Tableview to the ViewController and name the tableview like mentioned below.

  • Connect the UITableview datasource and delegate methods to the ViewController and Include the protocols in the ViewController .h class like  <UITableViewDatasource>

Step 3

Then as usual define the delegate methods of the UITableView

  • numberOfSectionsInTableView
  • cellForRowAtIndexPath
  • numberOfRowsInSection
  • willDisplayCell

Step 4

  • Add the Quartz core framework  into the project to show animations in the UITableView and import quartzcore class into the Viewcontroller .h file
  • Create CATransform3D property in the Viewcontroller .h file which define the standard transformation matrix used in the animation as shown below

Step 5

In the Viewdidload of the ViewController.m, we need to set up the animation instances as shown below

Step 6 

Then in the delegate method of the tableview willDisplayCell apply the animation to each cell in the tableView

That’s it and We are good to go. Run the project, see the wonderful animation of the UITableView

UITableView Animation

Watch out  this space for more tutorials ……………….

Download Source

Tagged with: