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

Unwind from a presented view controller results in a blank 'black screen' #9

Open
senabhishek opened this issue Nov 2, 2016 · 1 comment

Comments

@senabhishek
Copy link

This is the code in my AppDelegate:

    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let middle = storyboard.instantiateViewController(withIdentifier: "DashboardStoryboardVC")
    let top = storyboard.instantiateViewController(withIdentifier: "CashoutStoryboardVC")
    let bottom = storyboard.instantiateViewController(withIdentifier: "AnalyticsStoryboardVC")
    let snapContainer = SnapContainerViewController.containerViewWith(nil,
                                                                      middleVC: middle,
                                                                      rightVC: nil,
                                                                      topVC: top,
                                                                      bottomVC: bottom)
    self.window?.rootViewController = snapContainer
    self.window?.makeKeyAndVisible()

I have modified your SnapContainerViewController to make the left and right as optional and top and bottom as mandatory view controllers. Now when I present a view controller via a segue from the middle view controller, after dismissing it through either an unwind segue or even a dismiss(), I get back a black blank screen.

I checked the rootViewController and see that it is still set to the snapContainer viewController as shown in the code above. Can you tell me what I'm doing wrong?

@jakespracher
Copy link
Owner

Ah, so it sounds like you want to present some other viewcontroller that is not part of the top/down/left/right scheme. Yeah its a pain, if you look at how the snapchat behaves, you'll notice that when they do this (e.g. in settings) the transitions don't exhibit UINavigationController behavior. They have their own custom navigation transitions going on. For the app I used this in I ended up doing that stuff custom. As a simple example, you could have the view you want to switch to offscreen and slide it on screen on a button press. You could also follow this

https://www.objc.io/issues/12-animations/custom-container-view-controller-transitions/

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

2 participants