SwiftMessages
SwiftMessages copied to clipboard
Message not visible when navigating back to view controller
From @wousser:
Maybe I can provide some context as I'm experiencing the same issue. I'm presenting a .MessageView at the bottom of the current viewcontroller
config.presentationContext = .viewController(self)
and
config.duration = .forever
This works on first load, but after navigating to another viewController, and going back to this one, the message is not shown anymore, and is not shown when calling
SwiftMessages.show(config: config, view: view)
again.
@wousser You'd need to hide the previous message before showing it again due to the de-duplication behavior. But clearly, you want the original message to remain visible. I tried to reproduce your scenario using the demo app and couldn't. Could you describe your view controller hierarchy a bit more? And could you see if you can determine exactly what view the PassthroughView
the message view's container is being added to? And when you return, can you check if the PassthroughView
still exists in your view hierarchy? Should be a straightforward thing to check using Xcode's view hierarchy debugger.
Yes, hiding the message first and then showing it again works. For completion of this issue and to really show the message .forever ;)
PassthroughView is added to UILayoutContainerView and when showing for the second time PassthroughView doesn't exist. See before and after.
Should be the second UILayoutContainerView, not the selected one.