Post

Replies

Boosts

Views

Activity

how to open safari in my swift program
I'm developing a cocoa app runs on macOS(not iOS). And I want to open an Advertisement Web Page while users click the 'Show Advertisement' button. My Question is: how to open a url in the system's default browser(like safari) through swift code in my app. And there must be a way to call local browser through swift code, because the in app 'WeChat', when we click a link in that app, the system will open a safari browser and show the content of the link. My question is: how? Thanks for your help, Best Regards. Yours, Alex.Zhang
4
0
4.2k
Dec ’20
Can WKWebView load local HTML5 for writing?
I'm trying to do something like hybird with WKWebView. I finished the HTML5 pages, and let it displayed in WKWebView in a macOs App. All things go well, but I can't input any character into the <input> field in the macOs WKWebView. My question is: Is there any way to let the <input> field can be input text in macOs WKWebView? FYI, follow code can enable input for the <input> field: wkWebView.load(URLRequest.init(url: URL.init(string: "http://localhost:4200")!)) FYI, follow code can't input any thing for the <input> field: wkWebView.loadFileURL(indexUrl, allowingReadAccessTo: readAccessUrl) How can I let the <input> field be enabled to input, with the loadFileURL method?
1
0
453
Nov ’20