Latest 1.0
Homepage https://github.com/hyc286716320/HYCUserModel
License MIT
Platforms ios , requires ARC
Authors

利用用户偏好设置存储用户重要信息,登陆信息等重要信息,使用方法简单,数据准确
需要在创建model 的时候继承HYCUserModel,然后需要在自己model里面声明并实现单例方法

podfile

To integrate HYCUserModel into your Xcode project using CocoaPods, specify it in your Podfile:

$ pod 'HYCUserModel'

or

pod 'HYCUserModel', '~> 1.0'

Then, run the following command:

$ pod install

Usage

使用前准备工作

 1. 存储用户信息的模型只能创建一个

 2. 创建的模型需要继承HYCUserModel后使用

 3. 需要给给创建的模型实现单例方法并声明出来,并且单例的名字请写成

  `+ (<#ClassName#> *)sharedManager;`

 4. 单例的实现请粘贴下面代码到工程中

   ```
   + (<#ClassName#> *)sharedManager
    {
       static <#ClassName#> *sharedAccountManagerInstance = nil;
        static dispatch_once_t predicate;
       dispatch_once(&predicate, ^{
       sharedAccountManagerInstance = [[self alloc] init];
       });
        return sharedAccountManagerInstance;
    }
    ```

正式使用

  1. 导入自己创建的model的名字
  2. 向model中添加数据,可添加多条或者一条,代码如下

    
    [MyUserData setHYCModelDict:@{
                                  @"userName":@"HYC",
                                  @"ages":@18,
                                  @"work":@"iOS",
                                  //@"isHaveGirlFriend":@NO
                                  }];
      ```
  3. 删除所有数据

      [MyUserData removeHYCModelAllObject];

  4. 读取数据

      [MyUserData sharedManager].userName

如有不明,请下载上面的demo,或加qq:[286716320]

Latest podspec

{
    "name": "HYCUserModel",
    "version": "1.0",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "summary": "u5229u7528u7528u6237u504fu597du8bbeu7f6eu5b58u50a8u7528u6237u91cdu8981u4fe1u606f,u767bu9646u4fe1u606fu7b49u91cdu8981u4fe1u606f,u4f7fu7528u65b9u6cd5u7b80u5355,u6570u636eu51c6u786e",
    "homepage": "https://github.com/hyc286716320/HYCUserModel",
    "authors": {
        "HuYunchao": "hyc286716320"
    },
    "source": {
        "git": "https://github.com/hyc286716320/HYCUserModel.git",
        "tag": "1.0"
    },
    "platforms": {
        "ios": null
    },
    "source_files": "HYCUserModel/HYCUserModel",
    "requires_arc": true
}

Pin It on Pinterest

Share This