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

Add instructions to change backing view. #13

Open
kapoorsahil opened this issue Oct 21, 2015 · 2 comments
Open

Add instructions to change backing view. #13

kapoorsahil opened this issue Oct 21, 2015 · 2 comments

Comments

@kapoorsahil
Copy link

I want a subview of my controller to change loading state. Is it possible?

I added this to my controller but doesn't work

var backingView: UIView {
    return contentView
}
@alinekborges
Copy link

image

Try this, it worked fine for me :)

@drpawelo
Copy link

@alinekborges Thanks so much!
here's your answer as text (and with some explanation):

  1. Your ViewController already most likely adopts StatefulViewController protocol. Make it also adopt BackingViewProvider protocol like this:
    open class GenericCollectionVC: UIViewController, StatefulViewController, BackingViewProvider {
  2. then in your code re-define what view should hold all the StatefulViews (emptyView, loadingView, errorView) by defining backingView variable
    public var backingView: UIView { return self.collectionView }
  3. Note that I set self.collectionView to be the parent view of my StatefulViews, but you can use any view there

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