Set the windowViewController closure when you are using a UIWindowSceneDelegate based application.
for example:
var config = SwiftMessages.Config()
config.windowViewController = { windowLevel, config in
// Get my first and only window scense.
if let windowScense = UIApplication.shared.connectedScenes.first as? UIWindowScene {
return WindowViewController(windowLevel: windowLevel, config: config, windowScense: windowScense)
} else {
return WindowViewController(windowLevel: windowLevel, config: config)
}
}
Set the windowViewController closure when you are using a UIWindowSceneDelegate based application. for example: