This post will discuss how we can add a headerView to a UITableView and customize it.
The tableView will finally look like in the above figure. The headerView is the 30 pixel bar just below navigationBar and it reads "Last Synch ..."
How you make a tableView can be found anywhere on Internet, so I ll assume that you know how to make a tableView.
Open the viewController in which you have created your table and add the following code in header file within the interface declaration:
Now open the viewController in which you have created your table and add the following code in implementation file
I have created a method that will create and customize the headerView. You can call this method from viewWillAppear method.
Comments will be appreciated, if you still face any difficulty in creating a headerView, leave a comment and I will be more than happy to address it.