Skip to content

Instantly share code, notes, and snippets.

@Raztor0
Raztor0 / KeychainTest.m
Created February 21, 2017 19:25
iOS10.3 beta2 Keychain Autodelete Workaround
- (BOOL)saveToKeychain {
NSData *passwordData = [@"myPassword" dataUsingEncoding:NSUTF8StringEncoding];
/* Try to save to the keychain */
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:3];
[dictionary setObject:(__bridge id)kSecClassGenericPassword forKey:(__bridge id)kSecClass];
[dictionary setObject:@"myService" forKey:(__bridge id)kSecAttrService];
[dictionary setObject:@"myAccount" forKey:(__bridge id)kSecAttrAccount];
/* Use the kSecAttrAccessGroupToken access group constant*/
[dictionary setObject:(__bridge NSString * _Nullable)(kSecAttrAccessGroupToken) forKey:(__bridge id)kSecAttrAccessGroup];
[dictionary setObject:passwordData forKey:(__bridge id)kSecValueData];
@adamgit
adamgit / gist:3705459
Last active December 11, 2023 16:27
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)