title: SwiftUI, iOS: How to access public function inside @main struct from custom internal View?
body: <p>How to access achieveTo() inside @main struct from CustomInternalView()?</p>
  <pre><code>@main
  struct MyApp: App {
      
      var body: some Scene {
          WindowGroup {
              CustomInternalView()
          }
      }
  
      public func achieveTo() {
          // Do stuff
      }
  }
  
  
  struct CustomInternalView: View {
      var body: some View {
           Text(&quot;Some&quot;)
      }
      .onDisappear {
          // How to call &quot;achieveTo&quot; from here????????????
      }
  }
  </code></pre>
  <p>In UIKit it is like <code>UIApplication.shared.windows.first!.rootViewController as! YourViewController</code>, How about SwiftUI?</p>