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

detail card has zero size #20

Open
di18s opened this issue Apr 4, 2021 · 1 comment
Open

detail card has zero size #20

di18s opened this issue Apr 4, 2021 · 1 comment

Comments

@di18s
Copy link

di18s commented Apr 4, 2021

if you present some viewcontroller from a detailed card and return, then the detailed card has a zero size and that's all because cardDetailView.translatesAutoresizingMaskIntoConstraints = false, need cardDetailView.translatesAutoresizingMaskIntoConstraints = true into func completeEverything()
`

         func completeEverything() {
		animatedContainerView.removeConstraints(animatedContainerView.constraints)
		animatedContainerView.removeFromSuperview()
		
		container.addSubview(cardDetailView)
		
		cardDetailView.removeConstraints([topTemporaryFix, cardWidthConstraint, cardHeightConstraint])
		
		cardDetailView.edges(to: container)
		cardDetailView.translatesAutoresizingMaskIntoConstraints = true
		
		screens.cardDetail.scrollView.isScrollEnabled = true
		
		let success = !ctx.transitionWasCancelled
		ctx.completeTransition(success)
		
		screens.cardDetail.didFinishPresentAnimationProgress()
	}

`

@tysonkerridge
Copy link

As an example to show this issue, at the bottom of showType2(...) of the example project, I added the following:

DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
    let vc = UIViewController()
    vc.view.backgroundColor = .red
    vc.modalPresentationStyle = .fullScreen
    viewController.present(vc, animated: true, completion: nil)
    
    DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
        viewController.dismiss(animated: true, completion: nil)
    }
}

Which does this:

Screen.Recording.2021-04-20.at.5.05.56.pm.mov

Unfortunately, applying the cardDetailView.translatesAutoresizingMaskIntoConstraints = false fix in completeEverything() causes this though:

Screen.Recording.2021-04-20.at.5.06.29.pm.mov

Any other ideas @di18s?

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