This is a SwiftUI view based on The The Composable Architecture.
- AsyncLaunchingView
- AppLife Cycle - Become Active
import LaunchingView
@main
struct YourApp: App {
var body: some Scene {
WindowGroup {
LaunchingView<ContentView, LaunchScreenView>(
contentView: {
ContentView()
},
launchScreen: {
LaunchScreenView()
})
}
}
}
import LaunchingView
@main
struct YourApp: App {
@State
var isFinished = false
var body: some Scene {
WindowGroup {
LaunchingView<ContentView, VStack>(
contentView: {
ContentView()
},
launchScreen: {
VStack {
Image("ImageName")
Button {
isFinished = true
} label: {
Text("Task Finish!!").foregroundColor(Color.red)
}
}
},
isFinished: $isFinished
)
}
}
}
import LaunchingView
@main
struct YourApp: App {
var body: some Scene {
WindowGroup {
AsyncLaunchingView<ContentView> {
ContentView()
}
}
}
}
LaunchingService calls api using FirebaseRemoteConfig.
import Dependencies
import LaunchingService
extension RemoteConfigRegisterdKeys: DependencyKey {
public static var liveValue = RemoteConfigRegisterdKeys(#...#)
}
import Dependencies
import LaunchingView
extension LaunchingAlertDefaultText: DependencyKey {
public static var liveValue = LaunchingAlertDefaultText(#...#)
}
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler.
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/swift-man/LaunchingView.git", .from: "0.8.2")
]