Is it bad to have an embedded table view?

I wonder if there is a downside to having an inline table view?

I have a VC navigation controller that leads to another VC which is my "main / root" VC application.

Inside this VC, I have a container view that contains a table view.

Then there are more nets in the table view leading to other VCs. Is this a bad setting?

+3


source to share


3 answers


No, there is nothing wrong with having a table scan built in. In fact, I do this all the time. I just think it is much easier to make a better layout in your application, and there is nothing else to do when setting up a detailed view controller for a table view, whether it is inline or not.



+1


source


Apple has specific guidelines for this. In fact, if the table view takes up the entire screen, it is more efficient to use a UITableViewController. However, the overhead isn't that bad. Here's the relevant link:

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/CreateConfigureTableView/CreateConfigureTableView.html#//apple_ref/doc/uid/TP40007451-CH6-SW10

In particular, see the section:



Creating a Table View Programmatically

If you don't want to use the UITableViewController to view the table you must replicate what this class gives you "for free."

Here's one specific example of an annoying detail that needs to be handled by you:

class CustomViewController: UIViewController {
    @IBOutlet weak var optionsTableView: UITableView!
    // ... later that same day ...
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        optionsTableView.flashScrollIndicators()
        if let path = lastSelectedPath {
            optionsTableView.deselectRowAtIndexPath(path, animated: true)
        }
    }
}

      

+1


source


No, that's not bad. But if the entire screen was to be covered by a table view, I would definitely go with a table view controller just for simplicity and what you get for free. However, in some cases you need more flexibility and an inline table scan is the only way. For example, consider this example:

enter image description here

+1


source







All Articles