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

overFullScreen Glitch? #289

Closed
keithmthunzi opened this issue Oct 5, 2017 · 3 comments
Closed

overFullScreen Glitch? #289

keithmthunzi opened this issue Oct 5, 2017 · 3 comments

Comments

@keithmthunzi
Copy link

Hi, thanks for the library it's really helping me create my animations, i cant imagine how long it would have taken to write everything myself.

I've ran into an issue though when using overFullScreen to present a view controller modally.

My setup is that I have a tableview in viewController A

screen shot 2017-10-05 at 17 25 56

that when a user presses I want to show viewController B (a detailed view of the pressed cell) on top of viewController A.

This all works (animation/transparency etc) my problem is that the original fromViews in viewController A that were animated from are still visible (in their new position after animation) . i.e. if I scroll up/down in viewController B I can see the images (snapshots I believe?) of the fromViews in the place they animated to.

screen shot 2017-10-05 at 17 26 25

In the image above I've pulled the scroll view in viewController B down and you can see the image from viewController A that was animated from.

Is there any way for me to remove these and have hero recreate them when returning to viewController A (if they are needed?)

Because I thought that the underlying views were snapshots I tried setting the modifier .useNoSnapshot on the views that were animating but ended up with a complete mess

screen shot 2017-10-05 at 17 45 51

Note: (In case you're wondering the text in the images is not german or any language, it's just placeholder text)

@lkzhao
Copy link
Collaborator

lkzhao commented Nov 5, 2017

Right, for you first approach, i purposely did not remove the snapshots from the original view controller because it would make animated views disappears. Your use case is something I haven't thought about. A hacky way to achieve what you want might be calling Hero.shared.context.removeSnapshots(rootView: ) with your first view controller's image view at the end of the transition.

Your second approach didn't work because any layout code in your first view controller will end up controlling the view which will mess it up.

@ThoseGuysInTown
Copy link

Hero.shared.context.removeSnapshots(rootView: ) (and other functions like it) was moved to internal but here's another hacky way:

// 
let viewControllerA = UIViewController()
viewControllerB.present(vc, animated: true) {
	Hero.shared.context.container.isHidden = true
}

Hero.shared.context.container is the view containing all the snapshots so feel free to remove the view in any way you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@lkzhao @ThoseGuysInTown @keithmthunzi and others