UITableViewController custom layout for iPhone

I'm starting to program the iPhone. My first application is a UITableViewController, but now I'm experimenting a bit. The idea is to create a custom layout that looks like this:

Layout:

---------------------
Image     |    Button     
---------------------
UICalendar
---------------------
UITableView
---------------------
Button     |   Button
---------------------

QUESTION 1: As you can see, I would like to add some additional interface elements. All the tutorials I've seen describe the UITableViewController as a single UITableView (no other user interface elements included in the controller). So my question is, is it possible to extend the UITableViewController for such a layout? What is the right way to do this?

QUESTION 2: For the UITableViewController, I do not use the XIB file, but some people do. Why should I use the XIB file when creating the UITableViewController? What are the benefits? What is the best practice?

UPDATE: In fact, I think it has a separate controller for UICalendar (UICalendarController) and UITableView (UITableViewController). I just don’t know how to implement this.

thank.

+3
source share
3 answers

The standard approach to what you are trying to do is not to subclass UITableViewControlleror use the XIB file to define the interface for the view associated with UITableViewController, but instead use UIViewControllerthe XIB file that it belongs to UITableView.

UITableViewDataSource UITableViewDelegate UIViewController, .

UITableViewController, , . , UITableView s, , UITableViewController.

+6

Tapku. /.

+2

iPhone XIB. XIB , . , .

Does the UITableView come with your view for one cell? In addition, you can create custom cells and add them to the table view. To create custom table table cells, you must extend your class from UITableViewCell and implement them.

0
source

Source: https://habr.com/ru/post/1786447/


All Articles