Is it possible to make this SwiftUI Code work on iOS?

Originally this was for a macOS app but I was wondering if it would be possible to make it work on iOS? I wanna make the app work for not only macOS but also work for iOS as for the future Apple plans to make iOS and macOS more together.

var body: some Scene {

        WindowGroup {

            ContentView(bm_observer: bm_observer, hs_observer: hs_observer).edgesIgnoringSafeArea(.top).frame(minWidth: 800, maxWidth: .infinity, minHeight: 120, maxHeight: .infinity).onAppear {

                UIApplication.shared.windows.forEach({ $0.tabbingMode = .disallowed })

                if let mainMenu = NSApp .mainMenu {

                        DispatchQueue.main.async {

                            if let edit = mainMenu.items.first(where: { $0.title == "Format"}) {

                                mainMenu.removeItem(edit);

                            }

                        }

                    }

            }

        }.windowStyle(HiddenTitleBarWindowStyle()).commands() {

            CommandMenu("History") {

                ForEach(hs_observer.history) { history in

                

                    Button(history.name) {

                        hs_observer.selected_history = history.url

                            let nc = NotificationCenter.default

                            nc.post(name: Notification.Name("selected_history"), object: nil)

                         }

                }                     }

ContentView.swift

struct Webview : UIViewRepresentable {

    @Binding var dynamicHeight: CGFloat

    @Binding var offset: CGPoint

    @Binding var selecting_tab: Bool

    var webview: WKWebView = WKWebView()

    var oldContentOffset = CGPoint.zero

    var originalcenter = CGPoint.zero

    class Coordinator: NSObject, WKNavigationDelegate {

        var parent: Webview

        

        init(_ parent: Webview) {

            self.parent = parent

        }

        func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {

            decisionHandler(WKNavigationActionPolicy(rawValue: WKNavigationActionPolicy.allow.rawValue + 2)!)

        }

        

    }

DispatchQueue.main.async { //omg

                        let window = UIApplication.shared.windows.first!

                        window.makeFirstResponder(nil)

                        

                    }

extension UITextView { // << workaround !!!

    open override var focusRingType: NSFocusRingType {

        get { .none }

        set { }

    }

}                  

Your question is not clear. It is hidden in code and you do not explicit what the problem is…

I understand you want to adapt the extension to iOS ?

There is no focusRing for iOS, so the best would be to test if it is iOS or macOS each time you use focusRingType. And skip the instruction if it is iOS.

Or you could do it in the extension:

extension UITextView {
    #if targetEnvironment(macCatalyst)
    @objc(_focusRingType)
    var focusRingType: UInt {
        return 1 //NSFocusRingTypeNone
    }
    #endif
}

Credit: https://stackoverflow.com/questions/57577345/blue-highlighting-focus-ring-on-catalyst-app

Well it is for a web browser idk if I could make certain features work on Mac and like have them different for iOS would that be possible so it can work? current errors I get is : Value of type 'UIWindow' has no member 'tabbingMode'

Cannot infer contextual base in reference to member 'disallowed'

Cannot find 'NSApp' in scope

'windowStyle' is unavailable in iOS. with a 'windowStyle' has been explicitly marked unavailable here under it

'HiddenTitleBarWindowStyle' is unavailable in iOS with a 'HiddenTitleBarWindowStyle' has been explicitly marked unavailable here

You are doing as if iOS and macOS were "similar". They are not. The closest to get this is to use MacCatalyst. Did you investigate that ?

I am by no means saying they are the same or similar at all as they are both very different but I just would like an experience that allows the app to work sorta similar between the devices although I completely understand sometimes code has to be modified between to make it work so I'm not looking for the same at all really just for something that works for the project and yes I am aware of MacCatalyst but I am aware that it's not always the most easy thing to make happen with certain things based on research. Overall I just wanna kinda future proof the project as for moving forward for Apple requirements making the apps support more platforms is the future with how they are going or as it seems to be anyway.

Is it possible to make this SwiftUI Code work on iOS?
 
 
Q