I’m also to know if a SwiftUI tutorial has been completed utilising Backendless. I’m currently re-skilling and trying to identify if its worth pursuing or not.
Could you please clarify, what problems do you experience with Backendless using SwiftUI?
Backendless initialisation can still be called from the AppDelegate class:
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
initBackendless()
return true
}
private func initBackendless() {
Backendless.shared.hostUrl = "https://api.backendless.com"
Backendless.shared.initApp(applicationId: "YOUR APP ID", apiKey: "YOUR IOS API KEY")
}
...
...
}
and Swift code for calling Backendless methods is the same, e.g:
func testMethod() {
Backendless.shared.data.ofTable("Person").findFirst(responseHandler: { person in
print("First Person: \(person)")
}, errorHandler: { fault in
print("Error: \(fault.message ?? "")")
})
}
Thank you for your quick response. I’m just investigating if it works and if it behaves any differently. I found an example of the connection through the App Delegate (as you said) and it had some issues from a previous example. I also noticed that the POD has two references when you import i.e.
import Backendless
vs
import Backendless-Swift
But I’ll review your example with detail today. Thank you.
Thank you again. Yeah I ended up having to destroy the a current working of the project as I had no idea what XCode did. I decided to use the SDK directly from GitHub which seems to be working and not throwing errors about not finding Backendless. Furthermore I can see the BackendlessSwift one as you suggested is in the framework. Happy Days.
Has backendless done any videos on SwiftUI/5 and Backendless? I see allot of videos for others but only a couple for older versions of Swift/
Glad it is working for you now
Unfortunately we don’t have video tutorials for iOS development, but we will try to help you if you suddenly have any questions or need some help with Backendless.