SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.31k stars 743 forks source link

Xcode 11 GM 1 + 2 – No messages on iPhone or Simulator #341

Closed blg-nb closed 4 years ago

blg-nb commented 4 years ago

Hallo,

i have a problem with SwiftMessages in v 7.0.0 and the Xcode GM 1 + 2. I build on an iPhone X with 13.1 and Simulator iPhone 11 Pro with 13.0.

No matter what I do, no message will be displayed on Device or Simulator.

I have build an extension:

` public extension SwiftMessages {

static func show(message: String, for theme: Theme) {

    let view = MessageView.viewFromNib(layout: .cardView)

    view.configureTheme(theme)
    view.configureContent(title: "dfasf", body: message)
    view.button?.isHidden = true

    DispatchQueue.main.async {
        show(config: config(), view: view)
    }
}

private static func config() -> SwiftMessages.Config {

    var config = SwiftMessages.defaultConfig

    config.presentationStyle = .bottom
    config.duration = .forever

    return config
}

} `

I also tried the following to setup the config:

if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene, let window = scene.windows.first, let rootViewController = window.rootViewController { config.presentationContext = .viewController(rootViewController) }

Where is my mistake?

wtmoose commented 4 years ago

Is the demo app working for you?

wtmoose commented 4 years ago

Never mind. I need to make a small change to support scenes.

wtmoose commented 4 years ago

You can try the swift5.2 branch. I'll release it officially soon.

blg-nb commented 4 years ago

nice, thank you

wtmoose commented 4 years ago

Fixed in 7.0.1.