統計情報(30日間)


最新情報をツイート


人気の投稿

Keychain API ラッパー

このエントリーをはてなブックマークに追加



@interface FXKeychain : NSObject

+ (instancetype)defaultKeychain;

@property (nonatomic, copy, readonly) NSString *account;
@property (nonatomic, copy, readonly) NSString *service;
@property (nonatomic, copy, readonly) NSString *accessGroup;

- (id)initWithAccount:(NSString *)account
              service:(NSString *)service
          accessGroup:(NSString *)accessGroup;

- (BOOL)setObject:(id)object forKey:(id)key;
- (BOOL)setObject:(id)object forKeyedSubscript:(id)key;
- (BOOL)removeObjectForKey:(id)key;
- (id)objectForKey:(id)key;
- (id)objectForKeyedSubscript:(id)key;

@end

シンプルでなかなかいい。Subscripting対応なので keychain[@"key"]=obj や obj=keychain[@"Key1"]みたいな書き方ができる(たぶん)。

参考)

Leave a Reply