Closed muzoman closed 6 years ago
Hi. There are only four ways a message view can get dismissed:
interactiveHide = true
enables the pan dismiss gesturedimMode = .gray(interactive: true)
(or a similar case) dismisses the message when you tap outside of the message.duration
to anything other than .automatic
or seconds(seconds:)
dismisses the message after a period of time.hide()
I suggest that you put a breakpoint in SwiftMessages.hideCurrent()
and look at the stack trace to figure out which of the above is happening.
The .tapHandler
property does nothing by default.
Ok, thanks Tim, my issue wasn't quite what I thought it was!
The message view was being removed by a navigation drawer component that hid the status bar area as a view controller was animated in from the left side of the screen. Strangely, even though the component restored the statusbar area afterwards the message view would never be displayable again.
For reference, if anyone else comes up against this problem it was in a UI library called Material by CosmicMind and the class was AppNavigationDrawerController - https://github.com/CosmicMind/Material
The component has a property called isHiddenStatusBarEnabled which if set to false stops the status bar being hidden and the problem is solved.
Good to hear you figured it out.
Works for me.
config.dimMode = .gray(interactive: false)
Hi there,
I've got a MessageView configured as a .statusLine and I want to stop user taps from hiding the message. I can't seem to do this.
I've tried setting the .tapHandler property to { view in } i.e. do nothing, but this doesn't work.
I've tried setting the configuration property .interactiveHide to false too and this also has no effect.
What am I doing wrong? I assume this is possible?
Thanks!