Closed devjmitchell closed 4 years ago
Works for us, thanks!
Messages were not displayed anymore for us on iOS 13 when using the new modal presentation style (that is enabled by default).
This seems to fix the issue. Thanks and hopefully it's merged soon!
Hi, somehow I overlooked this PR. Sorry.
Thanks for bringing this up. Your fix isn't quite correct – there is already logic for this in UIViewController+Utils.swift
that needed to be updated for the new modal presentation style. The fix looks like this:
private let fullScreenStyles: [UIModalPresentationStyle] = {
if #available(iOS 13.0, *) {
return [.fullScreen, .overFullScreen, .automatic]
} else {
return [.fullScreen, .overFullScreen]
}
}()
Please try it out on the head of master
and let me know if it works for you.
I may be doing something wrong, but it appears your fix doesn't solve the problem for me. Please see screenshots where I show the message (works fine), but when I'm using a modal, it doesn't present on top - it's still presenting from the nav bar of the VC behind the modal.
My fault, I was checking for automatic
style but it was actually defaulting to pageSheet
. I went in a bit of a different direction with the fix, though. Now messages are always displayed above presented view controllers regardless of modalPresentationStyle
. Please try out the latest on master
.
This fix works in my test project - thanks for the update!
Changes to modals in iOS 13 caused .automatic presentationContext to not display SwiftMessages on top of modals. This change will allow SwiftMessages to present on top of a modal, while still working correctly from a view controller's nav bar (using .automatic presentationContext).