Ramotion / garland-view

:octocat: ≡ GarlandView seamlessly transitions between multiple lists of content. Swift UI library made by @Ramotion

Home Page:https://www.ramotion.com/agency/app-development/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug on UserCardDismissAnimationController

adelbios opened this issue · comments

when I use navagationController present UserCardViewController ok that's right ?
so when go back ( dismiss) to ViewController I got black screen after animation completed

ScreenRecording_07-03-2018 14-06-06.MP4.zip

I fixit.... the solution .....
1- go to UserCardDismissAnimationController

replace this line
let toVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)! as? GarlandViewController

INTO
let toVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to)!

2- add property to UserCardDismissAnimationController
var rootViewController : GarlandViewController?

3- replace

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { self.selectedCardIndex = indexPath let cardController = UserCardViewController.init(nibName: "UserCardViewController", bundle: nil) present(cardController, animated: true, completion: nil) }

** INTO**

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { self.selectedCardIndex = indexPath let cardController = UserCardViewController.init(nibName: "UserCardViewController", bundle: nil) cardController.userCardDismissAnimationController.rootViewController = self present(cardController, animated: true, completion: nil) }

@adelbios Hello!) please take a look at the commit (1d2edfb), I've added fallback alpha animation it will help you with black screen. And of course you can also use your solution.
I think it does not make much sense to change the original transition in the example