Hi,
Im attempting to hanlder all error conditions proposed by the NEHotspotManager API.
currently ive implemented as follows (for illustraion im only handling the user approval and associated below):
NEHotspotConfigurationManager.shared.apply(configuration) {
(error) in
if error == nil {
if self.currentSSIDs().first == self.m_ssid {
print("Success 2")
handler(true)
} else {
print("Fail 2")
print("\(self.currentSSIDs())")
handler(false)
}
} else {
if error?.localizedDescription == "already associated." {
print("Success 1")
handler(true)
}
else if error?.localizedDescription == "failed to get user\'s approval." {
// User refused to accept
}
else {
print("Fail 1")
handler(false)
}
}
}
is it possible to compare the error against the enum types as defined here:
https://developer.apple.com/documentation/networkextension/nehotspotconfigurationerror
rather than my current approach of getting the localizedDescription text.
Thank you in advance