简体   繁体   中英

Xib referencing two xibs as view

How can I set a ViewController that will display one view or another depending on some case ?

I have ViewControllerA.xib and ViewControllerB.xib . Both have a UITableView , and some logic. I would like to load ViewControllerAB (via xib or programmatically), that display a loading screen while I get data from the network. When I have the data, I decide which view to display, A or B. I do this via addSubview , but the touch isn't responsive when I tap a row in the tableView.

In your ViewController A and B did you set the tableView's delegate and datasourse to the respective controller? It might be the problem, because your solution (with addSubview) should work. Can you post some code if it doesn't solve your problem?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM