/CCKeychain

Primary LanguageObjective-C

CCKeychain

iOS 10以下都可以真机、模拟器测试,iOS 10及以上只能真机测试

解决办法是: 选择 capabilities 打开 keychain Groups

How to use?

Save

    NSMutableDictionary *usernamepasswordKVPairs = [NSMutableDictionary dictionary];
    [usernamepasswordKVPairs setObject:field.text forKey:KEY_PASSWORD];
    [CCKeychain save:KEY_USERNAME_PASSWORD data:usernamepasswordKVPairs];

Read

    NSMutableDictionary *usernamepasswordKVPairs = (NSMutableDictionary *)[CCKeychain load:KEY_USERNAME_PASSWORD];
    NSLog(@"%@",[usernamepasswordKVPairs objectForKey:KEY_PASSWORD]);

Delete

    [CCKeychain delete:KEY_USERNAME_PASSWORD];