Giter Club home page Giter Club logo

ghxnetworking's Introduction

GhxNetWorking

基于AFNetworking网络框架的封装

适用版本 ios 8.0 +

pod

pod 'HXNetWorking'

使用

网络判断

  • 网络判断
[NetWorkHelper currentNetStatus:^(BOOL isConnect, AFNetworkReachabilityStatus currentStatus) {
NSLog(@"");
}];
  • 版本更新 通过 bundleid , so 不用修改什么配置
    [[NetWorkHelper sharedInstance] checkSystemIfNeedUpdate:^(BOOL isNeed, NSString *updateUrl, NSString *msg, NSDictionary *dic) {
       NSLog(@"");
   }];
//block方法可以 再处理 比如,强制更新等
[[NetWorkHelper sharedInstance] checkSystemIfNeedUpdate:nil];
  • 网络请求
  • 方法一 继承 Network 请求公共写在一个类
    NetWorkTool * netTool = [[NetWorkTool alloc] initWithSuccess:^(id obj) {
       NSLog(@"");
          } fail:^(id obj) {
       NSLog(@"");

     }];
   [netTool login:@"五华社区" pwd:@"123456" isclassify:YES];
  • 方法二 直接使用 降低耦合度
      NetWorkHelper * helper = [[NetWorkHelper alloc] init];
      NSMutableDictionary * params = [NSMutableDictionary dictionaryWithCapacity:1];
      [params setObject:@"五华社区" forKey:@"user"];
      [params setObject:[helper md5:@"123456"] forKey:@"password"];
      [params setObject:[NSString stringWithFormat:@"%d",1] forKey:@"isclassify"];
      [helper requestURLString:@"url" parameters:params httpRequestType:RequestPost succeed:^(id responseObject) {
      
         NSLog(@"");

      } failure:^(NSError *error) {
      
        NSLog(@"");
        
      }];
   ```

ghxnetworking's People

Contributors

earthmass avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.