here you go I sent it over from Mac to here simplified a little but the same thing
import SwiftUI
import WebKit
struct WkwebView: UIViewRepresentable {
let rc = UIRefreshControl()
let w = WKWebView(frame: .zero, configuration: WKWebViewConfiguration())
func refreshWebView(_ sender: UIRefreshControl) {
w.reload()
sender.endRefreshing()
}
func makeUIView(context: Context) -> WKWebView {
w.load(URLRequest(url: URL(string: "https://www.")!))
rc.addTarget(self, action: #selector(refreshWebView(_:)), for: UIControl.Event.valueChanged)
w.scrollView.addSubview(rc)
w.scrollView.bounces = true
}
func updateUIView(_ uiView: WKWebView, context: UIViewRepresentableContext<WkwebView>) {
}
}
Post
Replies
Boosts
Views
Activity
Restarting Xcode fixed this problem for me thanks all
I get this error with the SwiftUI though No exact matches in call to instance method 'asyncAfter'
I git the same issue today any luck on fixing this :(
I'm using my actual iPhone for testing
Yes that would be correct but not sure why it doesn't wanna work though but it is enabled on the page
Like here also an example of how it pulls the colour into the UI
It's not really a problem based but more of like an interest in getting something to work in a project like for example for a project I was thinking about doing is like having the album artwork reflect the same colour onto the background I was just thinking about how it would work I have saw it with a lot of different Apple apps so that's why I was thinking about working on something similar to it. Like iTunes 11 had the artwork would also show a similar to the background. It's basically like extending the user experience to making the colours blend more so the content matches the user experience.
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.
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
Anyway I could make Mac OS detect that it's only an iOS Compatible Control?
Sorta fixes it but not really but a more modern code example of the same issue
let m = Bundle.main.path(forResource: "index", ofType: "html")
webView.load(URLRequest(url: URL(fileURLWithPath: m!)))
Okay so I fixed it so you have to in App Store Connect add the Mac OS in the with iOS for anyone who has this issue is basically just Apple Blocks the upload without it added in the App Store Connect
What happens when this shows for Mac OS apps on Xcode 12.3?