Parse-SDK-iOS-OSX
Parse-SDK-iOS-OSX copied to clipboard
Important changes for ReadMe and Docs in upcoming SwiftUI changes.
For the upcoming Swift 5.3/XCode 12. SwiftUI applications by default will no longer have an app delegate. Instead, this is what is created by default.
@main
struct Xcode12TestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Since Apple is now pushing to use purely SwiftUI and move away from UIKit including storyboard and controllers. I feel we need to do some testing on how to initialize Parse, ParseFacebookUtils, and ParseTwitterUtils to work with SwiftUI. We then need to update our docs and ReadME, the later of which is way overdue for an update anyway..
In my tinkering, the following works just fine for initializing Parse in a pure-SwiftUI app:
import Parse
import SwiftUI
@main
class Xcode12TestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
required init() {
let config = ParseClientConfiguration { … }
Parse.initialize(with: config)
}
}
Thanks @jbhannah for doing that! That is seriously helpful.
I think the most important thing is that we test facebook initialization and how it works within facebook utils. I'm betting we need to add documentation explaining that using a @main class will not work and an @UIApplicationMain app delegate will be required in order to initialize facebook and handle URI callbacks properly when being routed back to the application after logging in.