I'm using this code to open dialog from xib file using segue:
let vc = Wallet(nibName: "Wallet", bundle: nil)
vc.view.heightAnchor.constraint(equalToConstant: self.view.frame.height / 2.5).isActive = true
let segue = SwiftMessagesSegue(identifier: nil, source: self, destination: vc)
segue.configure(layout: .bottomMessage)
segue.interactiveHide = false // i assume that this code can prevent the click outside
segue.perform()
but i still can dismiss the dialog when user click outside the view. so how to prevent user to click outside view to dismiss the dialog?
swift
/// Specifies whether or not the interactive pan-to-hide gesture is enabled
/// on the message view. The default value is `true`, but may not be appropriate
/// for view controllers that use swipe or pan gestures.
public var interactiveHide: Bool {
get { return messenger.defaultConfig.interactiveHide }
set { messenger.defaultConfig.interactiveHide = newValue }
}
Use
swift
segue.dimMode = .gray(interactive: false)
Most helpful comment
swift /// Specifies whether or not the interactive pan-to-hide gesture is enabled /// on the message view. The default value is `true`, but may not be appropriate /// for view controllers that use swipe or pan gestures. public var interactiveHide: Bool { get { return messenger.defaultConfig.interactiveHide } set { messenger.defaultConfig.interactiveHide = newValue } }Use
swift segue.dimMode = .gray(interactive: false)