The first day seemed to work well using different ways of using MapAnnotation structs, up until trying to use a NavigationLink within the MapAnnotation. For some reason I could not get the link to work to the view. This might have been an issue with the simulator.
Authentication on day 69 seems possible also, with a minor change being that
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
needed to be amended to .deviceOwnerAuthentication
or with wrist detection as below.
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithWristDetection, error: &error) {
context.evaluatePolicy(.deviceOwnerAuthenticationWithWristDetection, localizedReason: reason) { success, authenticationError in
Using means that the App is unlocked immediately, because the device is on the wrist and unlocked. The Apple Watch assumes that private information, such as health data, can be readily available until the watch is taken off the wrist and the device becomes locked again.
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason) { success, authenticationError in
Whereas .deviceOwnerAuthentication will prompt the user for the device passcode before proceeding with your code. So whilst this may seem like a nice way to provide extra protection, it can seem a little redundant. As with the device on the wrist and unlocked it would be very unusual for someone else to be trying to access the information.
I also noted that there is an additional authentication method listed in Xcode’s autocomplete. deviceOwnerAuthenticationWithBiometricsOrWatch. According to Apple Documentation, this policy allows the iPhone to authenticate the user using a paired Apple Watch. I will have to play with some test code and see how the UI looks for this option.
Leave a Reply