AuthenticatedUserModel in let data = try JSONEncoder().encode((user)) AccessToken.set(data: data) }) } Saving data in Keychain Encoding object into data
AccessToken.getData() else { return nil } return try JSONDecoder().decode(AuthenticatedUserModel.self, from: data) } catch { return nil } } Get data from keychain Decoding data into Model