I try to use SwiftMessages
into my Swift iOS project.
SwiftMessages
has been installed with pod
in version 6.0
When I use a sample code like this :
let error = MessageView.viewFromNib(layout: .cardView)
error.configureTheme(.error)
error.configureContent(title: "Error", body: "Something is horribly wrong!")
error.button?.setTitle("Stop", for: .normal)
SwiftMessages.show(view: error)
Until now, it's ok !
But when I try to use SwiftMessages.Config()
or SwiftMessages.defaultConfig
like this :
let warning = MessageView.viewFromNib(layout: .cardView)
warning.configureTheme(.warning)
warning.configureDropShadow()
let iconText = ["", "", "", ""].sm_random()!
warning.configureContent(title: "Warning", body: "Consider yourself warned.", iconText: iconText)
warning.button?.isHidden = true
var warningConfig = SwiftMessages.defaultConfig
warningConfig.presentationStyle = .top
//warningConfig.presentationContext = .window(windowLevel: UIWindow.Level.statusBar)
SwiftMessages.show(config: warningConfig, view: warning)
I obtain an Exec Bad Access on the SwiftMessages.show(config: warningConfig, view: warning)
More over, it does not recognize the property presentationContext
, that's why the line is in comment in my code. However this property is listed here : https://github.com/SwiftKickMobile/SwiftMessages
So, is there something wrong in my code, or is there a bug inside the framework ?