title: How to use Toast-Swift in SwiftUI?
body: <p>I'd like to use this project <a href="https://github.com/scalessec/Toast-Swift" rel="nofollow noreferrer">Toast-Swift</a> through CocoaPods in a SwiftUI view. It's for UIView, so I tried to write a ViewController and wrap it into SwiftUI but the result is nothing on the screen.</p>
  
  <p>My code:</p>
  
  <pre><code>struct ToastView: UIViewControllerRepresentable{
  
      @State var text: String
  
      func makeUIViewController(context: UIViewControllerRepresentableContext&lt;ToastView&gt;) -&gt; UIToast {
          return UIToast(text: text)
      }
  
      func updateUIViewController(_ uiViewController: UIToast, context: UIViewControllerRepresentableContext&lt;ToastView&gt;) {
  
      }
  }
  
  class UIToast: UIViewController{
  
      var text: String = ""
  
      init(text: String) {
          super.init(nibName: nil, bundle: nil)
          self.text = text
      }
  
      required init?(coder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          self.view.makeToast(text)
      }
  }
  </code></pre>
  
  <p>I've found some custom implementations on SO of a Toast for SwiftUI (<a href="https://stackoverflow.com/questions/56550135/swiftui-global-overlay-that-can-be-triggered-from-any-view">SO question</a>) but their behaviour is not exactly what I was looking for.</p>
  
  <p>Can someone please help me to fix this? Is there another recommendation for Toast in SwiftUI? Thanks in advance!</p>