XUserDefaults
对 iOS NSUserDefaults 的封装,主要使用 runtime 转化成对象,便于管理 key 数据存储,还是使用 NSUserDefaults,只不过简化了 key 的管理。
// 使用示例 1、安装 source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/lisundy/XUserDefaultsTool.git'
platform :ios, '8.0'
target 'LXBUserDefaultsDemo' do
pod 'XUserDefaultsTool'
end
pod install
2、代码示例
TestUserDefaults *userDefault = [TestUserDefaults sharedInstance];
userDefault.name = @"testname";