<p align="center" >
<img src="https://raw.github.com/AFNetworking/AFNetworking/assets/afnetworking-logo.png" alt="AFNetworking" title="AFNetworking">
</p>
[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking)
[![codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/coverage.svg?branch=master)](https://codecov.io/github/AFNetworking/AFNetworking?branch=master)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking)
[![Twitter](https://img.shields.io/badge/twitter-@AFNetworking-blue.svg?style=flat)](http://twitter.com/AFNetworking)
AFNetworking is a delightful networking library for iOS and Mac OS X. It's built on top of the [Foundation URL Loading System](http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html), extending the powerful high-level networking abstractions built into Cocoa. It has a modular architecture with well-designed, feature-rich APIs that are a joy to use.
Perhaps the most important feature of all, however, is the amazing community of developers who use and contribute to AFNetworking every day. AFNetworking powers some of the most popular and critically-acclaimed apps on the iPhone, iPad, and Mac.
Choose AFNetworking for your next project, or migrate over your existing projects—you'll be happy you did!
## How To Get Started
- [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps
- Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki)
- Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking
- Read the [AFNetworking 3.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide) for an overview of the architectural changes from 2.0.
## Communication
- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking). (Tag 'afnetworking')
- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/afnetworking).
- If you **found a bug**, _and can provide steps to reliably reproduce it_, open an issue.
- If you **have a feature request**, open an issue.
- If you **want to contribute**, submit a pull request.
## Installation
AFNetworking supports multiple methods for installing the library in a project.
## Installation with CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking). You can install it with the following command:
```bash
$ gem install cocoapods
```
> CocoaPods 0.39.0+ is required to build AFNetworking 3.0.0+.
#### Podfile
To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
pod 'AFNetworking', '~> 3.0'
```
Then, run the following command:
```bash
$ pod install
```
### Installation with Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
```bash
$ brew update
$ brew install carthage
```
To integrate AFNetworking into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
github "AFNetworking/AFNetworking" ~> 3.0
```
Run `carthage` to build the framework and drag the built `AFNetworking.framework` into your Xcode project.
## Requirements
| AFNetworking Version | Minimum iOS Target | Minimum OS X Target | Minimum watchOS Target | Minimum tvOS Target | Notes |
|:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:|
| 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. |
| 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. |
| 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. |
| 1.x | iOS 5 | Mac OS X 10.7 | n/a | n/a |
| 0.10.x | iOS 4 | Mac OS X 10.6 | n/a | n/a |
(OS X projects must support [64-bit with modern Cocoa runtime](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtVersionsPlatforms.html)).
> Programming in Swift? Try [Alamofire](https://github.com/Alamofire/Alamofire) for a more conventional set of APIs.
## Architecture
### NSURLSession
- `AFURLSessionManager`
- `AFHTTPSessionManager`
### Serialization
* `<AFURLRequestSerialization>`
- `AFHTTPRequestSerializer`
- `AFJSONRequestSerializer`
- `AFPropertyListRequestSerializer`
* `<AFURLResponseSerialization>`
- `AFHTTPResponseSerializer`
- `AFJSONResponseSerializer`
- `AFXMLParserResponseSerializer`
- `AFXMLDocumentResponseSerializer` _(Mac OS X)_
- `AFPropertyListResponseSerializer`
- `AFImageResponseSerializer`
- `AFCompoundResponseSerializer`
### Additional Functionality
- `AFSecurityPolicy`
- `AFNetworkReachabilityManager`
## Usage
### AFURLSessionManager
`AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to `<NSURLSessionTaskDelegate>`, `<NSURLSessionDataDelegate>`, `<NSURLSessionDownloadDelegate>`, and `<NSURLSessionDelegate>`.
#### Creating a Download Task
```objective-c
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
NSURL *URL = [NSURL URLWithString:@"http://example.com/download.zip"];
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
NSURLSessionDownloadTask *downloadTask = [manager downloadTaskWithRequest:request progress:nil destination:^NSURL *(NSURL *targetPath, NSURLResponse *response) {
NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil];
return [documentsDirectoryURL URLByAppendingPathComponent:[response suggestedFilename]];
} completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) {
NSLog(@"File downloaded to: %@", filePath);
}];
[downloadTask resume];
```
#### Creating an Upload Task
```objective-c
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
NSURL *URL = [NSURL URLWithString:@"http://example.com/upload"];
NSURLRequest *request = [NSURLRequest requestWithURL:URL];
NSURL *filePath = [NSURL fileURLWithPath:@"file://path/to/image.png"];
NSURLSessionUploadTask *uploadTask = [manager uploadTaskWithRe
没有合适的资源?快使用搜索试试~ 我知道了~
ios-OC 九宫格抽奖、可以设置概率.zip
共162个文件
h:42个
m:39个
plist:7个
需积分: 10 4 下载量 188 浏览量
2019-07-11
19:07:17
上传
评论
收藏 607KB ZIP 举报
温馨提示
九宫格抽奖
资源推荐
资源详情
资源评论
收起资源包目录
ios-OC 九宫格抽奖、可以设置概率.zip (162个子文件)
0083fdebd7913e1d455c8b689ab6e55ea6c2eb 268B
011ca13ee4d133f91f1fba3defe2b611a1b4a8 2KB
029e2cbabdf90d0f0d8e180790d1a590097140 923B
09120a0d5d006aa9a01502992288c2efed4320 133B
0dc150ce654ca85bd638c45676ad0986fc0865 141B
177ecca45e9123ac8910c05cd61e1b1b62ffc9 131B
29698c4c56ae1c65c132f2754a23d888259a74 781B
29b96c4f3ec37981d0d51f0b027f54586daaf9 67KB
3ddeaf3a6f30c61b4508e0f4619aa7f10d60c2 230B
471cf6a7b78e88fd5854abb7067cfe3185577a 851B
49f52507dc6d0b7d3d9529d9864f58795556fc 101B
5f32cdb68770d512dfaebe41f7668bd3272b16 287B
81360e62290af5abcd901c042596de67bb72fc 83B
85ca452ea5e519461ec5072a6ab8fe60181c17 69B
8c98f7461bf98b2bc7e061150d8021121ad277 161B
9a8483e25c5d4934c7b4089353104105515d3b 56B
a0bcd5246aa4618e7cd5eaf025c7d3e7b58d03 256KB
b616f0e8f4487791d50e620e6df67037c621da 57B
bf7f42b7757b3076a7d2f5afc476488f6613e0 59B
COMMIT_EDITMSG 15B
config 137B
d1ee1fad9a7c3072e583776f335353a99f3e05 280B
d83579e1b92c0b4487838180dd488c64ecfbb6 315B
deecd17506d44e3eb7f89edda90be4222f928d 322B
description 73B
df0c82b23d2ff75ef29cb361dd9cd2e9a6ad2b 3KB
.DS_Store 6KB
e16021fc75744316b175c5fcf2aaff6b99b9cd 175B
e98af23d391ddd93a0c47f4113cb2fb64606d5 494B
eab2ce39ace669e38967b0b7baec33f18b59eb 94B
exclude 40B
f136aa84587fff8551b0e3505bd445e8cdb252 51B
f3f97d1b6e9d8d29bb69a88c4d89ca752bd937 807B
f74065d609f5199d34a6e9774e4611db71bb97 164B
fda5d4a773904b759d2acc326336b5e17d1693 378B
AFURLSessionManager.h 29KB
AFURLRequestSerialization.h 22KB
AFHTTPSessionManager.h 19KB
AFURLResponseSerialization.h 12KB
UIButton+WebCache.h 11KB
SDWebImageManager.h 10KB
UIButton+AFNetworking.h 10KB
AFImageDownloader.h 9KB
SDImageCache.h 9KB
UIImageView+WebCache.h 8KB
SDWebImageDownloader.h 8KB
AFNetworkReachabilityManager.h 8KB
UIImageView+AFNetworking.h 6KB
AFSecurityPolicy.h 6KB
AFAutoPurgingImageCache.h 6KB
AFNetworkActivityIndicatorManager.h 5KB
SDWebImageDownloaderOperation.h 5KB
UIWebView+AFNetworking.h 4KB
UIImageView+HighlightedWebCache.h 4KB
SDWebImagePrefetcher.h 4KB
UIView+WebCache.h 3KB
SDWebImageCompat.h 3KB
UIProgressView+AFNetworking.h 2KB
UIRefreshControl+AFNetworking.h 2KB
UIActivityIndicatorView+AFNetworking.h 2KB
UIKit+AFNetworking.h 2KB
AFNetworking.h 2KB
UIImage+AFNetworking.h 1KB
UIView+WebCacheOperation.h 1KB
SDImageCacheConfig.h 994B
AFNetworking-umbrella.h 966B
SDWebImage-umbrella.h 890B
NSData+ImageContentType.h 756B
Luck.h 591B
UIImage+GIF.h 583B
SDWebImageDecoder.h 534B
UIImage+MultiFormat.h 505B
NSImage+WebCache.h 412B
SDWebImageOperation.h 329B
Pods-抽奖-umbrella.h 306B
AppDelegate.h 278B
ViewController.h 216B
HEAD 155B
HEAD 23B
index 2KB
Contents.json 585B
LICENSE 1KB
LICENSE 1KB
Manifest.lock 877B
Podfile.lock 877B
AFURLSessionManager.m 54KB
AFURLRequestSerialization.m 50KB
AFURLResponseSerialization.m 26KB
SDImageCache.m 22KB
SDWebImageDownloaderOperation.m 22KB
AFImageDownloader.m 17KB
SDWebImageManager.m 16KB
AFHTTPSessionManager.m 15KB
SDWebImageDownloader.m 14KB
AFSecurityPolicy.m 13KB
UIButton+AFNetworking.m 13KB
SDWebImageDecoder.m 12KB
AFNetworkActivityIndicatorManager.m 10KB
AFNetworkReachabilityManager.m 10KB
AFAutoPurgingImageCache.m 7KB
共 162 条
- 1
- 2
资源评论
weixin_39840914
- 粉丝: 435
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功