Latest 0.3.3
Homepage https://github.com/HotWordland/WLKit
License MIT
Platforms ios 7.0, requires ARC
Dependencies JSONModel, AFNetworking, YYKit
Authors

CI Status
Version
License
Platform

Usage

支持cocoapods 在profile里面添加:

pod "WLKit"

2016-07-31

更新至0.3.0 增加Depends管理

{
JSONModel,
AFNetworking,
YYKit
}

To run the example project, clone the repo, and run pod install from the Example directory first.

WLKit框架 – 布局 网络请求 一些常用扩展类 不断更新

布局 – 将一个红色的view 尺寸为100 100 位于视图中心

- (void)viewDidLoad {
    [super viewDidLoad];
    // 将一个红色的view 尺寸为100 100 位于视图中心
    //初始化View
    UIView *view = [UIView new];
    //添加进父视图
    [self.view addSubview:view];
    //设置背景颜色
    [view setBackgroundColor:[UIColor redColor]];
    /*** 布局核心 ***/
    //准备好view 为view添加autolayout属性
    PREPCONSTRAINTS(view);
    //设置尺寸
    CONSTRAIN_SIZE(view, 100, 100);
    //在父视图居中
    CENTER(view);
    /*** ***/

   }

result

网络请求

请求是基于AFNetWork的封装 这个就不多说了 自己选用了一个比较好的封装LYHTTPClient作为扩展
对于每一次请求都可以进行缓存和不缓存(YYCache) 对于一些常见的逻辑
已经足够了


typedef NS_ENUM(NSUInteger, LYHTTPClientRequestCachePolicy){
    LYHTTPClientReturnCacheDataThenLoad = 0,///< 有缓存就先返回缓存,同步请求数据
    LYHTTPClientReloadIgnoringLocalCacheData, ///< 忽略缓存,重新请求
    LYHTTPClientReturnCacheDataElseLoad,///< 有缓存就用缓存,没有缓存就重新请求(用于数据不变时)
    LYHTTPClientReturnCacheDataDontLoad,///< 有缓存就用缓存,没有缓存就不发请求,当做请求出错处理(用于离线模式)
};

/// 可以自由设置超时时间,缓存方式。
+ (NSURLSessionDataTask *)GET:(NSString *)URLString
                   parameters:(id)parameters
              timeoutInterval:(NSTimeInterval)timeoutInterval
                  cachePolicy:(LYHTTPClientRequestCachePolicy)cachePolicy
                      success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
                      failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure

继续更新中…

Requirements

Installation

WLKit is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "WLKit"

Author

巫龙, [email protected]

License

WLKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "WLKit",
    "version": "0.3.3",
    "summary": "Embed once to Quick Develop(u4e00u6b21u96c6u6210 u5febu901fu5f00u53d1)",
    "description": "WLu6846u67b6 - u5305u542b u5e03u5c40 u7f51u7edcu8bf7u6c42 u7b49u4e00u4e9bu5e38u7528u6269u5c55u7c7b ... u4e0du65adu66f4u65b0 u8ba9u9879u76eeu4e00u6b21u96c6u6210u5e38u7528u6846u67b6 u5febu901fu5f00u53d1.",
    "homepage": "https://github.com/HotWordland/WLKit",
    "license": "MIT",
    "authors": {
        "u5debu9f99": "[email protected]"
    },
    "source": {
        "git": "https://github.com/HotWordland/WLKit.git",
        "tag": "0.3.3"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "WLKit": [
            "Pod/Assets/*.png"
        ]
    },
    "dependencies": {
        "JSONModel": [],
        "AFNetworking": [
            "~> 3.0"
        ],
        "YYKit": []
    },
    "libraries": "sqlite3"
}

Pin It on Pinterest

Share This