This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import Combine | |
// original code for CancellerWrapper was posted on @Cockscomb cockscomb's blog post. https://cockscomb.hatenablog.com/entry/2021/09/26/103128 | |
class CancellerWrapper<Wrapped> { | |
var value: Wrapped | |
init(_ value: Wrapped) { self.value = value } | |
} | |
class SimpleModel: UIResponder, ObservableObject { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import UserNotifications | |
#if os(iOS) | |
class AppDelegate : UIResponder, UIApplicationDelegate { | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
registerForPushNotifications() | |
UNUserNotificationCenter.current().delegate = self | |
return true | |
} |
OlderNewer