How to display sheet after hiding
Hi there,
I'm displaying a SheetViewController using inline method, and after calling sheetController?.animateOut() the method sheetController?.animateIn() does nothing.
I could only redisplay the SheetViewController after calling all this code again:
sheetController.willMove(toParent: self)
self.addChild(sheetController)
view.addSubview(sheetController.view)
sheetController.didMove(toParent: self)
sheetController.view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
sheetController.view.topAnchor.constraint(equalTo: view.topAnchor),
sheetController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
sheetController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
sheetController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
// animate in
sheetController.animateIn()
Am I using this library the wrong way? Or is it how it's supposed to be? Thanks!
Facing the same issue.
This should be fixed in 2.3.0
@gordontucker This is still happens...
I added another update that might help you out. The call to animate in should change from this:
self.addChild(sheetController)
view.addSubview(sheetController.view)
sheetController.didMove(toParent: self)
sheetController.view.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
sheetController.view.topAnchor.constraint(equalTo: view.topAnchor),
sheetController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
sheetController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
sheetController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
// animate in
sheetController.animateIn()
to this:
sheetController.animateIn(to: view, in: self)
Once you switch to use that and have 2.3.2, it should fix the problem you are having. Thanks for being patient and not being complaining about a free tool not being good enough. I appreciate your patiences everyone.