Skip to content

iOS 多线程网络请求 Swift版 ,Swift 多线程网络库

Notifications You must be signed in to change notification settings

bindx/DXConnection_Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

DXHttpRequest_swift


#####文件介绍

File Name introduction
DXHttpRequest.swift 网络请求
UIImageView+Network.swift 给UIImageView&UIButton添加网络方法

使用方法

####---- GET请求

   Request.Get.dataWith("http://c.m.163.com//nc/article/list/T1348649580692/0-20.html") { (result) -> Void in
            
            self.data = result["T1348649580692"].arrayObject!;
            
            //回到主线程更新TableView数据
            dispatch_async(dispatch_get_main_queue(), { () -> Void in
                self.tableView.reloadData();
            
            })
            
        };
    } 

####---- POST 请求

 Request.Get.dataWith("http://postxxxx",data: NSData?) { (result) -> Void in
    
    };

---- 设置网络图片

  xxxx.setImageWithUrl("http://imageUrl");

  xxx的类型必须为:UIButton或UIImageView
  
备注:依赖SwiftyJSON库解析JSON数据

About

iOS 多线程网络请求 Swift版 ,Swift 多线程网络库

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published