The appearance of the table inside, inside the viewcontroller. Best way to do this?

I have a main main screen in my application, which, in the end, I hope to place the table view in the center. When the button is pressed, the table view switches to the map view.

I would do this as part of the main view, but I want the surrounding area to remain the same. I dragged the view to the center of the home page view controller and set up my table view there. How to access data in this view?

As far as I know, there is no way to set tableview dispatcher for it. Any help would be greatly appreciated.

+6
source share
1 answer

You can make any kind of Controller responsible for the views corresponding to the UITableViewDelegate and UITableViewDataSource protocols in your header file (.h):

@interface YourViewControllerClass : UIViewController <UITableViewDelegate, UITableViewDataSource>

And then implement the appropriate methods in your implementation file (.m).

If you are using IB, drag the TableView data source and delegate the outputs to a subclass of the view class.

+10
source

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


All Articles