Vikas Singh
Vikas Singh

Reputation: 1791

Custom Table ViewController in a StoryBoard

I need to create a view where the top half of the screen has an image and short info related to it and the bottom half has a list of items(prices from different stores for that item)(like table view controller) where each table cell(store price) can navigate the user to a full screen detail page of that item(store webpage).

Is it possible to have a mix of normal ViewController(top half page) and a Table View Controller(bottom page). How can we implement such a UI design?

Upvotes: 0

Views: 1550

Answers (3)

DanSkeel
DanSkeel

Reputation: 3970

I implemented some kind of prototype of @jrturton suggestion.

Link to Prototype

Upvotes: 3

jrturton
jrturton

Reputation: 119242

You have one UIViewController subclass, and add the table view to it by dragging and dropping in the storyboard.

You then have a bit of extra work to do to fill the gap between a table view controller and a plain view controller - declare that you conform to the datasource and delegate protocols, create an outlet for the table view, connect the outlet to the table view and connect the table view's delegate and datasource outlets to your VC.

Implement the three datasource methods (number of sections, number of rows and cellForRow...) and you're done.

Upvotes: 3

iMash
iMash

Reputation: 1188

Yes it is. You can design your viewcontroller by placing UIImageview on the top half of the screen through interface builder and remaining half screen screen you can place UITableView. Just make sure that your base class will be UIViewController that has tableView as subviewcontroller and it will work.

Upvotes: 1

Related Questions