Post

Replies

Boosts

Views

Activity

Reply to Background location tracking challenge
While it did mention in the text of the video that you have to have the background activity session enabled before you start the updates it was bit out of context in terms of a working example per the sample code. Enabling the background activity this way did the trick. self.updatesStarted = true // TODO: Looks like you have to add this here. backgroundActivity = true let updates = CLLocationUpdate.liveUpdates()
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to FaceID changes in iOS 18
Here is a simple example: struct ContentView: View { @State private var isUnlocked = false var body: some View { VStack { if isUnlocked { Text("Unlocked") } else { Text("Locked") } } .padding() .onAppear(perform: authenticate) } } import LocalAuthentication func authenticate() { let context = LAContext() var error: NSError? // check whether biometric authentication is possible if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) { // it's possible, so go ahead and use it let reason = "We need to unlock your data." context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason) { success, authenticationError in // authentication has now completed if success { // authenticated successfully } else { // there was a problem if let error = authenticationError as? NSError { print("Authentication failed: \(error), \(error.userInfo)") } else { print("Authentication failed: \(String(describing: authenticationError))") } } } } else { // no biometrics } } Here is the error it spits back: Authentication failed: Error Domain=com.apple.LocalAuthentication Code=-1000 "UI service connection invalidated." UserInfo={NSDebugDescription=UI service connection invalidated., NSLocalizedDescription=Authentication failure.}, ["NSDebugDescription": UI service connection invalidated., "NSLocalizedDescription": Authentication failure.] I get this error pop up from Xcode: "CoreAuthUI quit unexpectedly." This may help from the Problem Report: ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Incident Identifier: 44ECD006-5C1C-4E2B-A580-003F46E298E5 CrashReporter Key: 74F42D79-158E-2606-618B-4DC2CCB64CD7 Hardware Model: Mac15,9 Process: CoreAuthUI [13984] Path: /Volumes/VOLUME/*/CoreAuthUI.app/CoreAuthUI Identifier: com.apple.CoreAuthUI Version: 1.0 (1656.40.15) Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd_sim [13492] Coalition: com.apple.CoreSimulator.SimDevice.BCC8C055-BE32-4735-BA12-890CFD1512FC [3618] Responsible Process: SimulatorTrampoline [1694] Date/Time: 2024-09-02 21:20:46.9564 -0700 Launch Time: 2024-09-02 21:20:46.4760 -0700 OS Version: macOS 14.6.1 (23G93) Release Type: User Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: CoreAuthUI [13984] I have the plist entry: Privacy - Face ID Usage Description = "Allow the app to use FaceID"
Topic: Privacy & Security SubTopic: General Tags:
Sep ’24
Reply to FaceID changes in iOS 18
I updated to latest beta on the device and now works on device so it's just the simulator that looks like its having trouble. Thanks for your help. Hopefully, can sort out what's going on in the simulator. I'm using an iphone11 Pro
Topic: Privacy & Security SubTopic: General Tags:
Sep ’24
Reply to Renaming SwiftData model causing an error
That suggestion was a dud. I used the following code to delete the store which it did delete but the problem persists: if let storeURL = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first?.appendingPathComponent("default.store") { do { try FileManager.default.removeItem(at: storeURL) print("default.store deleted successfully.") } catch { print("Error deleting default.store: \(error)") } } I still get this error: error: the replacement path doesn't exist: "/var/folders/fk/m2x_2qzj44508m9zzcll2j_w0000gn/T/swift-generated-sources/@__swiftmacro_11OpExShellV112FilteredListV11helpSection33_232B54C76A2ED061EC4416CE3B2A99A1LL5QueryfMa_.swift" It's got to be hanging on to the tracking or reference somewhere else.
Sep ’24