Post

Replies

Boosts

Views

Activity

UIRefresh not working for my project?
So for my project it's a SwiftUI Project however if I Add '@objc' to expose this instance method to Objective-C it doesn't want it for some reason and the other error code is Argument of '#selector' refers to instance method 'refreshWebView' that is not exposed to Objective-C mainly this is the error I need to fix thanks in advance this code is what's giving me the error refreshControl.addTarget(self, action: #selector(refreshWebView(_:)), for: UIControl.Event.valueChanged) this is for a pull to refresh the page
3
0
433
Jul ’24
Anyway I could somehow accelerate WebKit to load something?
Currently my project I have works fine with if I load something small but if I load something big using WebKit it is very slow. I would like to have it work regardless of the load that is thrown at it as it would be the best user experience. Currently with testing seems like it is handling the rendering over a period of time vs all at once. Anyway I could have it load all at once vs like small little bits at a time. Like even increasing the disk and the memory temporarily while it loads. I wouldn't really typically expect an issue like this as I feel like iOS and devices should be very good processors in them to really handle anything a lot.
0
0
519
Oct ’21
MusicKit
I don't know why but when I go into MusicKit part on developer part on my app on Apple's website there is no spot to configure it. I saw online a lot of articles saying that you have to configure it to use MusicKit with an app. Is this a bug or something or do I need to do something to enable it? I just don't understand I added it into my app but I can't seem to get this to work for some reason I'm not sure why.
5
0
1.2k
Sep ’21
Image Colour Reflect UI Background Colour?
Anyone know how Apple manages to make the UI colour the same as the Image or another object colour? Like overall I think this is a really cool fun effect I'd love to play with this effect some somehow Heres an example with how the New Safari does it with the page colour but I see it with other Apple apps like the music Player app for example.
4
0
784
Sep ’21
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 { }     } }
4
0
1.2k
Sep ’21
How do I get Java working for a local Web page files WKWebKit
This does not want to work at all with the new WK Web Kit but Will only work with the old UIWebKit I have tried a lot of new code but still doesn't wanna work at all. do {                     w.loadHTMLString(try NSString(contentsOfFile: Bundle.main.path(forResource: "index", ofType: "html")!, encoding: String.Encoding.utf8.rawValue) as String, baseURL: URL(fileURLWithPath: Bundle.main.bundlePath, isDirectory: true))                 } catch {                     // catch error                 }
1
0
947
Dec ’20