Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when the view controller's view is tableView/collectionView #31

Closed
MarvinNazari opened this issue Aug 4, 2016 · 4 comments
Closed

Comments

@MarvinNazari
Copy link

Hi Awesome project, but we have an issue when the view of the UIViewController is an UITableview
(example below)

class VC: UIViewController {
    override func loadView() {
        view = UITableView()
    }
}

so it adds the loadingView/emptyView inside of the tableView

@aschuch
Copy link
Owner

aschuch commented Aug 13, 2016

The default implementation of the StatefulViewController protocol uses the UIViewController's view as its backingView. I usually just add the UITableView to the view so I haven't personally run into this issue.

You can, however, always override the backingView property and return a custom view where the placeholder views should be added.

@AnthonyMDev
Copy link

This might be able to be fixed by using the ContainerViewStateMachine implementation from PR #29 as the default implementation for all view controllers.

It seems that, in order to handle odd little corner cases like this, it is safer to use a privately managed container view, rather than relying on the view of the UIViewController.

@AnthonyMDev
Copy link

In fact, rather than adding the views for the states to the backingView it may be better to do a transition FROM the view of the controller to our state view and then back.

@aschuch
Copy link
Owner

aschuch commented May 16, 2017

I've pushed some changes to master that allow for better support of UITableViewController and UICollectionViewController (thanks @AnthonyMDev).
@MarvinNazari Please take a look and report any issues. Thanks! ✌️

@aschuch aschuch closed this as completed May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants