Closed annathomasQB closed 3 years ago
Code?
DispatchQueue.main.asyncAfter(deadline: .now() + 0.75) {
let alertView = MyClassAlertView(alertType: "name of popup", displaytext: "firstText", displayTextTwo: "secondText")
alertView.delegate = self
SwiftMessages.show(config: alertView.alertConfig, view: alertView)
}
Have altered names and text and parameters passed (all are strings, which are used to display the text inside the popup)
You haven't shown what alertView.alertConfig
, but my suggestion is to change presentationContext = .window(.normal)
on the config to show your alert in a separate window above the app's window.
oh Sorry :)
alertConfig is a var inside the custom alertView class
var alertConfig = SwiftMessages.Config()
Its properties are set as follows :
private func setAlertConfig() {
alertConfig.presentationStyle = .center
alertConfig.duration = .forever
alertConfig.interactiveHide = false
alertConfig.shouldAutorotate = false
alertConfig.dimMode = .color(color: UIColor.black.withAlphaComponent(0.71), interactive: false)
}
I'll add this config property as well and try. But since this was a rare occurrence it was hard for the beta tester to reproduce. I'll but anyways update the new build with this change and check if it's occurring again or not. Please give me sometime to update back here :) Thanks for your input @wtmoose :)
Please reopen if you have further issues.
Hi,
Saw this very strange behaviour (very rare - I couldn't reproduce it but a beta tester shared the screenshot so I have no other choice but to believe it)
The Custom Swift Message that I'd created using a custom xib file, was getting shown inside a scroll view of the view controller, (at least that's what I could understand from the screenshot shared). Device : iPhone 8 OS : iOS 14
I couldn't replicate the same in iPhone 8 simulator (iOS 13.4.1 though, since my XCode isn't updated)
For the record, the view controller has some three to 4 layers of nested view inside it, but I still can't understand why its detecting the scroll view as the most parent view.
(I'm colouring out the design since the app is still not out)
In the first screenshot, you can see the top part (which is supposed to be static), and part of the swift message popped up below that, inside the scroll view (see the darkened background on the left)
This is how it's supposed to come
What I could understand is, the top orange part has the subview scrollview inside that, and somehow swiftmessages must have calculated the scrollview to be the most top parent view.
Version of Swift Messages used : SwiftMessages (8.0.0)