-
Support multiple users in tvOS apps
Discover how you can create personalized, individual experiences in your tvOS app. We'll show you how you can offer a single checkbox to store profile data, game save states, and more, providing each person with the same level of data separation they'd have on a personal device like iPhone. We'll also explore how the new user-independent keychain can help you maintain your existing sign on experience for multiple people in the same household.
Recursos
Videos relacionados
WWDC22
WWDC21
WWDC20
-
Buscar este video…
-
-
5:25 - Save item in user independent keychain
func save(username: String, password: String) { guard let passwordData = password.data(using: .utf8) else { return } let attributes: [CFString: AnyObject] = [ kSecAttrService: "MyApp" as AnyObject, kSecClass: kSecClassGenericPassword, kSecAttrAccount: username, kSecValueData: passwordData, kSecUseUserIndependentKeychain: kCFBooleanTrue ] let status = SecItemAdd(attributes as CFDictionary, nil) if status == errSecSuccess else { self.credentials = (username, password) } }
-