zashi-ios-wallet-private/secant/SecantApp.swift

47 lines
1.2 KiB
Swift
Raw Normal View History

2021-07-29 15:38:35 -07:00
//
// secantApp.swift
// secant
//
// Created by Francisco Gindre on 7/29/21.
//
import SwiftUI
import ComposableArchitecture
import ZcashLightClientKit
final class AppDelegate: NSObject, UIApplicationDelegate {
var appStore: AppStore = .placeholder
lazy var appViewStore = ViewStore(
appStore.stateless,
removeDuplicates: ==
)
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
// set the default behavior for the NSDecimalNumber
NSDecimalNumber.defaultBehavior = Zatoshi.decimalHandler
appViewStore.send(.appDelegate(.didFinishLaunching))
return true
}
func application(
_ application: UIApplication,
shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplication.ExtensionPointIdentifier
) -> Bool {
return extensionPointIdentifier != UIApplication.ExtensionPointIdentifier.keyboard
}
}
2021-07-29 15:38:35 -07:00
@main
struct SecantApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
2021-12-13 17:23:50 -08:00
2021-07-29 15:38:35 -07:00
var body: some Scene {
WindowGroup {
AppView(store: appDelegate.appStore)
2021-07-29 15:38:35 -07:00
}
}
}