I am trying to use material snackbar. Everything works fine if snackbar toast message is shown directly on a view controller. However when a child pop up view is appended to the view (view.addSubView), and the toast is triggered from the child popup view controller, the toast message is hidden ie., shown behind the popup view (Toast can be seen after dismissing the child popup view)
Has anyone come across this issue? How do I make sure material snackbar toast is always visible no matter where it is triggered from?
I figured it out. The magic was with the usage of
MDCSnackbarManager.setPresentationHostView
. I specifically set window as presentationHostView.As per documentation, if the library fails to figure out the presentationHostView as intended, we can specifically set it.