Connect with us

Hi, what are you looking for?

Computer

Creating Tableviews Using Scrollviews for iPhone Apps Development – Part 1

During a iPhone apps development process, iPhone app developers will find TableViews as a great tool for creating applications. However, some developers may face certain hitches for example, when creating a TableView in ScrollView with table scrolling disabled. The following are useful steps that will help you create a scrollview within an iPhone application. 

  1. Create Files

  • Select the “Create new Project option” from Xcode.
  • After selecting single view application, name the application as “TableView with ScrollView” with a prefix KE, activate ARC and Storyboards and target to universal.
  • Then create a New Protocol by pressing cmd + N and select the Cocoa Touch category from the left menu. Then click on the Objective-C Protocol from the right. Save it with the name “KETableViewDataSource”. Repeat the previous steps but this time you should give the name of protocol as “KETableViewDelegate”.
  • Again press cmd + N but select Objective-C class and name the file as “KETableView” make it subclass of UIView and save it.
  1. Add Codes

  • DataSource provides data to fill the table and delegate in order to manage the interactions.
  • After adding the next methods to KETableViewDataSource, you can get a row show in the tableView. Then do the same thing for KETableViewDelegate.
  • With the @optional line Xcode is confined to display the incomplete implementation warning.
  • didSelectRowAtIndex: With this you can get the index of tableViewRow
  • willDisplayCell: will be called each time a cell will get added to the table (new or recycled). The main idea is to open up the possibility to alter the cell before it is displayed.
  • heightForRow: This is called every time you refresh the view, the default height is 50.0.

Written By

Digital Infoware is a leading mobile app development company that offers complete solution for iphone app development, android app development at affordable price.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like

Mobile

The level of competition in the iPhone app development industry is at an all-time high and as the competition increases two areas hold growing...

Mobile

Serious iOS apps are a blend of good planning, strong conceptual foundation (of both engineering and design), matchless talent, and a brilliant ecosystem. An...

Tech

We hate the restrictions iPhone imposes on us. At the same time there is no denying the fact that despite several restrictions we continue...

Design

The iPhone has given a new direction to the smart phone world. Its smooth functionalities have drawn a number of smartphones users to it....