I’m having trouble getting a javascript file to run from inside a UIViewRepresentable WKWebView. This is probably a simple question with a simple answer, but I cannot seem to figure this out. I’m new to Swift and iOS programming. I’d like to link to a javascript file from inside a String of HTML that is passed to a UIViewRepresentable of
Tag: swift
Alamofire upload JSON response not compiling
I’m doing an Alamofire upload to the server and want to decode some JSON that’s sent back in response. On the line where I’m guarding that data.result.value has a value (the JSON response sent from the server), I’m getting a ‘Type of expression is ambiguous without more context’. The code to send the JSON object from the server looks like
Batch write with Firebase Cloud Functions
I’m using Firebase as backend to my iOS app and can’t figure out how to construct a batch write through their Cloud Functions. I have two collections in my Firestore, drinks and customers. Each new drink and each new customer is assigned a userId property that corresponds to the uid of the currently logged in user. This userId is used
How I can return result of js or any function to the screen of iPhone? by ContentView
(Sorry, I’m beginner and come to swift even not from js, but from python! So it’s incredibly new for me. But js more understandable for me from python.) enter image description here Answer Here’s the simplest version. In this version, it basically uses your original pattern where doJS returns a value. The disadvantage to this version is that doJS will
is it possible to run swift on a webpage like js or swift to interact with JS
I’m not sure how viable this is (from a web performant POV) but I was wondering if Swift code can be run inside of a website? For example adding to your HTML mark up like a script tag for JS? Use case: IOS has a low powermode that prevents some website features (such as autoplay video) – while you can
Reload saved data in editor.js using Vapor 3 backend and Leaf page
I am using a editor.js in a leaf page to allow my users to create a text document. When the user hits save editor.js ouputs what they have created as JSON and I save this to the database with the Vapor back end. This all works fine. I now want the user to be able to go back into the
Why does the decoder not sort by IDs
I’m attempting to have the app get the js file and load the list in order of ID’s first. Videolist+ViewModel.swift VideoDetails+VideoModel.swift VideoUseCase.swift Response.swift what I do not understand is why it randomizes the ID’s it continues to generate random sets of videos in different orders. I’ve attempted everything from videos.sorted to recoding from scratch. AdvertisementAnswer […]
WebKit userContentController:didReceiveScriptMessage: not getting called for iOS 13
I am using WKWebView for showing web content into my app but I am not able to get a message sent from JS webkit on iOS 13 devices. On previous iOS versions, it’s working as expected. Setup: WKScriptMessageHandler Delegate: From JavaScript I am calling it like this : Please let me know if anyone has come across this issue and
WebViewJavascriptBridge on iOS
So I’m creating an app in which there’s a UIWebView which shows a list of locations. My goal is to make it possible that once the user clicks one of the locations, my app can get the lat and longitude of the spot and therefore launch an integrated Navigation SDK. My point is how do I get and pass the