Closed kanak14 closed 4 years ago
Dunno. It isn't crashing for anyone else. What is the error?
Try cleaning your derived data.
Hi,
I had the same problem. I solved it by forcing the execute of the configureDropShadow() method in the main thread.
From this:
func showSuccess(_ message: String?, title: String? = nil) {
let success = MessageView.viewFromNib(layout: .cardView)
success.configureTheme(.success)
success.configureDropShadow() // <- cause of the problem
success.configureContent(title: title ?? "", body: message ?? "")
success.button?.isHidden = true
var successConfig = SwiftMessages.defaultConfig
successConfig.presentationStyle = .bottom
DispatchQueue.main.async {
SwiftMessages.show(config: successConfig, view: success)
}
}
to:
func showSuccess(_ message: String?, title: String? = nil) {
DispatchQueue.main.async {
let success = MessageView.viewFromNib(layout: .cardView)
success.configureTheme(.success)
success.configureDropShadow()
success.configureContent(title: title ?? "", body: message ?? "")
success.button?.isHidden = true
var successConfig = SwiftMessages.defaultConfig
successConfig.presentationStyle = .bottom
SwiftMessages.show(config: successConfig, view: success)
}
}
@BrunoDonini how's you get off the main queue? You've got to call SwiftMessages on the main queue or use show(viewProvider:)
In my case, the showSuccess
method is called in an async completion block
@BrunoDonini OK I didn't read our post carefully. So you're correct – you shouldn't use UIKit APIs on a background queue, so wrapping the whole thing in DispatchQueue.main.async
makes sense.
Maybe the problem of Kanak is that the configureDropShadow
method did not crash in iOS 12 if called in a background thread, instead in iOS 13 it crash
Hi Dear,
SwiftMessage is working on iOS 12 and below , Simulator. After update my phone in 13.2 then app will be crashed, Please le me explain how to resolved this issue.
Find the snap-short.