Browse Source

MOB 3.5.1

贺泌钦 3 years ago
commit
144f26ffa5
100 changed files with 22328 additions and 0 deletions
  1. 43 0
      Podfile
  2. 85 0
      Podfile.lock
  3. 61 0
      Pods/ACAlertController/ACAlertController/ACAlertController.h
  4. 226 0
      Pods/ACAlertController/ACAlertController/ACAlertController.m
  5. 21 0
      Pods/ACAlertController/LICENSE
  6. 83 0
      Pods/ACAlertController/README.md
  7. 295 0
      Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h
  8. 361 0
      Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m
  9. 206 0
      Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h
  10. 263 0
      Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m
  11. 41 0
      Pods/AFNetworking/AFNetworking/AFNetworking.h
  12. 154 0
      Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h
  13. 353 0
      Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m
  14. 479 0
      Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h
  15. 1376 0
      Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m
  16. 311 0
      Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h
  17. 805 0
      Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m
  18. 500 0
      Pods/AFNetworking/AFNetworking/AFURLSessionManager.h
  19. 1244 0
      Pods/AFNetworking/AFNetworking/AFURLSessionManager.m
  20. 19 0
      Pods/AFNetworking/LICENSE
  21. 320 0
      Pods/AFNetworking/README.md
  22. 149 0
      Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h
  23. 201 0
      Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m
  24. 157 0
      Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h
  25. 391 0
      Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m
  26. 103 0
      Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h
  27. 261 0
      Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m
  28. 48 0
      Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
  29. 124 0
      Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m
  30. 175 0
      Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h
  31. 305 0
      Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m
  32. 35 0
      Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h
  33. 109 0
      Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h
  34. 161 0
      Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m
  35. 42 0
      Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h
  36. 64 0
      Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h
  37. 118 0
      Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m
  38. 53 0
      Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h
  39. 122 0
      Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m
  40. 80 0
      Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h
  41. 162 0
      Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m
  42. 19 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/NSDate+OSS.h
  43. 49 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/NSDate+OSS.m
  44. 15 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableData+OSS_CRC.h
  45. 19 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableData+OSS_CRC.m
  46. 15 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableDictionary+OSS.h
  47. 19 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableDictionary+OSS.m
  48. 33 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSAllRequestNeededMessage.h
  49. 72 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSAllRequestNeededMessage.m
  50. 431 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSClient.h
  51. 1986 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSClient.m
  52. 85 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSCompat.h
  53. 260 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSCompat.m
  54. 129 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSConstants.h
  55. 21 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSConstants.m
  56. 84 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDefine.h
  57. 31 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsRequest.h
  58. 22 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsRequest.m
  59. 17 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsResult.h
  60. 13 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsResult.m
  61. 75 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSCocoaLumberjack.h
  62. 860 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSDDLog.h
  63. 1247 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSDDLog.m
  64. 509 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSFileLogger.h
  65. 1460 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSFileLogger.m
  66. 82 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSLogMacros.h
  67. 14 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSNSLogger.h
  68. 32 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSNSLogger.m
  69. 64 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSReachability.h
  70. 248 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSReachability.m
  71. 15 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoRequest.h
  72. 17 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoRequest.m
  73. 57 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoResult.h
  74. 23 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoResult.m
  75. 26 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLRequest.h
  76. 13 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLRequest.m
  77. 19 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLResult.h
  78. 13 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLResult.m
  79. 17 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkRequest.h
  80. 17 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkRequest.m
  81. 13 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkResult.h
  82. 13 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkResult.m
  83. 39 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpResponseParser.h
  84. 655 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpResponseParser.m
  85. 16 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpdns.h
  86. 140 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpdns.m
  87. 114 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6Adapter.h
  88. 197 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6Adapter.m
  89. 23 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6PrefixResolver.h
  90. 205 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6PrefixResolver.m
  91. 15 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSReachabilityManager.h
  92. 97 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSReachabilityManager.m
  93. 22 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSInputStreamHelper.h
  94. 80 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSInputStreamHelper.m
  95. 54 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSLog.h
  96. 31 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSLog.m
  97. 1480 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSModel.h
  98. 855 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSModel.m
  99. 45 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSNetworking.h
  100. 0 0
      Pods/AliyunOSSiOS/AliyunOSSSDK/OSSNetworking.m

+ 43 - 0
Podfile

@@ -0,0 +1,43 @@
+# Uncomment the next line to define a global platform for your project
+# platform :ios, '9.0'
+
+target 'upAPP' do
+  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
+  # use_frameworks!
+
+  # Pods for upAPP
+
+  target 'upAPPTests' do
+    inherit! :search_paths
+    # Pods for testing
+  end
+
+  target 'upAPPUITests' do
+    inherit! :search_paths
+    # Pods for testing
+  end
+pod 'MJExtension', '~> 3.0.13'
+pod 'AFNetworking', '~> 3.1.0'
+pod 'SDWebImage', '~> 4.3.3'
+pod 'Masonry', '~> 1.1.0'
+pod 'MBProgressHUD', '~> 1.1.0'
+pod 'MJRefresh', '~> 3.1.15.3'
+
+pod 'WHKit', '~> 1.3.4'
+pod 'SDCycleScrollView', '~> 1.75'
+
+pod 'SVProgressHUD', '~> 2.2.5'
+pod 'MBProgressHUD', '~> 1.1.0'
+pod 'BaiduMapKit', '~> 3.4.4'
+
+pod 'IQKeyboardManager'
+
+pod 'DACircularProgress'
+
+pod 'ACAlertController'
+
+pod 'AliyunOSSiOS'
+
+
+
+end

+ 85 - 0
Podfile.lock

@@ -0,0 +1,85 @@
+PODS:
+  - ACAlertController (1.0.0)
+  - AFNetworking (3.1.0):
+    - AFNetworking/NSURLSession (= 3.1.0)
+    - AFNetworking/Reachability (= 3.1.0)
+    - AFNetworking/Security (= 3.1.0)
+    - AFNetworking/Serialization (= 3.1.0)
+    - AFNetworking/UIKit (= 3.1.0)
+  - AFNetworking/NSURLSession (3.1.0):
+    - AFNetworking/Reachability
+    - AFNetworking/Security
+    - AFNetworking/Serialization
+  - AFNetworking/Reachability (3.1.0)
+  - AFNetworking/Security (3.1.0)
+  - AFNetworking/Serialization (3.1.0)
+  - AFNetworking/UIKit (3.1.0):
+    - AFNetworking/NSURLSession
+  - AliyunOSSiOS (2.10.5)
+  - BaiduMapKit (3.4.4)
+  - DACircularProgress (2.3.1)
+  - IQKeyboardManager (6.1.1)
+  - Masonry (1.1.0)
+  - MBProgressHUD (1.1.0)
+  - MJExtension (3.0.15.1)
+  - MJRefresh (3.1.15.3)
+  - SDCycleScrollView (1.75):
+    - SDWebImage (>= 4.0.0)
+  - SDWebImage (4.3.3):
+    - SDWebImage/Core (= 4.3.3)
+  - SDWebImage/Core (4.3.3)
+  - SVProgressHUD (2.2.5)
+  - WHKit (1.3.5)
+
+DEPENDENCIES:
+  - ACAlertController
+  - AFNetworking (~> 3.1.0)
+  - AliyunOSSiOS
+  - BaiduMapKit (~> 3.4.4)
+  - DACircularProgress
+  - IQKeyboardManager
+  - Masonry (~> 1.1.0)
+  - MBProgressHUD (~> 1.1.0)
+  - MJExtension (~> 3.0.13)
+  - MJRefresh (~> 3.1.15.3)
+  - SDCycleScrollView (~> 1.75)
+  - SDWebImage (~> 4.3.3)
+  - SVProgressHUD (~> 2.2.5)
+  - WHKit (~> 1.3.4)
+
+SPEC REPOS:
+  https://github.com/cocoapods/specs.git:
+    - ACAlertController
+    - AFNetworking
+    - AliyunOSSiOS
+    - BaiduMapKit
+    - DACircularProgress
+    - IQKeyboardManager
+    - Masonry
+    - MBProgressHUD
+    - MJExtension
+    - MJRefresh
+    - SDCycleScrollView
+    - SDWebImage
+    - SVProgressHUD
+    - WHKit
+
+SPEC CHECKSUMS:
+  ACAlertController: 10f0455c3e1691a6197b5cd0d96d6f9a03c82763
+  AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
+  AliyunOSSiOS: 53df437f24309bdfbe2df21b4f6be4f75474f00a
+  BaiduMapKit: 4ac88f5a363500760392825b69709f4a0125f81e
+  DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
+  IQKeyboardManager: 79c57795f5c2408d259d37b9da2ed07efcbb5225
+  Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
+  MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
+  MJExtension: 19bc33ce2eee2d319760f5622562cf581a6ff756
+  MJRefresh: b48380ae2b927b46c4ef000de9adb8dc748e1df7
+  SDCycleScrollView: 884b88f0266dd4708a0e1934975c69cb971707b1
+  SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5
+  SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
+  WHKit: 1c8fcddaea10c1e6a8e68a3e24406545c9a36a22
+
+PODFILE CHECKSUM: 89e6bcd4b07d3561903c4266eb2f7945dc54fe43
+
+COCOAPODS: 1.5.3

+ 61 - 0
Pods/ACAlertController/ACAlertController/ACAlertController.h

@@ -0,0 +1,61 @@
+//
+//  ACAlertController.h
+//
+//  Created by caoyq on 2017/3/9.
+//  Copyright © 2017年 ArthurCao. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+typedef void(^ClickActionBlock)(NSInteger index);
+
+@interface ACAlertController : UIView
+
+#pragma mark - properties
+
+/** cancel button text color */
+@property (nonatomic, strong) UIColor * cancelButtonTextColor;
+
+/** cancel button text font */
+@property (nonatomic, strong) UIFont *cancelButtonTextFont;
+
+/** all action buttons text color */
+@property (nonatomic, strong)  UIColor *actionButtonsTextColor;
+
+/** all action buttons text font */
+@property (nonatomic, strong)  UIFont *actionButtonsTextFont;
+
+#pragma mark - methods
+
+/**
+ *  Init
+ */
+- (instancetype)initWithActionSheetTitles: ( NSArray<NSString *> *)titles cancelTitle: (NSString *)cancelTitle;
+
+/**
+ *  display
+ */
+- (void)show;
+
+/**
+ * 选中actionButton之后的一个回调block,返回选中下标,index start from 0.
+ */
+- (void)clickActionButton: (ClickActionBlock)clickBlock;
+
+/**
+ set action button text color with index.
+ 
+ @param color  color
+ @param index  the index of the action button you set.
+ */
+- (void)configureActionButtonTextColor: (UIColor *)color index: (NSInteger)index;
+
+/**
+ set action button text font with index.
+
+ @param font   font
+ @param index  the index of the action button you set.
+ */
+- (void)configureActionButtonTextFont:(UIFont *)font index:(NSInteger)index;
+
+@end

+ 226 - 0
Pods/ACAlertController/ACAlertController/ACAlertController.m

@@ -0,0 +1,226 @@
+//
+//  ACAlertController.m
+//
+//  Created by caoyq on 2017/3/9.
+//  Copyright © 2017年 ArthurCao. All rights reserved.
+//
+
+#import "ACAlertController.h"
+
+#define ACScreenWidth [UIScreen mainScreen].bounds.size.width
+
+#define ACScreenHeight [UIScreen mainScreen].bounds.size.height
+
+#define kRadio   ACScreenWidth / 375.0
+
+#define kTextFont  16 * kRadio  //字体大小
+
+#define ButtonHeight 45 //每个按钮的高度
+
+#define CancleMargin 8 //取消按钮上面的间隔
+
+#define ACColor(r, g, b) [UIColor colorWithRed:(r/255.0) green:(g/255.0) blue:(b/255.0) alpha:1.0]
+
+#define BgColor ACColor(237,240,242) //背景色
+
+#define SeparatorColor ACColor(226, 226, 226) //分割线颜色
+
+#define normalImage [self imageWithColor:ACColor(255,255,255)] //按钮普通状态下的图片
+
+#define highImage [self imageWithColor:ACColor(242,242,242)] //按钮高亮状态下的图片
+
+@interface ACAlertController ()
+
+/** 底部遮罩层 */
+@property (nonatomic, strong) ACAlertController *shadeView;
+
+/** 展示层 */
+@property (nonatomic, strong) UIView *sheetView;
+
+/** block */
+@property (nonatomic, copy) ClickActionBlock block;
+
+/** all action button */
+@property (nonatomic, strong) NSMutableArray *allActionButton;
+
+/** cancel button */
+@property (nonatomic, strong) UIButton *cancelButton;
+
+@end
+
+@implementation ACAlertController
+
+- (instancetype)initWithActionSheetTitles: (NSArray<NSString *> *)titles cancelTitle: (NSString *)cancelTitle {
+    
+    if (titles.count == 0 || cancelTitle.length == 0) {
+        return nil;
+    }
+    
+    // self 为底部遮罩层
+    ACAlertController *shadeView = [self init];
+    shadeView.frame = [UIScreen mainScreen].bounds;
+    shadeView.backgroundColor = [UIColor blackColor];
+    shadeView.alpha = 0;
+    [[UIApplication sharedApplication].keyWindow addSubview:shadeView];
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(shadeViewClick)];
+    [shadeView addGestureRecognizer:tap];
+    self.shadeView = shadeView;
+    
+    CGFloat sheetHeight = (titles.count + 1) * ButtonHeight + CancleMargin;
+    UIView *sheetView = [[UIView alloc] initWithFrame:CGRectMake(0, ACScreenHeight, ACScreenWidth, sheetHeight)];
+    sheetView.backgroundColor = BgColor;
+    sheetView.alpha = 0.9;
+    [[UIApplication sharedApplication].keyWindow addSubview:sheetView];
+    self.sheetView = sheetView;
+    
+    [self setupButtonsWithTitles:titles];
+    [self setupCancelButtonWithTitle:cancelTitle];
+    
+    return shadeView;
+}
+
+#pragma mark - public methods
+
+- (void)show {
+    CGRect rect = self.sheetView.frame;
+    rect.origin.y = ACScreenHeight - self.sheetView.frame.size.height;
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        self.sheetView.frame = rect;
+        self.shadeView.alpha = 0.3;
+    }];
+}
+
+- (void)clickActionButton:(ClickActionBlock)clickBlock {
+    self.block = clickBlock;
+}
+
+- (void)configureActionButtonTextColor:(UIColor *)color index:(NSInteger)index {
+    UIButton *btn = _allActionButton[index];
+    [btn setTitleColor:color forState:UIControlStateNormal];
+}
+
+- (void)configureActionButtonTextFont:(UIFont *)font index:(NSInteger)index {
+    UIButton *btn = _allActionButton[index];
+    [btn.titleLabel setFont:font];
+}
+
+#pragma mark - setter
+
+- (void)setCancelButtonTextColor:(UIColor *)cancelButtonTextColor {
+    _cancelButtonTextColor = cancelButtonTextColor;
+    [self.cancelButton setTitleColor:_cancelButtonTextColor forState:UIControlStateNormal];
+}
+
+- (void)setCancelButtonTextFont:(UIFont *)cancelButtonTextFont {
+    _cancelButtonTextFont = cancelButtonTextFont;
+    [self.cancelButton.titleLabel setFont:_cancelButtonTextFont];
+}
+
+- (void)setActionButtonsTextColor:(UIColor *)actionButtonsTextColor {
+    _actionButtonsTextColor = actionButtonsTextColor;
+    for (UIButton *btn in _allActionButton) {
+        [btn.titleLabel setTextColor:actionButtonsTextColor];
+    }
+}
+
+- (void)setActionButtonsTextFont:(UIFont *)actionButtonsTextFont {
+    _actionButtonsTextFont = actionButtonsTextFont;
+    for (UIButton *btn in _allActionButton) {
+        [btn.titleLabel setFont:actionButtonsTextFont];
+    }
+}
+
+#pragma mark - actions
+
+/** dismiss */
+- (void)hide {
+    
+    CGRect rect = self.sheetView.frame;
+    rect.origin.y = ACScreenHeight;
+    
+    [UIView animateWithDuration:0.2 animations:^{
+        self.sheetView.frame = rect;
+        self.shadeView.alpha = 0;
+    } completion:^(BOOL finished) {
+        [self.shadeView removeFromSuperview];
+        [self.sheetView removeFromSuperview];
+    }];
+}
+
+/** click shade view */
+- (void)shadeViewClick {
+    [self hide];
+}
+
+- (void)actionButtonClick: (UIButton *)btn {
+    
+    //tag start with 100
+    NSInteger tag = btn.tag - 100;
+    
+    if (tag != 0) {
+        if (self.block) {
+            self.block(tag - 1);
+        }
+    }
+    [self hide];
+}
+
+#pragma mark - private
+
+/** setup action buttons */
+- (void)setupButtonsWithTitles: (NSArray *)titles {
+    _allActionButton = [NSMutableArray array];
+    for (NSInteger idx = 0; idx < titles.count; idx ++) {
+        UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, ButtonHeight * idx , ACScreenWidth, ButtonHeight)];
+        [btn setBackgroundImage:normalImage forState:UIControlStateNormal];
+        [btn setBackgroundImage:highImage forState:UIControlStateHighlighted];
+        [btn setTitle:titles[idx] forState:UIControlStateNormal];
+        [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+        btn.titleLabel.font = [UIFont systemFontOfSize:kTextFont];
+        btn.tag = 101 + idx;
+        [btn addTarget:self action:@selector(actionButtonClick:) forControlEvents:UIControlEventTouchUpInside];
+        [self.sheetView addSubview:btn];
+        
+        // top separator line
+        UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ACScreenWidth, 0.5)];
+        line.backgroundColor = SeparatorColor;
+        [btn addSubview:line];
+        [_allActionButton addObject:btn];
+    }
+}
+
+/** setup cancel button */
+- (void)setupCancelButtonWithTitle: (NSString *)title {
+    
+    CGFloat btnY = self.sheetView.frame.size.height - ButtonHeight;
+    UIButton *cancel = [[UIButton alloc] initWithFrame:CGRectMake(0, btnY, ACScreenWidth, ButtonHeight)];
+    [cancel setBackgroundImage:normalImage forState:UIControlStateNormal];
+    [cancel setBackgroundImage:highImage forState:UIControlStateHighlighted];
+    [cancel setTitle:title forState:UIControlStateNormal];
+    [cancel setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+    cancel.titleLabel.font = [UIFont systemFontOfSize:kTextFont];
+    cancel.tag = 100;
+    [cancel addTarget:self action:@selector(actionButtonClick:) forControlEvents:UIControlEventTouchUpInside];
+    [self.sheetView addSubview:cancel];
+    self.cancelButton = cancel;
+}
+
+/**
+ 根据颜色生成图片
+ @param color 颜色
+ @return 图片
+ */
+- (UIImage*)imageWithColor:(UIColor*)color {
+    
+    CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
+    UIGraphicsBeginImageContext(rect.size);
+    CGContextRef context = UIGraphicsGetCurrentContext();
+    CGContextSetFillColorWithColor(context, [color CGColor]);
+    CGContextFillRect(context, rect);
+    UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
+    UIGraphicsEndImageContext();
+    return theImage;
+}
+
+@end

+ 21 - 0
Pods/ACAlertController/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Arthur Cao
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 83 - 0
Pods/ACAlertController/README.md

@@ -0,0 +1,83 @@
+# ACAlertController
+
+At iOS 8.0 later, we use UIAlertController, it's not friendly, so we  replace it with ACAlertController. 
+
+
+
+------
+
+![ACAlertControllerExampleGif](https://github.com/honeycao/ACAlertController/blob/master/ACAlertControllerExampleGif.gif)
+
+
+
+## Requirements
+
+* iOS 7.0 or later
+* Xcode 7.0 or later
+
+## Architecture
+
+* [How to use](#use)
+* [Details (See the example program ACAlertControllerExample for details)](#Details)
+* [Custom](#Custom)
+* [Hope](#hope)
+
+
+
+## <a id="use"></a>How to use
+
+* Use CocoaPods:
+  - waiting...
+* Manual import:
+  - Drag All files in the `ACAlertController` folder to project
+  - Import the main file:`#import "ACAlertController.h"`
+
+## <a id="Details"></a>Details (See the example program ACAlertControllerExample for details)
+
+```objective-c
+//1、初始化
+ACAlertController *action2 = [[ACAlertController alloc] initWithActionSheetTitles:self.titles cancelTitle:self.cancelTitle];
+    
+//2、获取点击事件
+[action2 clickActionButton:^(NSInteger index) {
+    NSLog(@"selected item = %ld", (long)index);
+}];
+    
+//3、显示
+[action2 show];
+```
+
+## <a id="Custom"></a>Custom
+
+* `cancelButtonTextColor`  
+
+* `cancelButtonTextFont`
+
+* `actionButtonsTextColor`
+
+* `actionButtonsTextFont`
+
+* set action button text color with index
+
+  ```
+  - (void)configureActionButtonTextColor: (UIColor *)color index: (NSInteger)index;
+  ```
+
+  ​
+
+* set action button text font with index.
+
+  ```
+  - (void)configureActionButtonTextFont:(UIFont *)font index:(NSInteger)index;
+  ```
+
+  ​
+
+## <a id="hope"></a>Hope
+
+- If you have any questions during the process or want more interfaces to customize,you can [issues me](https://github.com/honeycao/ACAlertController/issues/new)
+- If you feel slightly discomfort in use, please contact me QQ:331864805
+- If you support me, please giving me star
+
+## Licenses
+All source code is licensed under the MIT License.

+ 295 - 0
Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.h

@@ -0,0 +1,295 @@
+// AFHTTPSessionManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#if !TARGET_OS_WATCH
+#import <SystemConfiguration/SystemConfiguration.h>
+#endif
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
+#import <MobileCoreServices/MobileCoreServices.h>
+#else
+#import <CoreServices/CoreServices.h>
+#endif
+
+#import "AFURLSessionManager.h"
+
+/**
+ `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths.
+
+ ## Subclassing Notes
+
+ Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application.
+
+ For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect.
+
+ ## Methods to Override
+
+ To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:completionHandler:`.
+
+ ## Serialization
+
+ Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to `<AFURLRequestSerialization>`.
+
+ Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `<AFURLResponseSerialization>`
+
+ ## URL Construction Using Relative Paths
+
+ For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`.
+
+ Below are a few examples of how `baseURL` and relative paths interact:
+
+    NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"];
+    [NSURL URLWithString:@"foo" relativeToURL:baseURL];                  // http://example.com/v1/foo
+    [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL];          // http://example.com/v1/foo?bar=baz
+    [NSURL URLWithString:@"/foo" relativeToURL:baseURL];                 // http://example.com/foo
+    [NSURL URLWithString:@"foo/" relativeToURL:baseURL];                 // http://example.com/v1/foo
+    [NSURL URLWithString:@"/foo/" relativeToURL:baseURL];                // http://example.com/foo/
+    [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/
+
+ Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash.
+
+ @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance.
+ */
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying>
+
+/**
+ The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods.
+ */
+@property (readonly, nonatomic, strong, nullable) NSURL *baseURL;
+
+/**
+ Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
+
+ @warning `requestSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
+
+/**
+ Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`.
+
+ @warning `responseSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns an `AFHTTPSessionManager` object.
+ */
++ (instancetype)manager;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ @param url The base URL for the HTTP client.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(nullable NSURL *)url;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ This is the designated initializer.
+
+ @param url The base URL for the HTTP client.
+ @param configuration The configuration used to create the managed session.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(nullable NSURL *)url
+           sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
+
+///---------------------------
+/// @name Making HTTP Requests
+///---------------------------
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `GET` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
+                   parameters:(nullable id)parameters
+                      success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                      failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
+
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `GET` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
+                            parameters:(nullable id)parameters
+                              progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
+                               success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                               failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
+                    parameters:(nullable id)parameters
+                       success:(nullable void (^)(NSURLSessionDataTask *task))success
+                       failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                    parameters:(nullable id)parameters
+                       success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                       failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                             parameters:(nullable id)parameters
+                               progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                    parameters:(nullable id)parameters
+     constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
+                       success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                       failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                             parameters:(nullable id)parameters
+              constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
+                               progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
+                   parameters:(nullable id)parameters
+                      success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                      failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
+                     parameters:(nullable id)parameters
+                        success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                        failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
+
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
+                      parameters:(nullable id)parameters
+                         success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                         failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 361 - 0
Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m

@@ -0,0 +1,361 @@
+// AFHTTPSessionManager.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "AFHTTPSessionManager.h"
+
+#import "AFURLRequestSerialization.h"
+#import "AFURLResponseSerialization.h"
+
+#import <Availability.h>
+#import <TargetConditionals.h>
+#import <Security/Security.h>
+
+#import <netinet/in.h>
+#import <netinet6/in6.h>
+#import <arpa/inet.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+#import <UIKit/UIKit.h>
+#elif TARGET_OS_WATCH
+#import <WatchKit/WatchKit.h>
+#endif
+
+@interface AFHTTPSessionManager ()
+@property (readwrite, nonatomic, strong) NSURL *baseURL;
+@end
+
+@implementation AFHTTPSessionManager
+@dynamic responseSerializer;
+
++ (instancetype)manager {
+    return [[[self class] alloc] initWithBaseURL:nil];
+}
+
+- (instancetype)init {
+    return [self initWithBaseURL:nil];
+}
+
+- (instancetype)initWithBaseURL:(NSURL *)url {
+    return [self initWithBaseURL:url sessionConfiguration:nil];
+}
+
+- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration {
+    return [self initWithBaseURL:nil sessionConfiguration:configuration];
+}
+
+- (instancetype)initWithBaseURL:(NSURL *)url
+           sessionConfiguration:(NSURLSessionConfiguration *)configuration
+{
+    self = [super initWithSessionConfiguration:configuration];
+    if (!self) {
+        return nil;
+    }
+
+    // Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected
+    if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@"/"]) {
+        url = [url URLByAppendingPathComponent:@""];
+    }
+
+    self.baseURL = url;
+
+    self.requestSerializer = [AFHTTPRequestSerializer serializer];
+    self.responseSerializer = [AFJSONResponseSerializer serializer];
+
+    return self;
+}
+
+#pragma mark -
+
+- (void)setRequestSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
+    NSParameterAssert(requestSerializer);
+
+    _requestSerializer = requestSerializer;
+}
+
+- (void)setResponseSerializer:(AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
+    NSParameterAssert(responseSerializer);
+
+    [super setResponseSerializer:responseSerializer];
+}
+
+#pragma mark -
+
+- (NSURLSessionDataTask *)GET:(NSString *)URLString
+                   parameters:(id)parameters
+                      success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+                      failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+
+    return [self GET:URLString parameters:parameters progress:nil success:success failure:failure];
+}
+
+- (NSURLSessionDataTask *)GET:(NSString *)URLString
+                   parameters:(id)parameters
+                     progress:(void (^)(NSProgress * _Nonnull))downloadProgress
+                      success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
+                      failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
+{
+
+    NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET"
+                                                        URLString:URLString
+                                                       parameters:parameters
+                                                   uploadProgress:nil
+                                                 downloadProgress:downloadProgress
+                                                          success:success
+                                                          failure:failure];
+
+    [dataTask resume];
+
+    return dataTask;
+}
+
+- (NSURLSessionDataTask *)HEAD:(NSString *)URLString
+                    parameters:(id)parameters
+                       success:(void (^)(NSURLSessionDataTask *task))success
+                       failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+    NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) {
+        if (success) {
+            success(task);
+        }
+    } failure:failure];
+
+    [dataTask resume];
+
+    return dataTask;
+}
+
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+                    parameters:(id)parameters
+                       success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+                       failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+    return [self POST:URLString parameters:parameters progress:nil success:success failure:failure];
+}
+
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+                    parameters:(id)parameters
+                      progress:(void (^)(NSProgress * _Nonnull))uploadProgress
+                       success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
+                       failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
+{
+    NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure];
+
+    [dataTask resume];
+
+    return dataTask;
+}
+
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+                    parameters:(nullable id)parameters
+     constructingBodyWithBlock:(nullable void (^)(id<AFMultipartFormData> _Nonnull))block
+                       success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success
+                       failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure
+{
+    return [self POST:URLString parameters:parameters constructingBodyWithBlock:block progress:nil success:success failure:failure];
+}
+
+- (NSURLSessionDataTask *)POST:(NSString *)URLString
+                    parameters:(id)parameters
+     constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
+                      progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress
+                       success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+                       failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+    NSError *serializationError = nil;
+    NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError];
+    if (serializationError) {
+        if (failure) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+            dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
+                failure(nil, serializationError);
+            });
+#pragma clang diagnostic pop
+        }
+
+        return nil;
+    }
+
+    __block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:uploadProgress completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
+        if (error) {
+            if (failure) {
+                failure(task, error);
+            }
+        } else {
+            if (success) {
+                success(task, responseObject);
+            }
+        }
+    }];
+
+    [task resume];
+
+    return task;
+}
+
+- (NSURLSessionDataTask *)PUT:(NSString *)URLString
+                   parameters:(id)parameters
+                      success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+                      failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+    NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure];
+
+    [dataTask resume];
+
+    return dataTask;
+}
+
+- (NSURLSessionDataTask *)PATCH:(NSString *)URLString
+                     parameters:(id)parameters
+                        success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+                        failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+    NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure];
+
+    [dataTask resume];
+
+    return dataTask;
+}
+
+- (NSURLSessionDataTask *)DELETE:(NSString *)URLString
+                      parameters:(id)parameters
+                         success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
+                         failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
+{
+    NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure];
+
+    [dataTask resume];
+
+    return dataTask;
+}
+
+- (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method
+                                       URLString:(NSString *)URLString
+                                      parameters:(id)parameters
+                                  uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress
+                                downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress
+                                         success:(void (^)(NSURLSessionDataTask *, id))success
+                                         failure:(void (^)(NSURLSessionDataTask *, NSError *))failure
+{
+    NSError *serializationError = nil;
+    NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError];
+    if (serializationError) {
+        if (failure) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+            dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
+                failure(nil, serializationError);
+            });
+#pragma clang diagnostic pop
+        }
+
+        return nil;
+    }
+
+    __block NSURLSessionDataTask *dataTask = nil;
+    dataTask = [self dataTaskWithRequest:request
+                          uploadProgress:uploadProgress
+                        downloadProgress:downloadProgress
+                       completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
+        if (error) {
+            if (failure) {
+                failure(dataTask, error);
+            }
+        } else {
+            if (success) {
+                success(dataTask, responseObject);
+            }
+        }
+    }];
+
+    return dataTask;
+}
+
+#pragma mark - NSObject
+
+- (NSString *)description {
+    return [NSString stringWithFormat:@"<%@: %p, baseURL: %@, session: %@, operationQueue: %@>", NSStringFromClass([self class]), self, [self.baseURL absoluteString], self.session, self.operationQueue];
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+    return YES;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))];
+    NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"];
+    if (!configuration) {
+        NSString *configurationIdentifier = [decoder decodeObjectOfClass:[NSString class] forKey:@"identifier"];
+        if (configurationIdentifier) {
+#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1100)
+            configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:configurationIdentifier];
+#else
+            configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:configurationIdentifier];
+#endif
+        }
+    }
+
+    self = [self initWithBaseURL:baseURL sessionConfiguration:configuration];
+    if (!self) {
+        return nil;
+    }
+
+    self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))];
+    self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))];
+    AFSecurityPolicy *decodedPolicy = [decoder decodeObjectOfClass:[AFSecurityPolicy class] forKey:NSStringFromSelector(@selector(securityPolicy))];
+    if (decodedPolicy) {
+        self.securityPolicy = decodedPolicy;
+    }
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+
+    [coder encodeObject:self.baseURL forKey:NSStringFromSelector(@selector(baseURL))];
+    if ([self.session.configuration conformsToProtocol:@protocol(NSCoding)]) {
+        [coder encodeObject:self.session.configuration forKey:@"sessionConfiguration"];
+    } else {
+        [coder encodeObject:self.session.configuration.identifier forKey:@"identifier"];
+    }
+    [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
+    [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
+    [coder encodeObject:self.securityPolicy forKey:NSStringFromSelector(@selector(securityPolicy))];
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration];
+
+    HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
+    HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
+    HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone];
+    return HTTPClient;
+}
+
+@end

+ 206 - 0
Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.h

@@ -0,0 +1,206 @@
+// AFNetworkReachabilityManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#if !TARGET_OS_WATCH
+#import <SystemConfiguration/SystemConfiguration.h>
+
+typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
+    AFNetworkReachabilityStatusUnknown          = -1,
+    AFNetworkReachabilityStatusNotReachable     = 0,
+    AFNetworkReachabilityStatusReachableViaWWAN = 1,
+    AFNetworkReachabilityStatusReachableViaWiFi = 2,
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
+
+ Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
+
+ See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ )
+
+ @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
+ */
+@interface AFNetworkReachabilityManager : NSObject
+
+/**
+ The current network reachability status.
+ */
+@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
+
+/**
+ Whether or not the network is currently reachable.
+ */
+@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable;
+
+/**
+ Whether or not the network is currently reachable via WWAN.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN;
+
+/**
+ Whether or not the network is currently reachable via WiFi.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Returns the shared network reachability manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Creates and returns a network reachability manager with the default socket address.
+ 
+ @return An initialized network reachability manager, actively monitoring the default socket address.
+ */
++ (instancetype)manager;
+
+/**
+ Creates and returns a network reachability manager for the specified domain.
+
+ @param domain The domain used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified domain.
+ */
++ (instancetype)managerForDomain:(NSString *)domain;
+
+/**
+ Creates and returns a network reachability manager for the socket address.
+
+ @param address The socket address (`sockaddr_in6`) used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified socket address.
+ */
++ (instancetype)managerForAddress:(const void *)address;
+
+/**
+ Initializes an instance of a network reachability manager from the specified reachability object.
+
+ @param reachability The reachability object to monitor.
+
+ @return An initialized network reachability manager, actively monitoring the specified reachability.
+ */
+- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
+
+///--------------------------------------------------
+/// @name Starting & Stopping Reachability Monitoring
+///--------------------------------------------------
+
+/**
+ Starts monitoring for changes in network reachability status.
+ */
+- (void)startMonitoring;
+
+/**
+ Stops monitoring for changes in network reachability status.
+ */
+- (void)stopMonitoring;
+
+///-------------------------------------------------
+/// @name Getting Localized Reachability Description
+///-------------------------------------------------
+
+/**
+ Returns a localized string representation of the current network reachability status.
+ */
+- (NSString *)localizedNetworkReachabilityStatusString;
+
+///---------------------------------------------------
+/// @name Setting Network Reachability Change Callback
+///---------------------------------------------------
+
+/**
+ Sets a callback to be executed when the network availability of the `baseURL` host changes.
+
+ @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`.
+ */
+- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Network Reachability
+
+ The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses.
+
+ enum {
+ AFNetworkReachabilityStatusUnknown,
+ AFNetworkReachabilityStatusNotReachable,
+ AFNetworkReachabilityStatusReachableViaWWAN,
+ AFNetworkReachabilityStatusReachableViaWiFi,
+ }
+
+ `AFNetworkReachabilityStatusUnknown`
+ The `baseURL` host reachability is not known.
+
+ `AFNetworkReachabilityStatusNotReachable`
+ The `baseURL` host cannot be reached.
+
+ `AFNetworkReachabilityStatusReachableViaWWAN`
+ The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS.
+
+ `AFNetworkReachabilityStatusReachableViaWiFi`
+ The `baseURL` host can be reached via a Wi-Fi connection.
+
+ ### Keys for Notification UserInfo Dictionary
+
+ Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification.
+
+ `AFNetworkingReachabilityNotificationStatusItem`
+ A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification.
+ The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status.
+ */
+
+///--------------------
+/// @name Notifications
+///--------------------
+
+/**
+ Posted when network reachability changes.
+ This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability.
+
+ @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import <SystemConfiguration/SystemConfiguration.h>` to the header prefix of the project (`Prefix.pch`).
+ */
+FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification;
+FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem;
+
+///--------------------
+/// @name Functions
+///--------------------
+
+/**
+ Returns a localized string representation of an `AFNetworkReachabilityStatus` value.
+ */
+FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);
+
+NS_ASSUME_NONNULL_END
+#endif

+ 263 - 0
Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m

@@ -0,0 +1,263 @@
+// AFNetworkReachabilityManager.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "AFNetworkReachabilityManager.h"
+#if !TARGET_OS_WATCH
+
+#import <netinet/in.h>
+#import <netinet6/in6.h>
+#import <arpa/inet.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+
+NSString * const AFNetworkingReachabilityDidChangeNotification = @"com.alamofire.networking.reachability.change";
+NSString * const AFNetworkingReachabilityNotificationStatusItem = @"AFNetworkingReachabilityNotificationStatusItem";
+
+typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status);
+
+NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) {
+    switch (status) {
+        case AFNetworkReachabilityStatusNotReachable:
+            return NSLocalizedStringFromTable(@"Not Reachable", @"AFNetworking", nil);
+        case AFNetworkReachabilityStatusReachableViaWWAN:
+            return NSLocalizedStringFromTable(@"Reachable via WWAN", @"AFNetworking", nil);
+        case AFNetworkReachabilityStatusReachableViaWiFi:
+            return NSLocalizedStringFromTable(@"Reachable via WiFi", @"AFNetworking", nil);
+        case AFNetworkReachabilityStatusUnknown:
+        default:
+            return NSLocalizedStringFromTable(@"Unknown", @"AFNetworking", nil);
+    }
+}
+
+static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetworkReachabilityFlags flags) {
+    BOOL isReachable = ((flags & kSCNetworkReachabilityFlagsReachable) != 0);
+    BOOL needsConnection = ((flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0);
+    BOOL canConnectionAutomatically = (((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || ((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0));
+    BOOL canConnectWithoutUserInteraction = (canConnectionAutomatically && (flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0);
+    BOOL isNetworkReachable = (isReachable && (!needsConnection || canConnectWithoutUserInteraction));
+
+    AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusUnknown;
+    if (isNetworkReachable == NO) {
+        status = AFNetworkReachabilityStatusNotReachable;
+    }
+#if	TARGET_OS_IPHONE
+    else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) {
+        status = AFNetworkReachabilityStatusReachableViaWWAN;
+    }
+#endif
+    else {
+        status = AFNetworkReachabilityStatusReachableViaWiFi;
+    }
+
+    return status;
+}
+
+/**
+ * Queue a status change notification for the main thread.
+ *
+ * This is done to ensure that the notifications are received in the same order
+ * as they are sent. If notifications are sent directly, it is possible that
+ * a queued notification (for an earlier status condition) is processed after
+ * the later update, resulting in the listener being left in the wrong state.
+ */
+static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block) {
+    AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
+    dispatch_async(dispatch_get_main_queue(), ^{
+        if (block) {
+            block(status);
+        }
+        NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+        NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) };
+        [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo];
+    });
+}
+
+static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
+    AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info);
+}
+
+
+static const void * AFNetworkReachabilityRetainCallback(const void *info) {
+    return Block_copy(info);
+}
+
+static void AFNetworkReachabilityReleaseCallback(const void *info) {
+    if (info) {
+        Block_release(info);
+    }
+}
+
+@interface AFNetworkReachabilityManager ()
+@property (readonly, nonatomic, assign) SCNetworkReachabilityRef networkReachability;
+@property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
+@property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock;
+@end
+
+@implementation AFNetworkReachabilityManager
+
++ (instancetype)sharedManager {
+    static AFNetworkReachabilityManager *_sharedManager = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        _sharedManager = [self manager];
+    });
+
+    return _sharedManager;
+}
+
++ (instancetype)managerForDomain:(NSString *)domain {
+    SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]);
+
+    AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
+    
+    CFRelease(reachability);
+
+    return manager;
+}
+
++ (instancetype)managerForAddress:(const void *)address {
+    SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address);
+    AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
+
+    CFRelease(reachability);
+    
+    return manager;
+}
+
++ (instancetype)manager
+{
+#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
+    struct sockaddr_in6 address;
+    bzero(&address, sizeof(address));
+    address.sin6_len = sizeof(address);
+    address.sin6_family = AF_INET6;
+#else
+    struct sockaddr_in address;
+    bzero(&address, sizeof(address));
+    address.sin_len = sizeof(address);
+    address.sin_family = AF_INET;
+#endif
+    return [self managerForAddress:&address];
+}
+
+- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    _networkReachability = CFRetain(reachability);
+    self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
+
+    return self;
+}
+
+- (instancetype)init NS_UNAVAILABLE
+{
+    return nil;
+}
+
+- (void)dealloc {
+    [self stopMonitoring];
+    
+    if (_networkReachability != NULL) {
+        CFRelease(_networkReachability);
+    }
+}
+
+#pragma mark -
+
+- (BOOL)isReachable {
+    return [self isReachableViaWWAN] || [self isReachableViaWiFi];
+}
+
+- (BOOL)isReachableViaWWAN {
+    return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN;
+}
+
+- (BOOL)isReachableViaWiFi {
+    return self.networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWiFi;
+}
+
+#pragma mark -
+
+- (void)startMonitoring {
+    [self stopMonitoring];
+
+    if (!self.networkReachability) {
+        return;
+    }
+
+    __weak __typeof(self)weakSelf = self;
+    AFNetworkReachabilityStatusBlock callback = ^(AFNetworkReachabilityStatus status) {
+        __strong __typeof(weakSelf)strongSelf = weakSelf;
+
+        strongSelf.networkReachabilityStatus = status;
+        if (strongSelf.networkReachabilityStatusBlock) {
+            strongSelf.networkReachabilityStatusBlock(status);
+        }
+
+    };
+
+    SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};
+    SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context);
+    SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
+
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{
+        SCNetworkReachabilityFlags flags;
+        if (SCNetworkReachabilityGetFlags(self.networkReachability, &flags)) {
+            AFPostReachabilityStatusChange(flags, callback);
+        }
+    });
+}
+
+- (void)stopMonitoring {
+    if (!self.networkReachability) {
+        return;
+    }
+
+    SCNetworkReachabilityUnscheduleFromRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
+}
+
+#pragma mark -
+
+- (NSString *)localizedNetworkReachabilityStatusString {
+    return AFStringFromNetworkReachabilityStatus(self.networkReachabilityStatus);
+}
+
+#pragma mark -
+
+- (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block {
+    self.networkReachabilityStatusBlock = block;
+}
+
+#pragma mark - NSKeyValueObserving
+
++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
+    if ([key isEqualToString:@"reachable"] || [key isEqualToString:@"reachableViaWWAN"] || [key isEqualToString:@"reachableViaWiFi"]) {
+        return [NSSet setWithObject:@"networkReachabilityStatus"];
+    }
+
+    return [super keyPathsForValuesAffectingValueForKey:key];
+}
+
+@end
+#endif

+ 41 - 0
Pods/AFNetworking/AFNetworking/AFNetworking.h

@@ -0,0 +1,41 @@
+// AFNetworking.h
+//
+// Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#import <Availability.h>
+#import <TargetConditionals.h>
+
+#ifndef _AFNETWORKING_
+    #define _AFNETWORKING_
+
+    #import "AFURLRequestSerialization.h"
+    #import "AFURLResponseSerialization.h"
+    #import "AFSecurityPolicy.h"
+
+#if !TARGET_OS_WATCH
+    #import "AFNetworkReachabilityManager.h"
+#endif
+
+    #import "AFURLSessionManager.h"
+    #import "AFHTTPSessionManager.h"
+
+#endif /* _AFNETWORKING_ */

+ 154 - 0
Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h

@@ -0,0 +1,154 @@
+// AFSecurityPolicy.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#import <Security/Security.h>
+
+typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
+    AFSSLPinningModeNone,
+    AFSSLPinningModePublicKey,
+    AFSSLPinningModeCertificate,
+};
+
+/**
+ `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
+
+ Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
+ */
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AFSecurityPolicy : NSObject <NSSecureCoding, NSCopying>
+
+/**
+ The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
+ */
+@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
+
+/**
+ The certificates used to evaluate server trust according to the SSL pinning mode. 
+
+  By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`.
+ 
+ Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
+ */
+@property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates;
+
+/**
+ Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
+ */
+@property (nonatomic, assign) BOOL allowInvalidCertificates;
+
+/**
+ Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`.
+ */
+@property (nonatomic, assign) BOOL validatesDomainName;
+
+///-----------------------------------------
+/// @name Getting Certificates from the Bundle
+///-----------------------------------------
+
+/**
+ Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
+
+ @return The certificates included in the given bundle.
+ */
++ (NSSet <NSData *> *)certificatesInBundle:(NSBundle *)bundle;
+
+///-----------------------------------------
+/// @name Getting Specific Security Policies
+///-----------------------------------------
+
+/**
+ Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys.
+
+ @return The default security policy.
+ */
++ (instancetype)defaultPolicy;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns a security policy with the specified pinning mode.
+
+ @param pinningMode The SSL pinning mode.
+
+ @return A new security policy.
+ */
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
+
+/**
+ Creates and returns a security policy with the specified pinning mode.
+
+ @param pinningMode The SSL pinning mode.
+ @param pinnedCertificates The certificates to pin against.
+
+ @return A new security policy.
+ */
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
+
+///------------------------------
+/// @name Evaluating Server Trust
+///------------------------------
+
+/**
+ Whether or not the specified server trust should be accepted, based on the security policy.
+
+ This method should be used when responding to an authentication challenge from a server.
+
+ @param serverTrust The X.509 certificate trust of the server.
+ @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
+
+ @return Whether or not to trust the server.
+ */
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
+                  forDomain:(nullable NSString *)domain;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## SSL Pinning Modes
+
+ The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes.
+
+ enum {
+ AFSSLPinningModeNone,
+ AFSSLPinningModePublicKey,
+ AFSSLPinningModeCertificate,
+ }
+
+ `AFSSLPinningModeNone`
+ Do not used pinned certificates to validate servers.
+
+ `AFSSLPinningModePublicKey`
+ Validate host certificates against public keys of pinned certificates.
+
+ `AFSSLPinningModeCertificate`
+ Validate host certificates against pinned certificates.
+*/

+ 353 - 0
Pods/AFNetworking/AFNetworking/AFSecurityPolicy.m

@@ -0,0 +1,353 @@
+// AFSecurityPolicy.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "AFSecurityPolicy.h"
+
+#import <AssertMacros.h>
+
+#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV
+static NSData * AFSecKeyGetData(SecKeyRef key) {
+    CFDataRef data = NULL;
+
+    __Require_noErr_Quiet(SecItemExport(key, kSecFormatUnknown, kSecItemPemArmour, NULL, &data), _out);
+
+    return (__bridge_transfer NSData *)data;
+
+_out:
+    if (data) {
+        CFRelease(data);
+    }
+
+    return nil;
+}
+#endif
+
+static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
+#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
+    return [(__bridge id)key1 isEqual:(__bridge id)key2];
+#else
+    return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)];
+#endif
+}
+
+static id AFPublicKeyForCertificate(NSData *certificate) {
+    id allowedPublicKey = nil;
+    SecCertificateRef allowedCertificate;
+    SecCertificateRef allowedCertificates[1];
+    CFArrayRef tempCertificates = nil;
+    SecPolicyRef policy = nil;
+    SecTrustRef allowedTrust = nil;
+    SecTrustResultType result;
+
+    allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate);
+    __Require_Quiet(allowedCertificate != NULL, _out);
+
+    allowedCertificates[0] = allowedCertificate;
+    tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
+
+    policy = SecPolicyCreateBasicX509();
+    __Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out);
+    __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out);
+
+    allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust);
+
+_out:
+    if (allowedTrust) {
+        CFRelease(allowedTrust);
+    }
+
+    if (policy) {
+        CFRelease(policy);
+    }
+
+    if (tempCertificates) {
+        CFRelease(tempCertificates);
+    }
+
+    if (allowedCertificate) {
+        CFRelease(allowedCertificate);
+    }
+
+    return allowedPublicKey;
+}
+
+static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) {
+    BOOL isValid = NO;
+    SecTrustResultType result;
+    __Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out);
+
+    isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed);
+
+_out:
+    return isValid;
+}
+
+static NSArray * AFCertificateTrustChainForServerTrust(SecTrustRef serverTrust) {
+    CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
+    NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
+
+    for (CFIndex i = 0; i < certificateCount; i++) {
+        SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
+        [trustChain addObject:(__bridge_transfer NSData *)SecCertificateCopyData(certificate)];
+    }
+
+    return [NSArray arrayWithArray:trustChain];
+}
+
+static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
+    SecPolicyRef policy = SecPolicyCreateBasicX509();
+    CFIndex certificateCount = SecTrustGetCertificateCount(serverTrust);
+    NSMutableArray *trustChain = [NSMutableArray arrayWithCapacity:(NSUInteger)certificateCount];
+    for (CFIndex i = 0; i < certificateCount; i++) {
+        SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, i);
+
+        SecCertificateRef someCertificates[] = {certificate};
+        CFArrayRef certificates = CFArrayCreate(NULL, (const void **)someCertificates, 1, NULL);
+
+        SecTrustRef trust;
+        __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out);
+
+        SecTrustResultType result;
+        __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out);
+
+        [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)];
+
+    _out:
+        if (trust) {
+            CFRelease(trust);
+        }
+
+        if (certificates) {
+            CFRelease(certificates);
+        }
+
+        continue;
+    }
+    CFRelease(policy);
+
+    return [NSArray arrayWithArray:trustChain];
+}
+
+#pragma mark -
+
+@interface AFSecurityPolicy()
+@property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
+@property (readwrite, nonatomic, strong) NSSet *pinnedPublicKeys;
+@end
+
+@implementation AFSecurityPolicy
+
++ (NSSet *)certificatesInBundle:(NSBundle *)bundle {
+    NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."];
+
+    NSMutableSet *certificates = [NSMutableSet setWithCapacity:[paths count]];
+    for (NSString *path in paths) {
+        NSData *certificateData = [NSData dataWithContentsOfFile:path];
+        [certificates addObject:certificateData];
+    }
+
+    return [NSSet setWithSet:certificates];
+}
+
++ (NSSet *)defaultPinnedCertificates {
+    static NSSet *_defaultPinnedCertificates = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        NSBundle *bundle = [NSBundle bundleForClass:[self class]];
+        _defaultPinnedCertificates = [self certificatesInBundle:bundle];
+    });
+
+    return _defaultPinnedCertificates;
+}
+
++ (instancetype)defaultPolicy {
+    AFSecurityPolicy *securityPolicy = [[self alloc] init];
+    securityPolicy.SSLPinningMode = AFSSLPinningModeNone;
+
+    return securityPolicy;
+}
+
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode {
+    return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]];
+}
+
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates {
+    AFSecurityPolicy *securityPolicy = [[self alloc] init];
+    securityPolicy.SSLPinningMode = pinningMode;
+
+    [securityPolicy setPinnedCertificates:pinnedCertificates];
+
+    return securityPolicy;
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    self.validatesDomainName = YES;
+
+    return self;
+}
+
+- (void)setPinnedCertificates:(NSSet *)pinnedCertificates {
+    _pinnedCertificates = pinnedCertificates;
+
+    if (self.pinnedCertificates) {
+        NSMutableSet *mutablePinnedPublicKeys = [NSMutableSet setWithCapacity:[self.pinnedCertificates count]];
+        for (NSData *certificate in self.pinnedCertificates) {
+            id publicKey = AFPublicKeyForCertificate(certificate);
+            if (!publicKey) {
+                continue;
+            }
+            [mutablePinnedPublicKeys addObject:publicKey];
+        }
+        self.pinnedPublicKeys = [NSSet setWithSet:mutablePinnedPublicKeys];
+    } else {
+        self.pinnedPublicKeys = nil;
+    }
+}
+
+#pragma mark -
+
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
+                  forDomain:(NSString *)domain
+{
+    if (domain && self.allowInvalidCertificates && self.validatesDomainName && (self.SSLPinningMode == AFSSLPinningModeNone || [self.pinnedCertificates count] == 0)) {
+        // https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/OverridingSSLChainValidationCorrectly.html
+        //  According to the docs, you should only trust your provided certs for evaluation.
+        //  Pinned certificates are added to the trust. Without pinned certificates,
+        //  there is nothing to evaluate against.
+        //
+        //  From Apple Docs:
+        //          "Do not implicitly trust self-signed certificates as anchors (kSecTrustOptionImplicitAnchors).
+        //           Instead, add your own (self-signed) CA certificate to the list of trusted anchors."
+        NSLog(@"In order to validate a domain name for self signed certificates, you MUST use pinning.");
+        return NO;
+    }
+
+    NSMutableArray *policies = [NSMutableArray array];
+    if (self.validatesDomainName) {
+        [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)];
+    } else {
+        [policies addObject:(__bridge_transfer id)SecPolicyCreateBasicX509()];
+    }
+
+    SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies);
+
+    if (self.SSLPinningMode == AFSSLPinningModeNone) {
+        return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust);
+    } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) {
+        return NO;
+    }
+
+    switch (self.SSLPinningMode) {
+        case AFSSLPinningModeNone:
+        default:
+            return NO;
+        case AFSSLPinningModeCertificate: {
+            NSMutableArray *pinnedCertificates = [NSMutableArray array];
+            for (NSData *certificateData in self.pinnedCertificates) {
+                [pinnedCertificates addObject:(__bridge_transfer id)SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificateData)];
+            }
+            SecTrustSetAnchorCertificates(serverTrust, (__bridge CFArrayRef)pinnedCertificates);
+
+            if (!AFServerTrustIsValid(serverTrust)) {
+                return NO;
+            }
+
+            // obtain the chain after being validated, which *should* contain the pinned certificate in the last position (if it's the Root CA)
+            NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);
+            
+            for (NSData *trustChainCertificate in [serverCertificates reverseObjectEnumerator]) {
+                if ([self.pinnedCertificates containsObject:trustChainCertificate]) {
+                    return YES;
+                }
+            }
+            
+            return NO;
+        }
+        case AFSSLPinningModePublicKey: {
+            NSUInteger trustedPublicKeyCount = 0;
+            NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust);
+
+            for (id trustChainPublicKey in publicKeys) {
+                for (id pinnedPublicKey in self.pinnedPublicKeys) {
+                    if (AFSecKeyIsEqualToKey((__bridge SecKeyRef)trustChainPublicKey, (__bridge SecKeyRef)pinnedPublicKey)) {
+                        trustedPublicKeyCount += 1;
+                    }
+                }
+            }
+            return trustedPublicKeyCount > 0;
+        }
+    }
+    
+    return NO;
+}
+
+#pragma mark - NSKeyValueObserving
+
++ (NSSet *)keyPathsForValuesAffectingPinnedPublicKeys {
+    return [NSSet setWithObject:@"pinnedCertificates"];
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+    return YES;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+
+    self = [self init];
+    if (!self) {
+        return nil;
+    }
+
+    self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue];
+    self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
+    self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))];
+    self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))];
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [coder encodeObject:[NSNumber numberWithUnsignedInteger:self.SSLPinningMode] forKey:NSStringFromSelector(@selector(SSLPinningMode))];
+    [coder encodeBool:self.allowInvalidCertificates forKey:NSStringFromSelector(@selector(allowInvalidCertificates))];
+    [coder encodeBool:self.validatesDomainName forKey:NSStringFromSelector(@selector(validatesDomainName))];
+    [coder encodeObject:self.pinnedCertificates forKey:NSStringFromSelector(@selector(pinnedCertificates))];
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFSecurityPolicy *securityPolicy = [[[self class] allocWithZone:zone] init];
+    securityPolicy.SSLPinningMode = self.SSLPinningMode;
+    securityPolicy.allowInvalidCertificates = self.allowInvalidCertificates;
+    securityPolicy.validatesDomainName = self.validatesDomainName;
+    securityPolicy.pinnedCertificates = [self.pinnedCertificates copyWithZone:zone];
+
+    return securityPolicy;
+}
+
+@end

File diff suppressed because it is too large
+ 479 - 0
Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.h


File diff suppressed because it is too large
+ 1376 - 0
Pods/AFNetworking/AFNetworking/AFURLRequestSerialization.m


+ 311 - 0
Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.h

@@ -0,0 +1,311 @@
+// AFURLResponseSerialization.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#import <CoreGraphics/CoreGraphics.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
+
+ For example, a JSON response serializer may check for an acceptable status code (`2XX` range) and content type (`application/json`), decoding a valid JSON response into an object.
+ */
+@protocol AFURLResponseSerialization <NSObject, NSSecureCoding, NSCopying>
+
+/**
+ The response object decoded from the data associated with a specified response.
+
+ @param response The response to be processed.
+ @param data The response data to be decoded.
+ @param error The error that occurred while attempting to decode the response data.
+
+ @return The object decoded from the specified response data.
+ */
+- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response
+                           data:(nullable NSData *)data
+                          error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFHTTPResponseSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation.
+
+ Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPResponseSerializer` in order to ensure consistent default behavior.
+ */
+@interface AFHTTPResponseSerializer : NSObject <AFURLResponseSerialization>
+
+- (instancetype)init;
+
+/**
+ The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default.
+ */
+@property (nonatomic, assign) NSStringEncoding stringEncoding;
+
+/**
+ Creates and returns a serializer with default configuration.
+ */
++ (instancetype)serializer;
+
+///-----------------------------------------
+/// @name Configuring Response Serialization
+///-----------------------------------------
+
+/**
+ The acceptable HTTP status codes for responses. When non-`nil`, responses with status codes not contained by the set will result in an error during validation.
+
+ See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
+ */
+@property (nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes;
+
+/**
+ The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation.
+ */
+@property (nonatomic, copy, nullable) NSSet <NSString *> *acceptableContentTypes;
+
+/**
+ Validates the specified response and data.
+
+ In its base implementation, this method checks for an acceptable status code and content type. Subclasses may wish to add other domain-specific checks.
+
+ @param response The response to be validated.
+ @param data The data associated with the response.
+ @param error The error that occurred while attempting to validate the response.
+
+ @return `YES` if the response is valid, otherwise `NO`.
+ */
+- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response
+                    data:(nullable NSData *)data
+                   error:(NSError * _Nullable __autoreleasing *)error;
+
+@end
+
+#pragma mark -
+
+
+/**
+ `AFJSONResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes JSON responses.
+
+ By default, `AFJSONResponseSerializer` accepts the following MIME types, which includes the official standard, `application/json`, as well as other commonly-used types:
+
+ - `application/json`
+ - `text/json`
+ - `text/javascript`
+ */
+@interface AFJSONResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype)init;
+
+/**
+ Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
+ */
+@property (nonatomic, assign) NSJSONReadingOptions readingOptions;
+
+/**
+ Whether to remove keys with `NSNull` values from response JSON. Defaults to `NO`.
+ */
+@property (nonatomic, assign) BOOL removesKeysWithNullValues;
+
+/**
+ Creates and returns a JSON serializer with specified reading and writing options.
+
+ @param readingOptions The specified JSON reading options.
+ */
++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFXMLParserResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLParser` objects.
+
+ By default, `AFXMLParserResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types:
+
+ - `application/xml`
+ - `text/xml`
+ */
+@interface AFXMLParserResponseSerializer : AFHTTPResponseSerializer
+
+@end
+
+#pragma mark -
+
+#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+
+/**
+ `AFXMLDocumentResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects.
+
+ By default, `AFXMLDocumentResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types:
+
+ - `application/xml`
+ - `text/xml`
+ */
+@interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype)init;
+
+/**
+ Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
+ */
+@property (nonatomic, assign) NSUInteger options;
+
+/**
+ Creates and returns an XML document serializer with the specified options.
+
+ @param mask The XML document options.
+ */
++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask;
+
+@end
+
+#endif
+
+#pragma mark -
+
+/**
+ `AFPropertyListResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects.
+
+ By default, `AFPropertyListResponseSerializer` accepts the following MIME types:
+
+ - `application/x-plist`
+ */
+@interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype)init;
+
+/**
+ The property list format. Possible values are described in "NSPropertyListFormat".
+ */
+@property (nonatomic, assign) NSPropertyListFormat format;
+
+/**
+ The property list reading options. Possible values are described in "NSPropertyListMutabilityOptions."
+ */
+@property (nonatomic, assign) NSPropertyListReadOptions readOptions;
+
+/**
+ Creates and returns a property list serializer with a specified format, read options, and write options.
+
+ @param format The property list format.
+ @param readOptions The property list reading options.
+ */
++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format
+                         readOptions:(NSPropertyListReadOptions)readOptions;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFImageResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes image responses.
+
+ By default, `AFImageResponseSerializer` accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage:
+
+ - `image/tiff`
+ - `image/jpeg`
+ - `image/gif`
+ - `image/png`
+ - `image/ico`
+ - `image/x-icon`
+ - `image/bmp`
+ - `image/x-bmp`
+ - `image/x-xbitmap`
+ - `image/x-win-bitmap`
+ */
+@interface AFImageResponseSerializer : AFHTTPResponseSerializer
+
+#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+/**
+ The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance.
+ */
+@property (nonatomic, assign) CGFloat imageScale;
+
+/**
+ Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with `setCompletionBlockWithSuccess:failure:`, as it allows a bitmap representation to be constructed in the background rather than on the main thread. `YES` by default.
+ */
+@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage;
+#endif
+
+@end
+
+#pragma mark -
+
+/**
+ `AFCompoundSerializer` is a subclass of `AFHTTPResponseSerializer` that delegates the response serialization to the first `AFHTTPResponseSerializer` object that returns an object for `responseObjectForResponse:data:error:`, falling back on the default behavior of `AFHTTPResponseSerializer`. This is useful for supporting multiple potential types and structures of server responses with a single serializer.
+ */
+@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer
+
+/**
+ The component response serializers.
+ */
+@property (readonly, nonatomic, copy) NSArray <id<AFURLResponseSerialization>> *responseSerializers;
+
+/**
+ Creates and returns a compound serializer comprised of the specified response serializers.
+
+ @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`.
+ */
++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray <id<AFURLResponseSerialization>> *)responseSerializers;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Error Domains
+
+ The following error domain is predefined.
+
+ - `NSString * const AFURLResponseSerializationErrorDomain`
+
+ ### Constants
+
+ `AFURLResponseSerializationErrorDomain`
+ AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`.
+ */
+FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain;
+
+/**
+ ## User info dictionary keys
+
+ These keys may exist in the user info dictionary, in addition to those defined for NSError.
+
+ - `NSString * const AFNetworkingOperationFailingURLResponseErrorKey`
+ - `NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey`
+
+ ### Constants
+
+ `AFNetworkingOperationFailingURLResponseErrorKey`
+ The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
+
+ `AFNetworkingOperationFailingURLResponseDataErrorKey`
+ The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
+ */
+FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
+
+FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey;
+
+NS_ASSUME_NONNULL_END

+ 805 - 0
Pods/AFNetworking/AFNetworking/AFURLResponseSerialization.m

@@ -0,0 +1,805 @@
+// AFURLResponseSerialization.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "AFURLResponseSerialization.h"
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS
+#import <UIKit/UIKit.h>
+#elif TARGET_OS_WATCH
+#import <WatchKit/WatchKit.h>
+#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
+#import <Cocoa/Cocoa.h>
+#endif
+
+NSString * const AFURLResponseSerializationErrorDomain = @"com.alamofire.error.serialization.response";
+NSString * const AFNetworkingOperationFailingURLResponseErrorKey = @"com.alamofire.serialization.response.error.response";
+NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey = @"com.alamofire.serialization.response.error.data";
+
+static NSError * AFErrorWithUnderlyingError(NSError *error, NSError *underlyingError) {
+    if (!error) {
+        return underlyingError;
+    }
+
+    if (!underlyingError || error.userInfo[NSUnderlyingErrorKey]) {
+        return error;
+    }
+
+    NSMutableDictionary *mutableUserInfo = [error.userInfo mutableCopy];
+    mutableUserInfo[NSUnderlyingErrorKey] = underlyingError;
+
+    return [[NSError alloc] initWithDomain:error.domain code:error.code userInfo:mutableUserInfo];
+}
+
+static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger code, NSString *domain) {
+    if ([error.domain isEqualToString:domain] && error.code == code) {
+        return YES;
+    } else if (error.userInfo[NSUnderlyingErrorKey]) {
+        return AFErrorOrUnderlyingErrorHasCodeInDomain(error.userInfo[NSUnderlyingErrorKey], code, domain);
+    }
+
+    return NO;
+}
+
+static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) {
+    if ([JSONObject isKindOfClass:[NSArray class]]) {
+        NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]];
+        for (id value in (NSArray *)JSONObject) {
+            [mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
+        }
+
+        return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray];
+    } else if ([JSONObject isKindOfClass:[NSDictionary class]]) {
+        NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:JSONObject];
+        for (id <NSCopying> key in [(NSDictionary *)JSONObject allKeys]) {
+            id value = (NSDictionary *)JSONObject[key];
+            if (!value || [value isEqual:[NSNull null]]) {
+                [mutableDictionary removeObjectForKey:key];
+            } else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]]) {
+                mutableDictionary[key] = AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions);
+            }
+        }
+
+        return (readingOptions & NSJSONReadingMutableContainers) ? mutableDictionary : [NSDictionary dictionaryWithDictionary:mutableDictionary];
+    }
+
+    return JSONObject;
+}
+
+@implementation AFHTTPResponseSerializer
+
++ (instancetype)serializer {
+    return [[self alloc] init];
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    self.stringEncoding = NSUTF8StringEncoding;
+
+    self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)];
+    self.acceptableContentTypes = nil;
+
+    return self;
+}
+
+#pragma mark -
+
+- (BOOL)validateResponse:(NSHTTPURLResponse *)response
+                    data:(NSData *)data
+                   error:(NSError * __autoreleasing *)error
+{
+    BOOL responseIsValid = YES;
+    NSError *validationError = nil;
+
+    if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) {
+        if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] &&
+            !([response MIMEType] == nil && [data length] == 0)) {
+
+            if ([data length] > 0 && [response URL]) {
+                NSMutableDictionary *mutableUserInfo = [@{
+                                                          NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]],
+                                                          NSURLErrorFailingURLErrorKey:[response URL],
+                                                          AFNetworkingOperationFailingURLResponseErrorKey: response,
+                                                        } mutableCopy];
+                if (data) {
+                    mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data;
+                }
+
+                validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:mutableUserInfo], validationError);
+            }
+
+            responseIsValid = NO;
+        }
+
+        if (self.acceptableStatusCodes && ![self.acceptableStatusCodes containsIndex:(NSUInteger)response.statusCode] && [response URL]) {
+            NSMutableDictionary *mutableUserInfo = [@{
+                                               NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: %@ (%ld)", @"AFNetworking", nil), [NSHTTPURLResponse localizedStringForStatusCode:response.statusCode], (long)response.statusCode],
+                                               NSURLErrorFailingURLErrorKey:[response URL],
+                                               AFNetworkingOperationFailingURLResponseErrorKey: response,
+                                       } mutableCopy];
+
+            if (data) {
+                mutableUserInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] = data;
+            }
+
+            validationError = AFErrorWithUnderlyingError([NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorBadServerResponse userInfo:mutableUserInfo], validationError);
+
+            responseIsValid = NO;
+        }
+    }
+
+    if (error && !responseIsValid) {
+        *error = validationError;
+    }
+
+    return responseIsValid;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+                           data:(NSData *)data
+                          error:(NSError *__autoreleasing *)error
+{
+    [self validateResponse:(NSHTTPURLResponse *)response data:data error:error];
+
+    return data;
+}
+
+#pragma mark - NSSecureCoding
+
++ (BOOL)supportsSecureCoding {
+    return YES;
+}
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    self = [self init];
+    if (!self) {
+        return nil;
+    }
+
+    self.acceptableStatusCodes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
+    self.acceptableContentTypes = [decoder decodeObjectOfClass:[NSIndexSet class] forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [coder encodeObject:self.acceptableStatusCodes forKey:NSStringFromSelector(@selector(acceptableStatusCodes))];
+    [coder encodeObject:self.acceptableContentTypes forKey:NSStringFromSelector(@selector(acceptableContentTypes))];
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+    serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone];
+    serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone];
+
+    return serializer;
+}
+
+@end
+
+#pragma mark -
+
+@implementation AFJSONResponseSerializer
+
++ (instancetype)serializer {
+    return [self serializerWithReadingOptions:(NSJSONReadingOptions)0];
+}
+
++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions {
+    AFJSONResponseSerializer *serializer = [[self alloc] init];
+    serializer.readingOptions = readingOptions;
+
+    return serializer;
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];
+
+    return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+                           data:(NSData *)data
+                          error:(NSError *__autoreleasing *)error
+{
+    if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+        if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+            return nil;
+        }
+    }
+
+    id responseObject = nil;
+    NSError *serializationError = nil;
+    // Workaround for behavior of Rails to return a single space for `head :ok` (a workaround for a bug in Safari), which is not interpreted as valid input by NSJSONSerialization.
+    // See https://github.com/rails/rails/issues/1742
+    BOOL isSpace = [data isEqualToData:[NSData dataWithBytes:" " length:1]];
+    if (data.length > 0 && !isSpace) {
+        responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
+    } else {
+        return nil;
+    }
+
+    if (self.removesKeysWithNullValues && responseObject) {
+        responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
+    }
+
+    if (error) {
+        *error = AFErrorWithUnderlyingError(serializationError, *error);
+    }
+
+    return responseObject;
+}
+
+#pragma mark - NSSecureCoding
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    self = [super initWithCoder:decoder];
+    if (!self) {
+        return nil;
+    }
+
+    self.readingOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readingOptions))] unsignedIntegerValue];
+    self.removesKeysWithNullValues = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))] boolValue];
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+
+    [coder encodeObject:@(self.readingOptions) forKey:NSStringFromSelector(@selector(readingOptions))];
+    [coder encodeObject:@(self.removesKeysWithNullValues) forKey:NSStringFromSelector(@selector(removesKeysWithNullValues))];
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFJSONResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+    serializer.readingOptions = self.readingOptions;
+    serializer.removesKeysWithNullValues = self.removesKeysWithNullValues;
+
+    return serializer;
+}
+
+@end
+
+#pragma mark -
+
+@implementation AFXMLParserResponseSerializer
+
++ (instancetype)serializer {
+    AFXMLParserResponseSerializer *serializer = [[self alloc] init];
+
+    return serializer;
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil];
+
+    return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSHTTPURLResponse *)response
+                           data:(NSData *)data
+                          error:(NSError *__autoreleasing *)error
+{
+    if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+        if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+            return nil;
+        }
+    }
+
+    return [[NSXMLParser alloc] initWithData:data];
+}
+
+@end
+
+#pragma mark -
+
+#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+
+@implementation AFXMLDocumentResponseSerializer
+
++ (instancetype)serializer {
+    return [self serializerWithXMLDocumentOptions:0];
+}
+
++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask {
+    AFXMLDocumentResponseSerializer *serializer = [[self alloc] init];
+    serializer.options = mask;
+
+    return serializer;
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/xml", @"text/xml", nil];
+
+    return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+                           data:(NSData *)data
+                          error:(NSError *__autoreleasing *)error
+{
+    if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+        if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+            return nil;
+        }
+    }
+
+    NSError *serializationError = nil;
+    NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError];
+
+    if (error) {
+        *error = AFErrorWithUnderlyingError(serializationError, *error);
+    }
+
+    return document;
+}
+
+#pragma mark - NSSecureCoding
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    self = [super initWithCoder:decoder];
+    if (!self) {
+        return nil;
+    }
+
+    self.options = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(options))] unsignedIntegerValue];
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+
+    [coder encodeObject:@(self.options) forKey:NSStringFromSelector(@selector(options))];
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFXMLDocumentResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+    serializer.options = self.options;
+
+    return serializer;
+}
+
+@end
+
+#endif
+
+#pragma mark -
+
+@implementation AFPropertyListResponseSerializer
+
++ (instancetype)serializer {
+    return [self serializerWithFormat:NSPropertyListXMLFormat_v1_0 readOptions:0];
+}
+
++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format
+                         readOptions:(NSPropertyListReadOptions)readOptions
+{
+    AFPropertyListResponseSerializer *serializer = [[self alloc] init];
+    serializer.format = format;
+    serializer.readOptions = readOptions;
+
+    return serializer;
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"application/x-plist", nil];
+
+    return self;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+                           data:(NSData *)data
+                          error:(NSError *__autoreleasing *)error
+{
+    if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+        if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+            return nil;
+        }
+    }
+
+    id responseObject;
+    NSError *serializationError = nil;
+
+    if (data) {
+        responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];
+    }
+
+    if (error) {
+        *error = AFErrorWithUnderlyingError(serializationError, *error);
+    }
+
+    return responseObject;
+}
+
+#pragma mark - NSSecureCoding
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    self = [super initWithCoder:decoder];
+    if (!self) {
+        return nil;
+    }
+
+    self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
+    self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue];
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+
+    [coder encodeObject:@(self.format) forKey:NSStringFromSelector(@selector(format))];
+    [coder encodeObject:@(self.readOptions) forKey:NSStringFromSelector(@selector(readOptions))];
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+    serializer.format = self.format;
+    serializer.readOptions = self.readOptions;
+
+    return serializer;
+}
+
+@end
+
+#pragma mark -
+
+#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+#import <CoreGraphics/CoreGraphics.h>
+#import <UIKit/UIKit.h>
+
+@interface UIImage (AFNetworkingSafeImageLoading)
++ (UIImage *)af_safeImageWithData:(NSData *)data;
+@end
+
+static NSLock* imageLock = nil;
+
+@implementation UIImage (AFNetworkingSafeImageLoading)
+
++ (UIImage *)af_safeImageWithData:(NSData *)data {
+    UIImage* image = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        imageLock = [[NSLock alloc] init];
+    });
+    
+    [imageLock lock];
+    image = [UIImage imageWithData:data];
+    [imageLock unlock];
+    return image;
+}
+
+@end
+
+static UIImage * AFImageWithDataAtScale(NSData *data, CGFloat scale) {
+    UIImage *image = [UIImage af_safeImageWithData:data];
+    if (image.images) {
+        return image;
+    }
+    
+    return [[UIImage alloc] initWithCGImage:[image CGImage] scale:scale orientation:image.imageOrientation];
+}
+
+static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *response, NSData *data, CGFloat scale) {
+    if (!data || [data length] == 0) {
+        return nil;
+    }
+
+    CGImageRef imageRef = NULL;
+    CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData((__bridge CFDataRef)data);
+
+    if ([response.MIMEType isEqualToString:@"image/png"]) {
+        imageRef = CGImageCreateWithPNGDataProvider(dataProvider,  NULL, true, kCGRenderingIntentDefault);
+    } else if ([response.MIMEType isEqualToString:@"image/jpeg"]) {
+        imageRef = CGImageCreateWithJPEGDataProvider(dataProvider, NULL, true, kCGRenderingIntentDefault);
+
+        if (imageRef) {
+            CGColorSpaceRef imageColorSpace = CGImageGetColorSpace(imageRef);
+            CGColorSpaceModel imageColorSpaceModel = CGColorSpaceGetModel(imageColorSpace);
+
+            // CGImageCreateWithJPEGDataProvider does not properly handle CMKY, so fall back to AFImageWithDataAtScale
+            if (imageColorSpaceModel == kCGColorSpaceModelCMYK) {
+                CGImageRelease(imageRef);
+                imageRef = NULL;
+            }
+        }
+    }
+
+    CGDataProviderRelease(dataProvider);
+
+    UIImage *image = AFImageWithDataAtScale(data, scale);
+    if (!imageRef) {
+        if (image.images || !image) {
+            return image;
+        }
+
+        imageRef = CGImageCreateCopy([image CGImage]);
+        if (!imageRef) {
+            return nil;
+        }
+    }
+
+    size_t width = CGImageGetWidth(imageRef);
+    size_t height = CGImageGetHeight(imageRef);
+    size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);
+
+    if (width * height > 1024 * 1024 || bitsPerComponent > 8) {
+        CGImageRelease(imageRef);
+
+        return image;
+    }
+
+    // CGImageGetBytesPerRow() calculates incorrectly in iOS 5.0, so defer to CGBitmapContextCreate
+    size_t bytesPerRow = 0;
+    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+    CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(colorSpace);
+    CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
+
+    if (colorSpaceModel == kCGColorSpaceModelRGB) {
+        uint32_t alpha = (bitmapInfo & kCGBitmapAlphaInfoMask);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wassign-enum"
+        if (alpha == kCGImageAlphaNone) {
+            bitmapInfo &= ~kCGBitmapAlphaInfoMask;
+            bitmapInfo |= kCGImageAlphaNoneSkipFirst;
+        } else if (!(alpha == kCGImageAlphaNoneSkipFirst || alpha == kCGImageAlphaNoneSkipLast)) {
+            bitmapInfo &= ~kCGBitmapAlphaInfoMask;
+            bitmapInfo |= kCGImageAlphaPremultipliedFirst;
+        }
+#pragma clang diagnostic pop
+    }
+
+    CGContextRef context = CGBitmapContextCreate(NULL, width, height, bitsPerComponent, bytesPerRow, colorSpace, bitmapInfo);
+
+    CGColorSpaceRelease(colorSpace);
+
+    if (!context) {
+        CGImageRelease(imageRef);
+
+        return image;
+    }
+
+    CGContextDrawImage(context, CGRectMake(0.0f, 0.0f, width, height), imageRef);
+    CGImageRef inflatedImageRef = CGBitmapContextCreateImage(context);
+
+    CGContextRelease(context);
+
+    UIImage *inflatedImage = [[UIImage alloc] initWithCGImage:inflatedImageRef scale:scale orientation:image.imageOrientation];
+
+    CGImageRelease(inflatedImageRef);
+    CGImageRelease(imageRef);
+
+    return inflatedImage;
+}
+#endif
+
+
+@implementation AFImageResponseSerializer
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+
+    self.acceptableContentTypes = [[NSSet alloc] initWithObjects:@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap", nil];
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+    self.imageScale = [[UIScreen mainScreen] scale];
+    self.automaticallyInflatesResponseImage = YES;
+#elif TARGET_OS_WATCH
+    self.imageScale = [[WKInterfaceDevice currentDevice] screenScale];
+    self.automaticallyInflatesResponseImage = YES;
+#endif
+
+    return self;
+}
+
+#pragma mark - AFURLResponseSerializer
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+                           data:(NSData *)data
+                          error:(NSError *__autoreleasing *)error
+{
+    if (![self validateResponse:(NSHTTPURLResponse *)response data:data error:error]) {
+        if (!error || AFErrorOrUnderlyingErrorHasCodeInDomain(*error, NSURLErrorCannotDecodeContentData, AFURLResponseSerializationErrorDomain)) {
+            return nil;
+        }
+    }
+
+#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+    if (self.automaticallyInflatesResponseImage) {
+        return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale);
+    } else {
+        return AFImageWithDataAtScale(data, self.imageScale);
+    }
+#else
+    // Ensure that the image is set to it's correct pixel width and height
+    NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data];
+    NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])];
+    [image addRepresentation:bitimage];
+
+    return image;
+#endif
+
+    return nil;
+}
+
+#pragma mark - NSSecureCoding
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    self = [super initWithCoder:decoder];
+    if (!self) {
+        return nil;
+    }
+
+#if TARGET_OS_IOS  || TARGET_OS_TV || TARGET_OS_WATCH
+    NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))];
+#if CGFLOAT_IS_DOUBLE
+    self.imageScale = [imageScale doubleValue];
+#else
+    self.imageScale = [imageScale floatValue];
+#endif
+
+    self.automaticallyInflatesResponseImage = [decoder decodeBoolForKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
+#endif
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+
+#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+    [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))];
+    [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
+#endif
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+
+#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+    serializer.imageScale = self.imageScale;
+    serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage;
+#endif
+
+    return serializer;
+}
+
+@end
+
+#pragma mark -
+
+@interface AFCompoundResponseSerializer ()
+@property (readwrite, nonatomic, copy) NSArray *responseSerializers;
+@end
+
+@implementation AFCompoundResponseSerializer
+
++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers {
+    AFCompoundResponseSerializer *serializer = [[self alloc] init];
+    serializer.responseSerializers = responseSerializers;
+
+    return serializer;
+}
+
+#pragma mark - AFURLResponseSerialization
+
+- (id)responseObjectForResponse:(NSURLResponse *)response
+                           data:(NSData *)data
+                          error:(NSError *__autoreleasing *)error
+{
+    for (id <AFURLResponseSerialization> serializer in self.responseSerializers) {
+        if (![serializer isKindOfClass:[AFHTTPResponseSerializer class]]) {
+            continue;
+        }
+
+        NSError *serializerError = nil;
+        id responseObject = [serializer responseObjectForResponse:response data:data error:&serializerError];
+        if (responseObject) {
+            if (error) {
+                *error = AFErrorWithUnderlyingError(serializerError, *error);
+            }
+
+            return responseObject;
+        }
+    }
+
+    return [super responseObjectForResponse:response data:data error:error];
+}
+
+#pragma mark - NSSecureCoding
+
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    self = [super initWithCoder:decoder];
+    if (!self) {
+        return nil;
+    }
+
+    self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))];
+
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+
+    [coder encodeObject:self.responseSerializers forKey:NSStringFromSelector(@selector(responseSerializers))];
+}
+
+#pragma mark - NSCopying
+
+- (instancetype)copyWithZone:(NSZone *)zone {
+    AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
+    serializer.responseSerializers = self.responseSerializers;
+
+    return serializer;
+}
+
+@end

File diff suppressed because it is too large
+ 500 - 0
Pods/AFNetworking/AFNetworking/AFURLSessionManager.h


File diff suppressed because it is too large
+ 1244 - 0
Pods/AFNetworking/AFNetworking/AFURLSessionManager.m


+ 19 - 0
Pods/AFNetworking/LICENSE

@@ -0,0 +1,19 @@
+Copyright (c) 2011–2016 Alamofire Software Foundation (http://alamofire.org/)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

+ 320 - 0
Pods/AFNetworking/README.md

@@ -0,0 +1,320 @@
+<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 uploadTaskWithRequest:request fromFile:filePath progress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
+    if (error) {
+        NSLog(@"Error: %@", error);
+    } else {
+        NSLog(@"Success: %@ %@", response, responseObject);
+    }
+}];
+[uploadTask resume];
+```
+
+#### Creating an Upload Task for a Multi-Part Request, with Progress
+
+```objective-c
+NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
+        [formData appendPartWithFileURL:[NSURL fileURLWithPath:@"file://path/to/image.jpg"] name:@"file" fileName:@"filename.jpg" mimeType:@"image/jpeg" error:nil];
+    } error:nil];
+
+AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
+
+NSURLSessionUploadTask *uploadTask;
+uploadTask = [manager
+              uploadTaskWithStreamedRequest:request
+              progress:^(NSProgress * _Nonnull uploadProgress) {
+                  // This is not called back on the main queue.
+                  // You are responsible for dispatching to the main queue for UI updates
+                  dispatch_async(dispatch_get_main_queue(), ^{
+                      //Update the progress view
+                      [progressView setProgress:uploadProgress.fractionCompleted];
+                  });
+              }
+              completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
+                  if (error) {
+                      NSLog(@"Error: %@", error);
+                  } else {
+                      NSLog(@"%@ %@", response, responseObject);
+                  }
+              }];
+
+[uploadTask resume];
+```
+
+#### Creating a Data Task
+
+```objective-c
+NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
+
+NSURL *URL = [NSURL URLWithString:@"http://httpbin.org/get"];
+NSURLRequest *request = [NSURLRequest requestWithURL:URL];
+
+NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
+    if (error) {
+        NSLog(@"Error: %@", error);
+    } else {
+        NSLog(@"%@ %@", response, responseObject);
+    }
+}];
+[dataTask resume];
+```
+
+---
+
+### Request Serialization
+
+Request serializers create requests from URL strings, encoding parameters as either a query string or HTTP body.
+
+```objective-c
+NSString *URLString = @"http://example.com";
+NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]};
+```
+
+#### Query String Parameter Encoding
+
+```objective-c
+[[AFHTTPRequestSerializer serializer] requestWithMethod:@"GET" URLString:URLString parameters:parameters error:nil];
+```
+
+    GET http://example.com?foo=bar&baz[]=1&baz[]=2&baz[]=3
+
+#### URL Form Parameter Encoding
+
+```objective-c
+[[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil];
+```
+
+    POST http://example.com/
+    Content-Type: application/x-www-form-urlencoded
+
+    foo=bar&baz[]=1&baz[]=2&baz[]=3
+
+#### JSON Parameter Encoding
+
+```objective-c
+[[AFJSONRequestSerializer serializer] requestWithMethod:@"POST" URLString:URLString parameters:parameters error:nil];
+```
+
+    POST http://example.com/
+    Content-Type: application/json
+
+    {"foo": "bar", "baz": [1,2,3]}
+
+---
+
+### Network Reachability Manager
+
+`AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
+
+* Do not use Reachability to determine if the original request should be sent.
+	* You should try to send it.
+* You can use Reachability to determine when a request should be automatically retried.
+	* Although it may still fail, a Reachability notification that the connectivity is available is a good time to retry something.
+* Network reachability is a useful tool for determining why a request might have failed.
+	* After a network request has failed, telling the user they're offline is better than giving them a more technical but accurate error, such as "request timed out."
+
+See also [WWDC 2012 session 706, "Networking Best Practices."](https://developer.apple.com/videos/play/wwdc2012-706/).
+
+#### Shared Network Reachability
+
+```objective-c
+[[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
+    NSLog(@"Reachability: %@", AFStringFromNetworkReachabilityStatus(status));
+}];
+
+[[AFNetworkReachabilityManager sharedManager] startMonitoring];
+```
+
+---
+
+### Security Policy
+
+`AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
+
+Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
+
+#### Allowing Invalid SSL Certificates
+
+```objective-c
+AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
+manager.securityPolicy.allowInvalidCertificates = YES; // not recommended for production
+```
+
+---
+
+## Unit Tests
+
+AFNetworking includes a suite of unit tests within the Tests subdirectory. These tests can be run simply be executed the test action on the platform framework you would like to test.
+
+## Credits
+
+AFNetworking is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org).
+
+AFNetworking was originally created by [Scott Raymond](https://github.com/sco/) and [Mattt Thompson](https://github.com/mattt/) in the development of [Gowalla for iPhone](http://en.wikipedia.org/wiki/Gowalla).
+
+AFNetworking's logo was designed by [Alan Defibaugh](http://www.alandefibaugh.com/).
+
+And most of all, thanks to AFNetworking's [growing list of contributors](https://github.com/AFNetworking/AFNetworking/contributors).
+
+### Security Disclosure
+
+If you believe you have identified a security vulnerability with AFNetworking, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker.
+
+## License
+
+AFNetworking is released under the MIT license. See LICENSE for details.

+ 149 - 0
Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.h

@@ -0,0 +1,149 @@
+// AFAutoPurgingImageCache.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <TargetConditionals.h>
+#import <Foundation/Foundation.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously.
+ */
+@protocol AFImageCache <NSObject>
+
+/**
+ Adds the image to the cache with the given identifier.
+
+ @param image The image to cache.
+ @param identifier The unique identifier for the image in the cache.
+ */
+- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier;
+
+/**
+ Removes the image from the cache matching the given identifier.
+
+ @param identifier The unique identifier for the image in the cache.
+
+ @return A BOOL indicating whether or not the image was removed from the cache.
+ */
+- (BOOL)removeImageWithIdentifier:(NSString *)identifier;
+
+/**
+ Removes all images from the cache.
+
+ @return A BOOL indicating whether or not all images were removed from the cache.
+ */
+- (BOOL)removeAllImages;
+
+/**
+ Returns the image in the cache associated with the given identifier.
+
+ @param identifier The unique identifier for the image in the cache.
+
+ @return An image for the matching identifier, or nil.
+ */
+- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier;
+@end
+
+
+/**
+ The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier.
+ */
+@protocol AFImageRequestCache <AFImageCache>
+
+/**
+ Adds the image to the cache using an identifier created from the request and additional identifier.
+
+ @param image The image to cache.
+ @param request The unique URL request identifing the image asset.
+ @param identifier The additional identifier to apply to the URL request to identify the image.
+ */
+- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
+
+/**
+ Removes the image from the cache using an identifier created from the request and additional identifier.
+
+ @param request The unique URL request identifing the image asset.
+ @param identifier The additional identifier to apply to the URL request to identify the image.
+ 
+ @return A BOOL indicating whether or not all images were removed from the cache.
+ */
+- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
+
+/**
+ Returns the image from the cache associated with an identifier created from the request and additional identifier.
+
+ @param request The unique URL request identifing the image asset.
+ @param identifier The additional identifier to apply to the URL request to identify the image.
+
+ @return An image for the matching request and identifier, or nil.
+ */
+- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
+
+@end
+
+/**
+ The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated.
+ */
+@interface AFAutoPurgingImageCache : NSObject <AFImageRequestCache>
+
+/**
+ The total memory capacity of the cache in bytes.
+ */
+@property (nonatomic, assign) UInt64 memoryCapacity;
+
+/**
+ The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit.
+ */
+@property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge;
+
+/**
+ The current total memory usage in bytes of all images stored within the cache.
+ */
+@property (nonatomic, assign, readonly) UInt64 memoryUsage;
+
+/**
+ Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`.
+
+ @return The new `AutoPurgingImageCache` instance.
+ */
+- (instancetype)init;
+
+/**
+ Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage
+ after purge limit.
+
+ @param memoryCapacity The total memory capacity of the cache in bytes.
+ @param preferredMemoryCapacity The preferred memory usage after purge in bytes.
+
+ @return The new `AutoPurgingImageCache` instance.
+ */
+- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif
+

+ 201 - 0
Pods/AFNetworking/UIKit+AFNetworking/AFAutoPurgingImageCache.m

@@ -0,0 +1,201 @@
+// AFAutoPurgingImageCache.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV 
+
+#import "AFAutoPurgingImageCache.h"
+
+@interface AFCachedImage : NSObject
+
+@property (nonatomic, strong) UIImage *image;
+@property (nonatomic, strong) NSString *identifier;
+@property (nonatomic, assign) UInt64 totalBytes;
+@property (nonatomic, strong) NSDate *lastAccessDate;
+@property (nonatomic, assign) UInt64 currentMemoryUsage;
+
+@end
+
+@implementation AFCachedImage
+
+-(instancetype)initWithImage:(UIImage *)image identifier:(NSString *)identifier {
+    if (self = [self init]) {
+        self.image = image;
+        self.identifier = identifier;
+
+        CGSize imageSize = CGSizeMake(image.size.width * image.scale, image.size.height * image.scale);
+        CGFloat bytesPerPixel = 4.0;
+        CGFloat bytesPerSize = imageSize.width * imageSize.height;
+        self.totalBytes = (UInt64)bytesPerPixel * (UInt64)bytesPerSize;
+        self.lastAccessDate = [NSDate date];
+    }
+    return self;
+}
+
+- (UIImage*)accessImage {
+    self.lastAccessDate = [NSDate date];
+    return self.image;
+}
+
+- (NSString *)description {
+    NSString *descriptionString = [NSString stringWithFormat:@"Idenfitier: %@  lastAccessDate: %@ ", self.identifier, self.lastAccessDate];
+    return descriptionString;
+
+}
+
+@end
+
+@interface AFAutoPurgingImageCache ()
+@property (nonatomic, strong) NSMutableDictionary <NSString* , AFCachedImage*> *cachedImages;
+@property (nonatomic, assign) UInt64 currentMemoryUsage;
+@property (nonatomic, strong) dispatch_queue_t synchronizationQueue;
+@end
+
+@implementation AFAutoPurgingImageCache
+
+- (instancetype)init {
+    return [self initWithMemoryCapacity:100 * 1024 * 1024 preferredMemoryCapacity:60 * 1024 * 1024];
+}
+
+- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity {
+    if (self = [super init]) {
+        self.memoryCapacity = memoryCapacity;
+        self.preferredMemoryUsageAfterPurge = preferredMemoryCapacity;
+        self.cachedImages = [[NSMutableDictionary alloc] init];
+
+        NSString *queueName = [NSString stringWithFormat:@"com.alamofire.autopurgingimagecache-%@", [[NSUUID UUID] UUIDString]];
+        self.synchronizationQueue = dispatch_queue_create([queueName cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT);
+
+        [[NSNotificationCenter defaultCenter]
+         addObserver:self
+         selector:@selector(removeAllImages)
+         name:UIApplicationDidReceiveMemoryWarningNotification
+         object:nil];
+
+    }
+    return self;
+}
+
+- (void)dealloc {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+- (UInt64)memoryUsage {
+    __block UInt64 result = 0;
+    dispatch_sync(self.synchronizationQueue, ^{
+        result = self.currentMemoryUsage;
+    });
+    return result;
+}
+
+- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier {
+    dispatch_barrier_async(self.synchronizationQueue, ^{
+        AFCachedImage *cacheImage = [[AFCachedImage alloc] initWithImage:image identifier:identifier];
+
+        AFCachedImage *previousCachedImage = self.cachedImages[identifier];
+        if (previousCachedImage != nil) {
+            self.currentMemoryUsage -= previousCachedImage.totalBytes;
+        }
+
+        self.cachedImages[identifier] = cacheImage;
+        self.currentMemoryUsage += cacheImage.totalBytes;
+    });
+
+    dispatch_barrier_async(self.synchronizationQueue, ^{
+        if (self.currentMemoryUsage > self.memoryCapacity) {
+            UInt64 bytesToPurge = self.currentMemoryUsage - self.preferredMemoryUsageAfterPurge;
+            NSMutableArray <AFCachedImage*> *sortedImages = [NSMutableArray arrayWithArray:self.cachedImages.allValues];
+            NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastAccessDate"
+                                                                           ascending:YES];
+            [sortedImages sortUsingDescriptors:@[sortDescriptor]];
+
+            UInt64 bytesPurged = 0;
+
+            for (AFCachedImage *cachedImage in sortedImages) {
+                [self.cachedImages removeObjectForKey:cachedImage.identifier];
+                bytesPurged += cachedImage.totalBytes;
+                if (bytesPurged >= bytesToPurge) {
+                    break ;
+                }
+            }
+            self.currentMemoryUsage -= bytesPurged;
+        }
+    });
+}
+
+- (BOOL)removeImageWithIdentifier:(NSString *)identifier {
+    __block BOOL removed = NO;
+    dispatch_barrier_sync(self.synchronizationQueue, ^{
+        AFCachedImage *cachedImage = self.cachedImages[identifier];
+        if (cachedImage != nil) {
+            [self.cachedImages removeObjectForKey:identifier];
+            self.currentMemoryUsage -= cachedImage.totalBytes;
+            removed = YES;
+        }
+    });
+    return removed;
+}
+
+- (BOOL)removeAllImages {
+    __block BOOL removed = NO;
+    dispatch_barrier_sync(self.synchronizationQueue, ^{
+        if (self.cachedImages.count > 0) {
+            [self.cachedImages removeAllObjects];
+            self.currentMemoryUsage = 0;
+            removed = YES;
+        }
+    });
+    return removed;
+}
+
+- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier {
+    __block UIImage *image = nil;
+    dispatch_sync(self.synchronizationQueue, ^{
+        AFCachedImage *cachedImage = self.cachedImages[identifier];
+        image = [cachedImage accessImage];
+    });
+    return image;
+}
+
+- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier {
+    [self addImage:image withIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]];
+}
+
+- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier {
+    return [self removeImageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]];
+}
+
+- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)identifier {
+    return [self imageWithIdentifier:[self imageCacheKeyFromURLRequest:request withAdditionalIdentifier:identifier]];
+}
+
+- (NSString *)imageCacheKeyFromURLRequest:(NSURLRequest *)request withAdditionalIdentifier:(NSString *)additionalIdentifier {
+    NSString *key = request.URL.absoluteString;
+    if (additionalIdentifier != nil) {
+        key = [key stringByAppendingString:additionalIdentifier];
+    }
+    return key;
+}
+
+@end
+
+#endif

+ 157 - 0
Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.h

@@ -0,0 +1,157 @@
+// AFImageDownloader.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV 
+
+#import <Foundation/Foundation.h>
+#import "AFAutoPurgingImageCache.h"
+#import "AFHTTPSessionManager.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) {
+    AFImageDownloadPrioritizationFIFO,
+    AFImageDownloadPrioritizationLIFO
+};
+
+/**
+ The `AFImageDownloadReceipt` is an object vended by the `AFImageDownloader` when starting a data task. It can be used to cancel active tasks running on the `AFImageDownloader` session. As a general rule, image data tasks should be cancelled using the `AFImageDownloadReceipt` instead of calling `cancel` directly on the `task` itself. The `AFImageDownloader` is optimized to handle duplicate task scenarios as well as pending versus active downloads.
+ */
+@interface AFImageDownloadReceipt : NSObject
+
+/**
+ The data task created by the `AFImageDownloader`.
+*/
+@property (nonatomic, strong) NSURLSessionDataTask *task;
+
+/**
+ The unique identifier for the success and failure blocks when duplicate requests are made.
+ */
+@property (nonatomic, strong) NSUUID *receiptID;
+@end
+
+/** The `AFImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. Incoming downloads are added to the front or back of the queue depending on the download prioritization. Each downloaded image is cached in the underlying `NSURLCache` as well as the in-memory image cache. By default, any download request with a cached image equivalent in the image cache will automatically be served the cached image representation.
+ */
+@interface AFImageDownloader : NSObject
+
+/**
+ The image cache used to store all downloaded images in. `AFAutoPurgingImageCache` by default.
+ */
+@property (nonatomic, strong, nullable) id <AFImageRequestCache> imageCache;
+
+/**
+ The `AFHTTPSessionManager` used to download images. By default, this is configured with an `AFImageResponseSerializer`, and a shared `NSURLCache` for all image downloads.
+ */
+@property (nonatomic, strong) AFHTTPSessionManager *sessionManager;
+
+/**
+ Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default.
+ */
+@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritizaton;
+
+/**
+ The shared default instance of `AFImageDownloader` initialized with default values.
+ */
++ (instancetype)defaultInstance;
+
+/**
+ Creates a default `NSURLCache` with common usage parameter values.
+
+ @returns The default `NSURLCache` instance.
+ */
++ (NSURLCache *)defaultURLCache;
+
+/**
+ Default initializer
+
+ @return An instance of `AFImageDownloader` initialized with default values.
+ */
+- (instancetype)init;
+
+/**
+ Initializes the `AFImageDownloader` instance with the given session manager, download prioritization, maximum active download count and image cache.
+
+ @param sessionManager The session manager to use to download images.
+ @param downloadPrioritization The download prioritization of the download queue.
+ @param maximumActiveDownloads  The maximum number of active downloads allowed at any given time. Recommend `4`.
+ @param imageCache The image cache used to store all downloaded images in.
+
+ @return The new `AFImageDownloader` instance.
+ */
+- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager
+                downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization
+                maximumActiveDownloads:(NSInteger)maximumActiveDownloads
+                            imageCache:(nullable id <AFImageRequestCache>)imageCache;
+
+/**
+ Creates a data task using the `sessionManager` instance for the specified URL request.
+
+ If the same data task is already in the queue or currently being downloaded, the success and failure blocks are
+ appended to the already existing task. Once the task completes, all success or failure blocks attached to the
+ task are executed in the order they were added.
+
+ @param request The URL request.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+
+ @return The image download receipt for the data task if available. `nil` if the image is stored in the cache.
+ cache and the URL request cache policy allows the cache to be used.
+ */
+- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request
+                                                        success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse  * _Nullable response, UIImage *responseObject))success
+                                                        failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
+
+/**
+ Creates a data task using the `sessionManager` instance for the specified URL request.
+
+ If the same data task is already in the queue or currently being downloaded, the success and failure blocks are
+ appended to the already existing task. Once the task completes, all success or failure blocks attached to the
+ task are executed in the order they were added.
+
+ @param request The URL request.
+ @param receiptID The identifier to use for the download receipt that will be created for this request. This must be a unique identifier that does not represent any other request.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+
+ @return The image download receipt for the data task if available. `nil` if the image is stored in the cache.
+ cache and the URL request cache policy allows the cache to be used.
+ */
+- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request
+                                                 withReceiptID:(NSUUID *)receiptID
+                                                        success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse  * _Nullable response, UIImage *responseObject))success
+                                                        failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
+
+/**
+ Cancels the data task in the receipt by removing the corresponding success and failure blocks and cancelling the data task if necessary.
+
+ If the data task is pending in the queue, it will be cancelled if no other success and failure blocks are registered with the data task. If the data task is currently executing or is already completed, the success and failure blocks are removed and will not be called when the task finishes.
+
+ @param imageDownloadReceipt The image download receipt to cancel.
+ */
+- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt;
+
+@end
+
+#endif
+
+NS_ASSUME_NONNULL_END

+ 391 - 0
Pods/AFNetworking/UIKit+AFNetworking/AFImageDownloader.m

@@ -0,0 +1,391 @@
+// AFImageDownloader.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import "AFImageDownloader.h"
+#import "AFHTTPSessionManager.h"
+
+@interface AFImageDownloaderResponseHandler : NSObject
+@property (nonatomic, strong) NSUUID *uuid;
+@property (nonatomic, copy) void (^successBlock)(NSURLRequest*, NSHTTPURLResponse*, UIImage*);
+@property (nonatomic, copy) void (^failureBlock)(NSURLRequest*, NSHTTPURLResponse*, NSError*);
+@end
+
+@implementation AFImageDownloaderResponseHandler
+
+- (instancetype)initWithUUID:(NSUUID *)uuid
+                     success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success
+                     failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure {
+    if (self = [self init]) {
+        self.uuid = uuid;
+        self.successBlock = success;
+        self.failureBlock = failure;
+    }
+    return self;
+}
+
+- (NSString *)description {
+    return [NSString stringWithFormat: @"<AFImageDownloaderResponseHandler>UUID: %@", [self.uuid UUIDString]];
+}
+
+@end
+
+@interface AFImageDownloaderMergedTask : NSObject
+@property (nonatomic, strong) NSString *URLIdentifier;
+@property (nonatomic, strong) NSUUID *identifier;
+@property (nonatomic, strong) NSURLSessionDataTask *task;
+@property (nonatomic, strong) NSMutableArray <AFImageDownloaderResponseHandler*> *responseHandlers;
+
+@end
+
+@implementation AFImageDownloaderMergedTask
+
+- (instancetype)initWithURLIdentifier:(NSString *)URLIdentifier identifier:(NSUUID *)identifier task:(NSURLSessionDataTask *)task {
+    if (self = [self init]) {
+        self.URLIdentifier = URLIdentifier;
+        self.task = task;
+        self.identifier = identifier;
+        self.responseHandlers = [[NSMutableArray alloc] init];
+    }
+    return self;
+}
+
+- (void)addResponseHandler:(AFImageDownloaderResponseHandler*)handler {
+    [self.responseHandlers addObject:handler];
+}
+
+- (void)removeResponseHandler:(AFImageDownloaderResponseHandler*)handler {
+    [self.responseHandlers removeObject:handler];
+}
+
+@end
+
+@implementation AFImageDownloadReceipt
+
+- (instancetype)initWithReceiptID:(NSUUID *)receiptID task:(NSURLSessionDataTask *)task {
+    if (self = [self init]) {
+        self.receiptID = receiptID;
+        self.task = task;
+    }
+    return self;
+}
+
+@end
+
+@interface AFImageDownloader ()
+
+@property (nonatomic, strong) dispatch_queue_t synchronizationQueue;
+@property (nonatomic, strong) dispatch_queue_t responseQueue;
+
+@property (nonatomic, assign) NSInteger maximumActiveDownloads;
+@property (nonatomic, assign) NSInteger activeRequestCount;
+
+@property (nonatomic, strong) NSMutableArray *queuedMergedTasks;
+@property (nonatomic, strong) NSMutableDictionary *mergedTasks;
+
+@end
+
+
+@implementation AFImageDownloader
+
++ (NSURLCache *)defaultURLCache {
+    return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024
+                                         diskCapacity:150 * 1024 * 1024
+                                             diskPath:@"com.alamofire.imagedownloader"];
+}
+
++ (NSURLSessionConfiguration *)defaultURLSessionConfiguration {
+    NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+
+    //TODO set the default HTTP headers
+
+    configuration.HTTPShouldSetCookies = YES;
+    configuration.HTTPShouldUsePipelining = NO;
+
+    configuration.requestCachePolicy = NSURLRequestUseProtocolCachePolicy;
+    configuration.allowsCellularAccess = YES;
+    configuration.timeoutIntervalForRequest = 60.0;
+    configuration.URLCache = [AFImageDownloader defaultURLCache];
+
+    return configuration;
+}
+
+- (instancetype)init {
+    NSURLSessionConfiguration *defaultConfiguration = [self.class defaultURLSessionConfiguration];
+    AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:defaultConfiguration];
+    sessionManager.responseSerializer = [AFImageResponseSerializer serializer];
+
+    return [self initWithSessionManager:sessionManager
+                 downloadPrioritization:AFImageDownloadPrioritizationFIFO
+                 maximumActiveDownloads:4
+                             imageCache:[[AFAutoPurgingImageCache alloc] init]];
+}
+
+- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager
+                downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization
+                maximumActiveDownloads:(NSInteger)maximumActiveDownloads
+                            imageCache:(id <AFImageRequestCache>)imageCache {
+    if (self = [super init]) {
+        self.sessionManager = sessionManager;
+
+        self.downloadPrioritizaton = downloadPrioritization;
+        self.maximumActiveDownloads = maximumActiveDownloads;
+        self.imageCache = imageCache;
+
+        self.queuedMergedTasks = [[NSMutableArray alloc] init];
+        self.mergedTasks = [[NSMutableDictionary alloc] init];
+        self.activeRequestCount = 0;
+
+        NSString *name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.synchronizationqueue-%@", [[NSUUID UUID] UUIDString]];
+        self.synchronizationQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_SERIAL);
+
+        name = [NSString stringWithFormat:@"com.alamofire.imagedownloader.responsequeue-%@", [[NSUUID UUID] UUIDString]];
+        self.responseQueue = dispatch_queue_create([name cStringUsingEncoding:NSASCIIStringEncoding], DISPATCH_QUEUE_CONCURRENT);
+    }
+
+    return self;
+}
+
++ (instancetype)defaultInstance {
+    static AFImageDownloader *sharedInstance = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        sharedInstance = [[self alloc] init];
+    });
+    return sharedInstance;
+}
+
+- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request
+                                                        success:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, UIImage * _Nonnull))success
+                                                        failure:(void (^)(NSURLRequest * _Nonnull, NSHTTPURLResponse * _Nullable, NSError * _Nonnull))failure {
+    return [self downloadImageForURLRequest:request withReceiptID:[NSUUID UUID] success:success failure:failure];
+}
+
+- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request
+                                                  withReceiptID:(nonnull NSUUID *)receiptID
+                                                        success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse  * _Nullable response, UIImage *responseObject))success
+                                                        failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure {
+    __block NSURLSessionDataTask *task = nil;
+    dispatch_sync(self.synchronizationQueue, ^{
+        NSString *URLIdentifier = request.URL.absoluteString;
+        if (URLIdentifier == nil) {
+            if (failure) {
+                NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorBadURL userInfo:nil];
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    failure(request, nil, error);
+                });
+            }
+            return;
+        }
+
+        // 1) Append the success and failure blocks to a pre-existing request if it already exists
+        AFImageDownloaderMergedTask *existingMergedTask = self.mergedTasks[URLIdentifier];
+        if (existingMergedTask != nil) {
+            AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID success:success failure:failure];
+            [existingMergedTask addResponseHandler:handler];
+            task = existingMergedTask.task;
+            return;
+        }
+
+        // 2) Attempt to load the image from the image cache if the cache policy allows it
+        switch (request.cachePolicy) {
+            case NSURLRequestUseProtocolCachePolicy:
+            case NSURLRequestReturnCacheDataElseLoad:
+            case NSURLRequestReturnCacheDataDontLoad: {
+                UIImage *cachedImage = [self.imageCache imageforRequest:request withAdditionalIdentifier:nil];
+                if (cachedImage != nil) {
+                    if (success) {
+                        dispatch_async(dispatch_get_main_queue(), ^{
+                            success(request, nil, cachedImage);
+                        });
+                    }
+                    return;
+                }
+                break;
+            }
+            default:
+                break;
+        }
+
+        // 3) Create the request and set up authentication, validation and response serialization
+        NSUUID *mergedTaskIdentifier = [NSUUID UUID];
+        NSURLSessionDataTask *createdTask;
+        __weak __typeof__(self) weakSelf = self;
+
+        createdTask = [self.sessionManager
+                       dataTaskWithRequest:request
+                       completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
+                           dispatch_async(self.responseQueue, ^{
+                               __strong __typeof__(weakSelf) strongSelf = weakSelf;
+                               AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier];
+                               if ([mergedTask.identifier isEqual:mergedTaskIdentifier]) {
+                                   mergedTask = [strongSelf safelyRemoveMergedTaskWithURLIdentifier:URLIdentifier];
+                                   if (error) {
+                                       for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) {
+                                           if (handler.failureBlock) {
+                                               dispatch_async(dispatch_get_main_queue(), ^{
+                                                   handler.failureBlock(request, (NSHTTPURLResponse*)response, error);
+                                               });
+                                           }
+                                       }
+                                   } else {
+                                       [strongSelf.imageCache addImage:responseObject forRequest:request withAdditionalIdentifier:nil];
+
+                                       for (AFImageDownloaderResponseHandler *handler in mergedTask.responseHandlers) {
+                                           if (handler.successBlock) {
+                                               dispatch_async(dispatch_get_main_queue(), ^{
+                                                   handler.successBlock(request, (NSHTTPURLResponse*)response, responseObject);
+                                               });
+                                           }
+                                       }
+                                       
+                                   }
+                               }
+                               [strongSelf safelyDecrementActiveTaskCount];
+                               [strongSelf safelyStartNextTaskIfNecessary];
+                           });
+                       }];
+
+        // 4) Store the response handler for use when the request completes
+        AFImageDownloaderResponseHandler *handler = [[AFImageDownloaderResponseHandler alloc] initWithUUID:receiptID
+                                                                                                   success:success
+                                                                                                   failure:failure];
+        AFImageDownloaderMergedTask *mergedTask = [[AFImageDownloaderMergedTask alloc]
+                                                   initWithURLIdentifier:URLIdentifier
+                                                   identifier:mergedTaskIdentifier
+                                                   task:createdTask];
+        [mergedTask addResponseHandler:handler];
+        self.mergedTasks[URLIdentifier] = mergedTask;
+
+        // 5) Either start the request or enqueue it depending on the current active request count
+        if ([self isActiveRequestCountBelowMaximumLimit]) {
+            [self startMergedTask:mergedTask];
+        } else {
+            [self enqueueMergedTask:mergedTask];
+        }
+
+        task = mergedTask.task;
+    });
+    if (task) {
+        return [[AFImageDownloadReceipt alloc] initWithReceiptID:receiptID task:task];
+    } else {
+        return nil;
+    }
+}
+
+- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt {
+    dispatch_sync(self.synchronizationQueue, ^{
+        NSString *URLIdentifier = imageDownloadReceipt.task.originalRequest.URL.absoluteString;
+        AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier];
+        NSUInteger index = [mergedTask.responseHandlers indexOfObjectPassingTest:^BOOL(AFImageDownloaderResponseHandler * _Nonnull handler, __unused NSUInteger idx, __unused BOOL * _Nonnull stop) {
+            return handler.uuid == imageDownloadReceipt.receiptID;
+        }];
+
+        if (index != NSNotFound) {
+            AFImageDownloaderResponseHandler *handler = mergedTask.responseHandlers[index];
+            [mergedTask removeResponseHandler:handler];
+            NSString *failureReason = [NSString stringWithFormat:@"ImageDownloader cancelled URL request: %@",imageDownloadReceipt.task.originalRequest.URL.absoluteString];
+            NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey:failureReason};
+            NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo];
+            if (handler.failureBlock) {
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    handler.failureBlock(imageDownloadReceipt.task.originalRequest, nil, error);
+                });
+            }
+        }
+
+        if (mergedTask.responseHandlers.count == 0 && mergedTask.task.state == NSURLSessionTaskStateSuspended) {
+            [mergedTask.task cancel];
+            [self removeMergedTaskWithURLIdentifier:URLIdentifier];
+        }
+    });
+}
+
+- (AFImageDownloaderMergedTask*)safelyRemoveMergedTaskWithURLIdentifier:(NSString *)URLIdentifier {
+    __block AFImageDownloaderMergedTask *mergedTask = nil;
+    dispatch_sync(self.synchronizationQueue, ^{
+        mergedTask = [self removeMergedTaskWithURLIdentifier:URLIdentifier];
+    });
+    return mergedTask;
+}
+
+//This method should only be called from safely within the synchronizationQueue
+- (AFImageDownloaderMergedTask *)removeMergedTaskWithURLIdentifier:(NSString *)URLIdentifier {
+    AFImageDownloaderMergedTask *mergedTask = self.mergedTasks[URLIdentifier];
+    [self.mergedTasks removeObjectForKey:URLIdentifier];
+    return mergedTask;
+}
+
+- (void)safelyDecrementActiveTaskCount {
+    dispatch_sync(self.synchronizationQueue, ^{
+        if (self.activeRequestCount > 0) {
+            self.activeRequestCount -= 1;
+        }
+    });
+}
+
+- (void)safelyStartNextTaskIfNecessary {
+    dispatch_sync(self.synchronizationQueue, ^{
+        if ([self isActiveRequestCountBelowMaximumLimit]) {
+            while (self.queuedMergedTasks.count > 0) {
+                AFImageDownloaderMergedTask *mergedTask = [self dequeueMergedTask];
+                if (mergedTask.task.state == NSURLSessionTaskStateSuspended) {
+                    [self startMergedTask:mergedTask];
+                    break;
+                }
+            }
+        }
+    });
+}
+
+- (void)startMergedTask:(AFImageDownloaderMergedTask *)mergedTask {
+    [mergedTask.task resume];
+    ++self.activeRequestCount;
+}
+
+- (void)enqueueMergedTask:(AFImageDownloaderMergedTask *)mergedTask {
+    switch (self.downloadPrioritizaton) {
+        case AFImageDownloadPrioritizationFIFO:
+            [self.queuedMergedTasks addObject:mergedTask];
+            break;
+        case AFImageDownloadPrioritizationLIFO:
+            [self.queuedMergedTasks insertObject:mergedTask atIndex:0];
+            break;
+    }
+}
+
+- (AFImageDownloaderMergedTask *)dequeueMergedTask {
+    AFImageDownloaderMergedTask *mergedTask = nil;
+    mergedTask = [self.queuedMergedTasks firstObject];
+    [self.queuedMergedTasks removeObject:mergedTask];
+    return mergedTask;
+}
+
+- (BOOL)isActiveRequestCountBelowMaximumLimit {
+    return self.activeRequestCount < self.maximumActiveDownloads;
+}
+
+@end
+
+#endif

+ 103 - 0
Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h

@@ -0,0 +1,103 @@
+// AFNetworkActivityIndicatorManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero.
+
+ You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code:
+
+    [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
+
+ By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself.
+
+ See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information:
+ http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44
+ */
+NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.")
+@interface AFNetworkActivityIndicatorManager : NSObject
+
+/**
+ A Boolean value indicating whether the manager is enabled.
+
+ If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO.
+ */
+@property (nonatomic, assign, getter = isEnabled) BOOL enabled;
+
+/**
+ A Boolean value indicating whether the network activity indicator manager is currently active.
+*/
+@property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
+
+/**
+ A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds.
+ 
+ Apple's HIG describes the following:
+
+ > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence.
+
+ */
+@property (nonatomic, assign) NSTimeInterval activationDelay;
+
+/**
+ A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds.
+ */
+
+@property (nonatomic, assign) NSTimeInterval completionDelay;
+
+/**
+ Returns the shared network activity indicator manager object for the system.
+
+ @return The systemwide network activity indicator manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator.
+ */
+- (void)incrementActivityCount;
+
+/**
+ Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator.
+ */
+- (void)decrementActivityCount;
+
+/**
+ Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward.
+
+ @param block A block to be executed when the network activity indicator status changes.
+ */
+- (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

+ 261 - 0
Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m

@@ -0,0 +1,261 @@
+// AFNetworkActivityIndicatorManager.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "AFNetworkActivityIndicatorManager.h"
+
+#if TARGET_OS_IOS
+#import "AFURLSessionManager.h"
+
+typedef NS_ENUM(NSInteger, AFNetworkActivityManagerState) {
+    AFNetworkActivityManagerStateNotActive,
+    AFNetworkActivityManagerStateDelayingStart,
+    AFNetworkActivityManagerStateActive,
+    AFNetworkActivityManagerStateDelayingEnd
+};
+
+static NSTimeInterval const kDefaultAFNetworkActivityManagerActivationDelay = 1.0;
+static NSTimeInterval const kDefaultAFNetworkActivityManagerCompletionDelay = 0.17;
+
+static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) {
+    if ([[notification object] respondsToSelector:@selector(originalRequest)]) {
+        return [(NSURLSessionTask *)[notification object] originalRequest];
+    } else {
+        return nil;
+    }
+}
+
+typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisible);
+
+@interface AFNetworkActivityIndicatorManager ()
+@property (readwrite, nonatomic, assign) NSInteger activityCount;
+@property (readwrite, nonatomic, strong) NSTimer *activationDelayTimer;
+@property (readwrite, nonatomic, strong) NSTimer *completionDelayTimer;
+@property (readonly, nonatomic, getter = isNetworkActivityOccurring) BOOL networkActivityOccurring;
+@property (nonatomic, copy) AFNetworkActivityActionBlock networkActivityActionBlock;
+@property (nonatomic, assign) AFNetworkActivityManagerState currentState;
+@property (nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
+
+- (void)updateCurrentStateForNetworkActivityChange;
+@end
+
+@implementation AFNetworkActivityIndicatorManager
+
++ (instancetype)sharedManager {
+    static AFNetworkActivityIndicatorManager *_sharedManager = nil;
+    static dispatch_once_t oncePredicate;
+    dispatch_once(&oncePredicate, ^{
+        _sharedManager = [[self alloc] init];
+    });
+
+    return _sharedManager;
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (!self) {
+        return nil;
+    }
+    self.currentState = AFNetworkActivityManagerStateNotActive;
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil];
+    self.activationDelay = kDefaultAFNetworkActivityManagerActivationDelay;
+    self.completionDelay = kDefaultAFNetworkActivityManagerCompletionDelay;
+
+    return self;
+}
+
+- (void)dealloc {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+    [_activationDelayTimer invalidate];
+    [_completionDelayTimer invalidate];
+}
+
+- (void)setEnabled:(BOOL)enabled {
+    _enabled = enabled;
+    if (enabled == NO) {
+        [self setCurrentState:AFNetworkActivityManagerStateNotActive];
+    }
+}
+
+- (void)setNetworkingActivityActionWithBlock:(void (^)(BOOL networkActivityIndicatorVisible))block {
+    self.networkActivityActionBlock = block;
+}
+
+- (BOOL)isNetworkActivityOccurring {
+    @synchronized(self) {
+        return self.activityCount > 0;
+    }
+}
+
+- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible {
+    if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) {
+        [self willChangeValueForKey:@"networkActivityIndicatorVisible"];
+        @synchronized(self) {
+             _networkActivityIndicatorVisible = networkActivityIndicatorVisible;
+        }
+        [self didChangeValueForKey:@"networkActivityIndicatorVisible"];
+        if (self.networkActivityActionBlock) {
+            self.networkActivityActionBlock(networkActivityIndicatorVisible);
+        } else {
+            [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible];
+        }
+    }
+}
+
+- (void)setActivityCount:(NSInteger)activityCount {
+	@synchronized(self) {
+		_activityCount = activityCount;
+	}
+
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [self updateCurrentStateForNetworkActivityChange];
+    });
+}
+
+- (void)incrementActivityCount {
+    [self willChangeValueForKey:@"activityCount"];
+	@synchronized(self) {
+		_activityCount++;
+	}
+    [self didChangeValueForKey:@"activityCount"];
+
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [self updateCurrentStateForNetworkActivityChange];
+    });
+}
+
+- (void)decrementActivityCount {
+    [self willChangeValueForKey:@"activityCount"];
+	@synchronized(self) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+		_activityCount = MAX(_activityCount - 1, 0);
+#pragma clang diagnostic pop
+	}
+    [self didChangeValueForKey:@"activityCount"];
+
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [self updateCurrentStateForNetworkActivityChange];
+    });
+}
+
+- (void)networkRequestDidStart:(NSNotification *)notification {
+    if ([AFNetworkRequestFromNotification(notification) URL]) {
+        [self incrementActivityCount];
+    }
+}
+
+- (void)networkRequestDidFinish:(NSNotification *)notification {
+    if ([AFNetworkRequestFromNotification(notification) URL]) {
+        [self decrementActivityCount];
+    }
+}
+
+#pragma mark - Internal State Management
+- (void)setCurrentState:(AFNetworkActivityManagerState)currentState {
+    @synchronized(self) {
+        if (_currentState != currentState) {
+            [self willChangeValueForKey:@"currentState"];
+            _currentState = currentState;
+            switch (currentState) {
+                case AFNetworkActivityManagerStateNotActive:
+                    [self cancelActivationDelayTimer];
+                    [self cancelCompletionDelayTimer];
+                    [self setNetworkActivityIndicatorVisible:NO];
+                    break;
+                case AFNetworkActivityManagerStateDelayingStart:
+                    [self startActivationDelayTimer];
+                    break;
+                case AFNetworkActivityManagerStateActive:
+                    [self cancelCompletionDelayTimer];
+                    [self setNetworkActivityIndicatorVisible:YES];
+                    break;
+                case AFNetworkActivityManagerStateDelayingEnd:
+                    [self startCompletionDelayTimer];
+                    break;
+            }
+        }
+        [self didChangeValueForKey:@"currentState"];
+    }
+}
+
+- (void)updateCurrentStateForNetworkActivityChange {
+    if (self.enabled) {
+        switch (self.currentState) {
+            case AFNetworkActivityManagerStateNotActive:
+                if (self.isNetworkActivityOccurring) {
+                    [self setCurrentState:AFNetworkActivityManagerStateDelayingStart];
+                }
+                break;
+            case AFNetworkActivityManagerStateDelayingStart:
+                //No op. Let the delay timer finish out.
+                break;
+            case AFNetworkActivityManagerStateActive:
+                if (!self.isNetworkActivityOccurring) {
+                    [self setCurrentState:AFNetworkActivityManagerStateDelayingEnd];
+                }
+                break;
+            case AFNetworkActivityManagerStateDelayingEnd:
+                if (self.isNetworkActivityOccurring) {
+                    [self setCurrentState:AFNetworkActivityManagerStateActive];
+                }
+                break;
+        }
+    }
+}
+
+- (void)startActivationDelayTimer {
+    self.activationDelayTimer = [NSTimer
+                                 timerWithTimeInterval:self.activationDelay target:self selector:@selector(activationDelayTimerFired) userInfo:nil repeats:NO];
+    [[NSRunLoop mainRunLoop] addTimer:self.activationDelayTimer forMode:NSRunLoopCommonModes];
+}
+
+- (void)activationDelayTimerFired {
+    if (self.networkActivityOccurring) {
+        [self setCurrentState:AFNetworkActivityManagerStateActive];
+    } else {
+        [self setCurrentState:AFNetworkActivityManagerStateNotActive];
+    }
+}
+
+- (void)startCompletionDelayTimer {
+    [self.completionDelayTimer invalidate];
+    self.completionDelayTimer = [NSTimer timerWithTimeInterval:self.completionDelay target:self selector:@selector(completionDelayTimerFired) userInfo:nil repeats:NO];
+    [[NSRunLoop mainRunLoop] addTimer:self.completionDelayTimer forMode:NSRunLoopCommonModes];
+}
+
+- (void)completionDelayTimerFired {
+    [self setCurrentState:AFNetworkActivityManagerStateNotActive];
+}
+
+- (void)cancelActivationDelayTimer {
+    [self.activationDelayTimer invalidate];
+}
+
+- (void)cancelCompletionDelayTimer {
+    [self.completionDelayTimer invalidate];
+}
+
+@end
+
+#endif

+ 48 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h

@@ -0,0 +1,48 @@
+// UIActivityIndicatorView+AFNetworking.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import <UIKit/UIKit.h>
+
+/**
+ This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task.
+ */
+@interface UIActivityIndicatorView (AFNetworking)
+
+///----------------------------------
+/// @name Animating for Session Tasks
+///----------------------------------
+
+/**
+ Binds the animating state to the state of the specified task.
+
+ @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task;
+
+@end
+
+#endif

+ 124 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m

@@ -0,0 +1,124 @@
+// UIActivityIndicatorView+AFNetworking.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIActivityIndicatorView+AFNetworking.h"
+#import <objc/runtime.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import "AFURLSessionManager.h"
+
+@interface AFActivityIndicatorViewNotificationObserver : NSObject
+@property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView;
+- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView;
+
+- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task;
+
+@end
+
+@implementation UIActivityIndicatorView (AFNetworking)
+
+- (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver {
+    AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));
+    if (notificationObserver == nil) {
+        notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self];
+        objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+    }
+    return notificationObserver;
+}
+
+- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
+    [[self af_notificationObserver] setAnimatingWithStateOfTask:task];
+}
+
+@end
+
+@implementation AFActivityIndicatorViewNotificationObserver
+
+- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView
+{
+    self = [super init];
+    if (self) {
+        _activityIndicatorView = activityIndicatorView;
+    }
+    return self;
+}
+
+- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+    
+    if (task) {
+        if (task.state != NSURLSessionTaskStateCompleted) {
+            
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreceiver-is-weak"
+#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak"
+            if (task.state == NSURLSessionTaskStateRunning) {
+                [self.activityIndicatorView startAnimating];
+            } else {
+                [self.activityIndicatorView stopAnimating];
+            }
+#pragma clang diagnostic pop
+
+            [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task];
+            [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task];
+            [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task];
+        }
+    }
+}
+
+#pragma mark -
+
+- (void)af_startAnimating {
+    dispatch_async(dispatch_get_main_queue(), ^{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreceiver-is-weak"
+        [self.activityIndicatorView startAnimating];
+#pragma clang diagnostic pop
+    });
+}
+
+- (void)af_stopAnimating {
+    dispatch_async(dispatch_get_main_queue(), ^{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreceiver-is-weak"
+        [self.activityIndicatorView stopAnimating];
+#pragma clang diagnostic pop
+    });
+}
+
+#pragma mark -
+
+- (void)dealloc {
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+    
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+}
+
+@end
+
+#endif

+ 175 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h

@@ -0,0 +1,175 @@
+// UIButton+AFNetworking.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class AFImageDownloader;
+
+/**
+ This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL.
+
+ @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported.
+ */
+@interface UIButton (AFNetworking)
+
+///------------------------------------
+/// @name Accessing the Image Downloader
+///------------------------------------
+
+/**
+ Set the shared image downloader used to download images.
+
+ @param imageDownloader The shared image downloader used to download images.
+*/
++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader;
+
+/**
+ The shared image downloader used to download images.
+ */
++ (AFImageDownloader *)sharedImageDownloader;
+
+///--------------------
+/// @name Setting Image
+///--------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+  If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the image request.
+ */
+- (void)setImageForState:(UIControlState)state
+                 withURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
+ */
+- (void)setImageForState:(UIControlState)state
+                 withURL:(NSURL *)url
+        placeholderImage:(nullable UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied.
+
+ @param state The control state.
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+ */
+- (void)setImageForState:(UIControlState)state
+          withURLRequest:(NSURLRequest *)urlRequest
+        placeholderImage:(nullable UIImage *)placeholderImage
+                 success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
+                 failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
+
+
+///-------------------------------
+/// @name Setting Background Image
+///-------------------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled.
+
+ If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the background image request.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+                           withURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the background image request.
+ @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+                           withURL:(NSURL *)url
+                  placeholderImage:(nullable UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied.
+
+ @param state The control state.
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+                    withURLRequest:(NSURLRequest *)urlRequest
+                  placeholderImage:(nullable UIImage *)placeholderImage
+                           success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
+                           failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
+
+
+///------------------------------
+/// @name Canceling Image Loading
+///------------------------------
+
+/**
+ Cancels any executing image task for the specified control state of the receiver, if one exists.
+
+ @param state The control state.
+ */
+- (void)cancelImageDownloadTaskForState:(UIControlState)state;
+
+/**
+ Cancels any executing background image task for the specified control state of the receiver, if one exists.
+
+ @param state The control state.
+ */
+- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

+ 305 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m

@@ -0,0 +1,305 @@
+// UIButton+AFNetworking.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIButton+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import "UIImageView+AFNetworking.h"
+#import "AFImageDownloader.h"
+
+@interface UIButton (_AFNetworking)
+@end
+
+@implementation UIButton (_AFNetworking)
+
+#pragma mark -
+
+static char AFImageDownloadReceiptNormal;
+static char AFImageDownloadReceiptHighlighted;
+static char AFImageDownloadReceiptSelected;
+static char AFImageDownloadReceiptDisabled;
+
+static const char * af_imageDownloadReceiptKeyForState(UIControlState state) {
+    switch (state) {
+        case UIControlStateHighlighted:
+            return &AFImageDownloadReceiptHighlighted;
+        case UIControlStateSelected:
+            return &AFImageDownloadReceiptSelected;
+        case UIControlStateDisabled:
+            return &AFImageDownloadReceiptDisabled;
+        case UIControlStateNormal:
+        default:
+            return &AFImageDownloadReceiptNormal;
+    }
+}
+
+- (AFImageDownloadReceipt *)af_imageDownloadReceiptForState:(UIControlState)state {
+    return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_imageDownloadReceiptKeyForState(state));
+}
+
+- (void)af_setImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt
+                           forState:(UIControlState)state
+{
+    objc_setAssociatedObject(self, af_imageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+static char AFBackgroundImageDownloadReceiptNormal;
+static char AFBackgroundImageDownloadReceiptHighlighted;
+static char AFBackgroundImageDownloadReceiptSelected;
+static char AFBackgroundImageDownloadReceiptDisabled;
+
+static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState state) {
+    switch (state) {
+        case UIControlStateHighlighted:
+            return &AFBackgroundImageDownloadReceiptHighlighted;
+        case UIControlStateSelected:
+            return &AFBackgroundImageDownloadReceiptSelected;
+        case UIControlStateDisabled:
+            return &AFBackgroundImageDownloadReceiptDisabled;
+        case UIControlStateNormal:
+        default:
+            return &AFBackgroundImageDownloadReceiptNormal;
+    }
+}
+
+- (AFImageDownloadReceipt *)af_backgroundImageDownloadReceiptForState:(UIControlState)state {
+    return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state));
+}
+
+- (void)af_setBackgroundImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt
+                                     forState:(UIControlState)state
+{
+    objc_setAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIButton (AFNetworking)
+
++ (AFImageDownloader *)sharedImageDownloader {
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+    return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
+#pragma clang diagnostic pop
+}
+
++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
+    objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)setImageForState:(UIControlState)state
+                 withURL:(NSURL *)url
+{
+    [self setImageForState:state withURL:url placeholderImage:nil];
+}
+
+- (void)setImageForState:(UIControlState)state
+                 withURL:(NSURL *)url
+        placeholderImage:(UIImage *)placeholderImage
+{
+    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+    [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+    [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setImageForState:(UIControlState)state
+          withURLRequest:(NSURLRequest *)urlRequest
+        placeholderImage:(nullable UIImage *)placeholderImage
+                 success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
+                 failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
+{
+    if ([self isActiveTaskURLEqualToURLRequest:urlRequest forState:state]) {
+        return;
+    }
+
+    [self cancelImageDownloadTaskForState:state];
+
+    AFImageDownloader *downloader = [[self class] sharedImageDownloader];
+    id <AFImageRequestCache> imageCache = downloader.imageCache;
+
+    //Use the image from the image cache if it exists
+    UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil];
+    if (cachedImage) {
+        if (success) {
+            success(urlRequest, nil, cachedImage);
+        } else {
+            [self setImage:cachedImage forState:state];
+        }
+        [self af_setImageDownloadReceipt:nil forState:state];
+    } else {
+        if (placeholderImage) {
+            [self setImage:placeholderImage forState:state];
+        }
+
+        __weak __typeof(self)weakSelf = self;
+        NSUUID *downloadID = [NSUUID UUID];
+        AFImageDownloadReceipt *receipt;
+        receipt = [downloader
+                   downloadImageForURLRequest:urlRequest
+                   withReceiptID:downloadID
+                   success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) {
+                       __strong __typeof(weakSelf)strongSelf = weakSelf;
+                       if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
+                           if (success) {
+                               success(request, response, responseObject);
+                           } else if(responseObject) {
+                               [strongSelf setImage:responseObject forState:state];
+                           }
+                           [strongSelf af_setImageDownloadReceipt:nil forState:state];
+                       }
+
+                   }
+                   failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {
+                       __strong __typeof(weakSelf)strongSelf = weakSelf;
+                       if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
+                           if (failure) {
+                               failure(request, response, error);
+                           }
+                           [strongSelf  af_setImageDownloadReceipt:nil forState:state];
+                       }
+                   }];
+
+        [self af_setImageDownloadReceipt:receipt forState:state];
+    }
+}
+
+#pragma mark -
+
+- (void)setBackgroundImageForState:(UIControlState)state
+                           withURL:(NSURL *)url
+{
+    [self setBackgroundImageForState:state withURL:url placeholderImage:nil];
+}
+
+- (void)setBackgroundImageForState:(UIControlState)state
+                           withURL:(NSURL *)url
+                  placeholderImage:(nullable UIImage *)placeholderImage
+{
+    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+    [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+    [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setBackgroundImageForState:(UIControlState)state
+                    withURLRequest:(NSURLRequest *)urlRequest
+                  placeholderImage:(nullable UIImage *)placeholderImage
+                           success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
+                           failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
+{
+    if ([self isActiveBackgroundTaskURLEqualToURLRequest:urlRequest forState:state]) {
+        return;
+    }
+
+    [self cancelBackgroundImageDownloadTaskForState:state];
+
+    AFImageDownloader *downloader = [[self class] sharedImageDownloader];
+    id <AFImageRequestCache> imageCache = downloader.imageCache;
+
+    //Use the image from the image cache if it exists
+    UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil];
+    if (cachedImage) {
+        if (success) {
+            success(urlRequest, nil, cachedImage);
+        } else {
+            [self setBackgroundImage:cachedImage forState:state];
+        }
+        [self af_setBackgroundImageDownloadReceipt:nil forState:state];
+    } else {
+        if (placeholderImage) {
+            [self setBackgroundImage:placeholderImage forState:state];
+        }
+
+        __weak __typeof(self)weakSelf = self;
+        NSUUID *downloadID = [NSUUID UUID];
+        AFImageDownloadReceipt *receipt;
+        receipt = [downloader
+                   downloadImageForURLRequest:urlRequest
+                   withReceiptID:downloadID
+                   success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) {
+                       __strong __typeof(weakSelf)strongSelf = weakSelf;
+                       if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
+                           if (success) {
+                               success(request, response, responseObject);
+                           } else if(responseObject) {
+                               [strongSelf setBackgroundImage:responseObject forState:state];
+                           }
+                           [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state];
+                       }
+
+                   }
+                   failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {
+                       __strong __typeof(weakSelf)strongSelf = weakSelf;
+                       if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {
+                           if (failure) {
+                               failure(request, response, error);
+                           }
+                           [strongSelf  af_setBackgroundImageDownloadReceipt:nil forState:state];
+                       }
+                   }];
+
+        [self af_setBackgroundImageDownloadReceipt:receipt forState:state];
+    }
+}
+
+#pragma mark -
+
+- (void)cancelImageDownloadTaskForState:(UIControlState)state {
+    AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state];
+    if (receipt != nil) {
+        [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt];
+        [self af_setImageDownloadReceipt:nil forState:state];
+    }
+}
+
+- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state {
+    AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state];
+    if (receipt != nil) {
+        [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt];
+        [self af_setBackgroundImageDownloadReceipt:nil forState:state];
+    }
+}
+
+- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state {
+    AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state];
+    return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString];
+}
+
+- (BOOL)isActiveBackgroundTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state {
+    AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state];
+    return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString];
+}
+
+
+@end
+
+#endif

+ 35 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIImage+AFNetworking.h

@@ -0,0 +1,35 @@
+//
+//  UIImage+AFNetworking.h
+//  
+//
+//  Created by Paulo Ferreira on 08/07/15.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import <UIKit/UIKit.h>
+
+@interface UIImage (AFNetworking)
+
++ (UIImage*) safeImageWithData:(NSData*)data;
+
+@end
+
+#endif

+ 109 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h

@@ -0,0 +1,109 @@
+// UIImageView+AFNetworking.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class AFImageDownloader;
+
+/**
+ This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL.
+ */
+@interface UIImageView (AFNetworking)
+
+///------------------------------------
+/// @name Accessing the Image Downloader
+///------------------------------------
+
+/**
+ Set the shared image downloader used to download images.
+
+ @param imageDownloader The shared image downloader used to download images.
+ */
++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader;
+
+/**
+ The shared image downloader used to download images.
+ */
++ (AFImageDownloader *)sharedImageDownloader;
+
+///--------------------
+/// @name Setting Image
+///--------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
+
+ @param url The URL used for the image request.
+ */
+- (void)setImageWithURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
+
+ @param url The URL used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
+ */
+- (void)setImageWithURL:(NSURL *)url
+       placeholderImage:(nullable UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied.
+
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+ */
+- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
+              placeholderImage:(nullable UIImage *)placeholderImage
+                       success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
+                       failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
+
+/**
+ Cancels any executing image operation for the receiver, if one exists.
+ */
+- (void)cancelImageDownloadTask;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

+ 161 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m

@@ -0,0 +1,161 @@
+// UIImageView+AFNetworking.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIImageView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import "AFImageDownloader.h"
+
+@interface UIImageView (_AFNetworking)
+@property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt;
+@end
+
+@implementation UIImageView (_AFNetworking)
+
+- (AFImageDownloadReceipt *)af_activeImageDownloadReceipt {
+    return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt));
+}
+
+- (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt {
+    objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIImageView (AFNetworking)
+
++ (AFImageDownloader *)sharedImageDownloader {
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+    return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance];
+#pragma clang diagnostic pop
+}
+
++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {
+    objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)setImageWithURL:(NSURL *)url {
+    [self setImageWithURL:url placeholderImage:nil];
+}
+
+- (void)setImageWithURL:(NSURL *)url
+       placeholderImage:(UIImage *)placeholderImage
+{
+    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+    [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+    [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
+              placeholderImage:(UIImage *)placeholderImage
+                       success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success
+                       failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure
+{
+
+    if ([urlRequest URL] == nil) {
+        [self cancelImageDownloadTask];
+        self.image = placeholderImage;
+        return;
+    }
+
+    if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){
+        return;
+    }
+
+    [self cancelImageDownloadTask];
+
+    AFImageDownloader *downloader = [[self class] sharedImageDownloader];
+    id <AFImageRequestCache> imageCache = downloader.imageCache;
+
+    //Use the image from the image cache if it exists
+    UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil];
+    if (cachedImage) {
+        if (success) {
+            success(urlRequest, nil, cachedImage);
+        } else {
+            self.image = cachedImage;
+        }
+        [self clearActiveDownloadInformation];
+    } else {
+        if (placeholderImage) {
+            self.image = placeholderImage;
+        }
+
+        __weak __typeof(self)weakSelf = self;
+        NSUUID *downloadID = [NSUUID UUID];
+        AFImageDownloadReceipt *receipt;
+        receipt = [downloader
+                   downloadImageForURLRequest:urlRequest
+                   withReceiptID:downloadID
+                   success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) {
+                       __strong __typeof(weakSelf)strongSelf = weakSelf;
+                       if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {
+                           if (success) {
+                               success(request, response, responseObject);
+                           } else if(responseObject) {
+                               strongSelf.image = responseObject;
+                           }
+                           [strongSelf clearActiveDownloadInformation];
+                       }
+
+                   }
+                   failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {
+                       __strong __typeof(weakSelf)strongSelf = weakSelf;
+                        if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {
+                            if (failure) {
+                                failure(request, response, error);
+                            }
+                            [strongSelf clearActiveDownloadInformation];
+                        }
+                   }];
+
+        self.af_activeImageDownloadReceipt = receipt;
+    }
+}
+
+- (void)cancelImageDownloadTask {
+    if (self.af_activeImageDownloadReceipt != nil) {
+        [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt];
+        [self clearActiveDownloadInformation];
+     }
+}
+
+- (void)clearActiveDownloadInformation {
+    self.af_activeImageDownloadReceipt = nil;
+}
+
+- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest {
+    return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString];
+}
+
+@end
+
+#endif

+ 42 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h

@@ -0,0 +1,42 @@
+// UIKit+AFNetworking.h
+//
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+#import <UIKit/UIKit.h>
+
+#ifndef _UIKIT_AFNETWORKING_
+    #define _UIKIT_AFNETWORKING_
+
+#if TARGET_OS_IOS
+    #import "AFAutoPurgingImageCache.h"
+    #import "AFImageDownloader.h"
+    #import "AFNetworkActivityIndicatorManager.h"
+    #import "UIRefreshControl+AFNetworking.h"
+    #import "UIWebView+AFNetworking.h"
+#endif
+
+    #import "UIActivityIndicatorView+AFNetworking.h"
+    #import "UIButton+AFNetworking.h"
+    #import "UIImageView+AFNetworking.h"
+    #import "UIProgressView+AFNetworking.h"
+#endif /* _UIKIT_AFNETWORKING_ */
+#endif

+ 64 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h

@@ -0,0 +1,64 @@
+// UIProgressView+AFNetworking.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+
+/**
+ This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task.
+ */
+@interface UIProgressView (AFNetworking)
+
+///------------------------------------
+/// @name Setting Session Task Progress
+///------------------------------------
+
+/**
+ Binds the progress to the upload progress of the specified session task.
+
+ @param task The session task.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
+                                   animated:(BOOL)animated;
+
+/**
+ Binds the progress to the download progress of the specified session task.
+
+ @param task The session task.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
+                                     animated:(BOOL)animated;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

+ 118 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m

@@ -0,0 +1,118 @@
+// UIProgressView+AFNetworking.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIProgressView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+
+#import "AFURLSessionManager.h"
+
+static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext;
+static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext;
+
+#pragma mark -
+
+@implementation UIProgressView (AFNetworking)
+
+- (BOOL)af_uploadProgressAnimated {
+    return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue];
+}
+
+- (void)af_setUploadProgressAnimated:(BOOL)animated {
+    objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (BOOL)af_downloadProgressAnimated {
+    return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue];
+}
+
+- (void)af_setDownloadProgressAnimated:(BOOL)animated {
+    objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
+                                   animated:(BOOL)animated
+{
+    [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
+    [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
+
+    [self af_setUploadProgressAnimated:animated];
+}
+
+- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
+                                     animated:(BOOL)animated
+{
+    [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
+    [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
+
+    [self af_setDownloadProgressAnimated:animated];
+}
+
+#pragma mark - NSKeyValueObserving
+
+- (void)observeValueForKeyPath:(NSString *)keyPath
+                      ofObject:(id)object
+                        change:(__unused NSDictionary *)change
+                       context:(void *)context
+{
+    if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) {
+        if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) {
+            if ([object countOfBytesExpectedToSend] > 0) {
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated];
+                });
+            }
+        }
+
+        if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) {
+            if ([object countOfBytesExpectedToReceive] > 0) {
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated];
+                });
+            }
+        }
+
+        if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) {
+            if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) {
+                @try {
+                    [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))];
+
+                    if (context == AFTaskCountOfBytesSentContext) {
+                        [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))];
+                    }
+
+                    if (context == AFTaskCountOfBytesReceivedContext) {
+                        [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))];
+                    }
+                }
+                @catch (NSException * __unused exception) {}
+            }
+        }
+    }
+}
+
+@end
+
+#endif

+ 53 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h

@@ -0,0 +1,53 @@
+// UIRefreshControl+AFNetworking.m
+//
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task.
+ */
+@interface UIRefreshControl (AFNetworking)
+
+///-----------------------------------
+/// @name Refreshing for Session Tasks
+///-----------------------------------
+
+/**
+ Binds the refreshing state to the state of the specified task.
+ 
+ @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

+ 122 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m

@@ -0,0 +1,122 @@
+// UIRefreshControl+AFNetworking.m
+//
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIRefreshControl+AFNetworking.h"
+#import <objc/runtime.h>
+
+#if TARGET_OS_IOS
+
+#import "AFURLSessionManager.h"
+
+@interface AFRefreshControlNotificationObserver : NSObject
+@property (readonly, nonatomic, weak) UIRefreshControl *refreshControl;
+- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl;
+
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
+
+@end
+
+@implementation UIRefreshControl (AFNetworking)
+
+- (AFRefreshControlNotificationObserver *)af_notificationObserver {
+    AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));
+    if (notificationObserver == nil) {
+        notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self];
+        objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+    }
+    return notificationObserver;
+}
+
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
+    [[self af_notificationObserver] setRefreshingWithStateOfTask:task];
+}
+
+@end
+
+@implementation AFRefreshControlNotificationObserver
+
+- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl
+{
+    self = [super init];
+    if (self) {
+        _refreshControl = refreshControl;
+    }
+    return self;
+}
+
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+
+    if (task) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreceiver-is-weak"
+#pragma clang diagnostic ignored "-Warc-repeated-use-of-weak"
+        if (task.state == NSURLSessionTaskStateRunning) {
+            [self.refreshControl beginRefreshing];
+
+            [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task];
+            [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task];
+            [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task];
+        } else {
+            [self.refreshControl endRefreshing];
+        }
+#pragma clang diagnostic pop
+    }
+}
+
+#pragma mark -
+
+- (void)af_beginRefreshing {
+    dispatch_async(dispatch_get_main_queue(), ^{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreceiver-is-weak"
+        [self.refreshControl beginRefreshing];
+#pragma clang diagnostic pop
+    });
+}
+
+- (void)af_endRefreshing {
+    dispatch_async(dispatch_get_main_queue(), ^{
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreceiver-is-weak"
+        [self.refreshControl endRefreshing];
+#pragma clang diagnostic pop
+    });
+}
+
+#pragma mark -
+
+- (void)dealloc {
+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+    
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+    [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+}
+
+@end
+
+#endif

+ 80 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h

@@ -0,0 +1,80 @@
+// UIWebView+AFNetworking.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class AFHTTPSessionManager;
+
+/**
+ This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling.
+
+ @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly.
+ */
+@interface UIWebView (AFNetworking)
+
+/**
+ The session manager used to download all requests.
+ */
+@property (nonatomic, strong) AFHTTPSessionManager *sessionManager;
+
+/**
+ Asynchronously loads the specified request.
+
+ @param request A URL request identifying the location of the content to load. This must not be `nil`.
+ @param progress A progress object monitoring the current download progress.
+ @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string.
+ @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred.
+ */
+- (void)loadRequest:(NSURLRequest *)request
+           progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
+            success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
+            failure:(nullable void (^)(NSError *error))failure;
+
+/**
+ Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding.
+
+ @param request A URL request identifying the location of the content to load. This must not be `nil`.
+ @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified.
+ @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified.
+@param progress A progress object monitoring the current download progress.
+ @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data.
+ @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred.
+ */
+- (void)loadRequest:(NSURLRequest *)request
+           MIMEType:(nullable NSString *)MIMEType
+   textEncodingName:(nullable NSString *)textEncodingName
+           progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
+            success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
+            failure:(nullable void (^)(NSError *error))failure;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

+ 162 - 0
Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m

@@ -0,0 +1,162 @@
+// UIWebView+AFNetworking.m
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIWebView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if TARGET_OS_IOS
+
+#import "AFHTTPSessionManager.h"
+#import "AFURLResponseSerialization.h"
+#import "AFURLRequestSerialization.h"
+
+@interface UIWebView (_AFNetworking)
+@property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask;
+@end
+
+@implementation UIWebView (_AFNetworking)
+
+- (NSURLSessionDataTask *)af_URLSessionTask {
+    return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask));
+}
+
+- (void)af_setURLSessionTask:(NSURLSessionDataTask *)af_URLSessionTask {
+    objc_setAssociatedObject(self, @selector(af_URLSessionTask), af_URLSessionTask, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIWebView (AFNetworking)
+
+- (AFHTTPSessionManager  *)sessionManager {
+    static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        _af_defaultHTTPSessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
+        _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer];
+        _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer];
+    });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+    return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager;
+#pragma clang diagnostic pop
+}
+
+- (void)setSessionManager:(AFHTTPSessionManager *)sessionManager {
+    objc_setAssociatedObject(self, @selector(sessionManager), sessionManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
+    static AFHTTPResponseSerializer <AFURLResponseSerialization> *_af_defaultResponseSerializer = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer];
+    });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+    return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setResponseSerializer:(AFHTTPResponseSerializer<AFURLResponseSerialization> *)responseSerializer {
+    objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)loadRequest:(NSURLRequest *)request
+           progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
+            success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
+            failure:(void (^)(NSError *error))failure
+{
+    [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) {
+        NSStringEncoding stringEncoding = NSUTF8StringEncoding;
+        if (response.textEncodingName) {
+            CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
+            if (encoding != kCFStringEncodingInvalidId) {
+                stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
+            }
+        }
+
+        NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding];
+        if (success) {
+            string = success(response, string);
+        }
+
+        return [string dataUsingEncoding:stringEncoding];
+    } failure:failure];
+}
+
+- (void)loadRequest:(NSURLRequest *)request
+           MIMEType:(NSString *)MIMEType
+   textEncodingName:(NSString *)textEncodingName
+           progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress
+            success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
+            failure:(void (^)(NSError *error))failure
+{
+    NSParameterAssert(request);
+
+    if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) {
+        [self.af_URLSessionTask cancel];
+    }
+    self.af_URLSessionTask = nil;
+
+    __weak __typeof(self)weakSelf = self;
+    NSURLSessionDataTask *dataTask;
+    dataTask = [self.sessionManager
+            GET:request.URL.absoluteString
+            parameters:nil
+            progress:nil
+            success:^(NSURLSessionDataTask * _Nonnull task, id  _Nonnull responseObject) {
+                __strong __typeof(weakSelf) strongSelf = weakSelf;
+                if (success) {
+                    success((NSHTTPURLResponse *)task.response, responseObject);
+                }
+                [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[task.currentRequest URL]];
+
+                if ([strongSelf.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
+                    [strongSelf.delegate webViewDidFinishLoad:strongSelf];
+                }
+            }
+            failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
+                if (failure) {
+                    failure(error);
+                }
+            }];
+    self.af_URLSessionTask = dataTask;
+    if (progress != nil) {
+        *progress = [self.sessionManager downloadProgressForTask:dataTask];
+    }
+    [self.af_URLSessionTask resume];
+
+    if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
+        [self.delegate webViewDidStartLoad:self];
+    }
+}
+
+@end
+
+#endif

+ 19 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/NSDate+OSS.h

@@ -0,0 +1,19 @@
+//
+//  NSDate+OSS.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/7/31.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+/**
+ Categories NSDate
+ */
+@interface NSDate (OSS)
++ (void)oss_setClockSkew:(NSTimeInterval)clockSkew;
++ (NSDate *)oss_dateFromString:(NSString *)string;
++ (NSDate *)oss_clockSkewFixedDate;
+- (NSString *)oss_asStringValue;
+@end

+ 49 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/NSDate+OSS.m

@@ -0,0 +1,49 @@
+//
+//  NSDate+OSS.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/7/31.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "NSDate+OSS.h"
+
+@implementation NSDate (OSS)
+
+NSString * const serverReturnDateFormat = @"EEE, dd MMM yyyy HH:mm:ss z";
+
+static NSTimeInterval _clockSkew = 0.0;
+
++ (void)oss_setClockSkew:(NSTimeInterval)clockSkew {
+    @synchronized(self) {
+        _clockSkew = clockSkew;
+    }
+}
+
++ (NSDate *)oss_clockSkewFixedDate {
+    NSTimeInterval skew = 0.0;
+    @synchronized(self) {
+        skew = _clockSkew;
+    }
+    return [[NSDate date] dateByAddingTimeInterval:(-1 * skew)];
+}
+
++ (NSDate *)oss_dateFromString:(NSString *)string {
+    NSDateFormatter *dateFormatter = [NSDateFormatter new];
+    dateFormatter.timeZone = [NSTimeZone timeZoneWithName:@"GMT"];
+    dateFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US"];
+    dateFormatter.dateFormat = serverReturnDateFormat;
+    
+    return [dateFormatter dateFromString:string];
+}
+
+- (NSString *)oss_asStringValue {
+    NSDateFormatter *dateFormatter = [NSDateFormatter new];
+    dateFormatter.timeZone = [NSTimeZone timeZoneWithName:@"GMT"];
+    dateFormatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US"];
+    dateFormatter.dateFormat = serverReturnDateFormat;
+    
+    return [dateFormatter stringFromDate:self];
+}
+
+@end

+ 15 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableData+OSS_CRC.h

@@ -0,0 +1,15 @@
+//
+//  NSMutableData+OSS_CRC.h
+//  AliyunOSSSDK
+//
+//  Created by 怀叙 on 2017/11/29.
+//  Copyright © 2017年 阿里云. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSMutableData (OSS_CRC)
+
+- (uint64_t)oss_crc64;
+
+@end

+ 19 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableData+OSS_CRC.m

@@ -0,0 +1,19 @@
+//
+//  NSMutableData+OSS_CRC.m
+//  AliyunOSSSDK
+//
+//  Created by 怀叙 on 2017/11/29.
+//  Copyright © 2017年 阿里云. All rights reserved.
+//
+
+#import "NSMutableData+OSS_CRC.h"
+#include "aos_crc64.h"
+
+@implementation NSMutableData (OSS_CRC)
+
+- (uint64_t)oss_crc64
+{
+    return aos_crc64(0, self.mutableBytes, self.length);
+}
+
+@end

+ 15 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableDictionary+OSS.h

@@ -0,0 +1,15 @@
+//
+//  NSMutableDictionary+OSS.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/8/1.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface NSMutableDictionary (OSS)
+
+- (void)oss_setObject:(id)anObject forKey:(id <NSCopying>)aKey;
+
+@end

+ 19 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/NSMutableDictionary+OSS.m

@@ -0,0 +1,19 @@
+//
+//  NSMutableDictionary+OSS.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/8/1.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "NSMutableDictionary+OSS.h"
+
+@implementation NSMutableDictionary (OSS)
+
+- (void)oss_setObject:(id)anObject forKey:(id <NSCopying>)aKey {
+    if (anObject && aKey) {
+        [self setObject:anObject forKey:aKey];
+    }
+}
+
+@end

+ 33 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSAllRequestNeededMessage.h

@@ -0,0 +1,33 @@
+//
+//  OSSAllRequestNeededMessage.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/22.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "OSSConstants.h"
+#import "OSSTask.h"
+
+/**
+ All necessary information in one OSS request.
+ */
+@interface OSSAllRequestNeededMessage : NSObject
+@property (nonatomic, strong) NSString *endpoint;
+@property (nonatomic, strong) NSString *httpMethod;
+@property (nonatomic, strong) NSString *bucketName;
+@property (nonatomic, strong) NSString *objectKey;
+@property (nonatomic, strong) NSString *contentType;
+@property (nonatomic, strong) NSString *contentMd5;
+@property (nonatomic, strong) NSString *range;
+@property (nonatomic, strong) NSString *date;
+@property (nonatomic, strong) NSMutableDictionary *headerParams;
+@property (nonatomic, copy) NSDictionary *params;
+@property (nonatomic, copy) NSString *contentSHA1;
+@property (nonatomic, assign) BOOL isHostInCnameExcludeList;
+
+
+- (OSSTask *)validateRequestParamsInOperationType:(OSSOperationType)operType;
+
+@end

+ 72 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSAllRequestNeededMessage.m

@@ -0,0 +1,72 @@
+//
+//  OSSAllRequestNeededMessage.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/22.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSAllRequestNeededMessage.h"
+
+#import "OSSDefine.h"
+#import "OSSUtil.h"
+
+@implementation OSSAllRequestNeededMessage
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        _date = [[NSDate oss_clockSkewFixedDate] oss_asStringValue];
+        _headerParams = [NSMutableDictionary dictionary];
+    }
+    return self;
+}
+
+- (void)setHeaderParams:(NSMutableDictionary *)headerParams {
+    if (!headerParams || [headerParams isEqualToDictionary:_headerParams]) {
+        return;
+    }
+    _headerParams = [headerParams mutableCopy];
+}
+
+- (OSSTask *)validateRequestParamsInOperationType:(OSSOperationType)operType {
+    NSString * errorMessage = nil;
+    
+    if (!self.endpoint) {
+        errorMessage = @"Endpoint should not be nil";
+    }
+    
+    if (!self.bucketName && operType != OSSOperationTypeGetService) {
+        errorMessage = @"Bucket name should not be nil";
+    }
+    
+    if (self.bucketName && ![OSSUtil validateBucketName:self.bucketName]) {
+        errorMessage = @"Bucket name invalid";
+    }
+    
+    if (!self.objectKey &&
+        (operType != OSSOperationTypeGetBucket && operType != OSSOperationTypeCreateBucket
+         && operType != OSSOperationTypeDeleteBucket && operType != OSSOperationTypeGetService
+         && operType != OSSOperationTypeGetBucketACL&& operType != OSSOperationTypeDeleteMultipleObjects
+         && operType != OSSOperationTypeListMultipartUploads
+         && operType != OSSOperationTypeGetBucketInfo)) {
+            errorMessage = @"Object key should not be nil";
+        }
+    
+    
+    
+    if (self.objectKey && ![OSSUtil validateObjectKey:self.objectKey]) {
+        errorMessage = @"Object key invalid";
+    }
+    
+    if (errorMessage) {
+        return [OSSTask taskWithError:[NSError errorWithDomain:OSSClientErrorDomain
+                                                          code:OSSClientErrorCodeInvalidArgument
+                                                      userInfo:@{OSSErrorMessageTOKEN: errorMessage}]];
+    } else {
+        return [OSSTask taskWithResult:nil];
+    }
+}
+
+@end

+ 431 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSClient.h

@@ -0,0 +1,431 @@
+//
+//  OSSClient.h
+//  oss_ios_sdk
+//
+//  Created by zhouzhuo on 8/16/15.
+//  Copyright (c) 2015 aliyun.com. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+@class OSSGetServiceRequest;
+@class OSSCreateBucketRequest;
+@class OSSDeleteBucketRequest;
+@class OSSHeadObjectRequest;
+@class OSSGetBucketRequest;
+@class OSSGetBucketACLRequest;
+@class OSSGetObjectRequest;
+@class OSSGetObjectACLRequest;
+@class OSSPutObjectRequest;
+@class OSSPutObjectACLRequest;
+@class OSSDeleteObjectRequest;
+@class OSSDeleteMultipleObjectsRequest;
+@class OSSCopyObjectRequest;
+@class OSSInitMultipartUploadRequest;
+@class OSSUploadPartRequest;
+@class OSSCompleteMultipartUploadRequest;
+@class OSSListPartsRequest;
+@class OSSListMultipartUploadsRequest;
+@class OSSAbortMultipartUploadRequest;
+@class OSSAppendObjectRequest;
+@class OSSResumableUploadRequest;
+@class OSSMultipartUploadRequest;
+@class OSSCallBackRequest;
+@class OSSImagePersistRequest;
+@class OSSGetBucketInfoRequest;
+@class OSSPutSymlinkRequest;
+@class OSSGetSymlinkRequest;
+@class OSSRestoreObjectRequest;
+
+@class OSSTask;
+@class OSSExecutor;
+@class OSSNetworking;
+@class OSSClientConfiguration;
+@protocol OSSCredentialProvider;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ OSSClient is the entry class to access OSS in an iOS client. It provides all the methods to communicate with OSS.
+ Generally speaking, only one instance of OSSClient is needed in the whole app.
+ */
+@interface OSSClient : NSObject
+
+/**
+ OSS endpoint. It varies in different regions. Please check out OSS official website for the exact endpoints for your data.
+ */
+@property (nonatomic, strong) NSString * endpoint;
+
+/**
+ The networking instance for sending and receiving data
+ */
+@property (nonatomic, strong) OSSNetworking * networking;
+
+/**
+ The credential provider instance
+ */
+@property (nonatomic, strong) id<OSSCredentialProvider> credentialProvider;
+
+/**
+ Client configuration instance
+ */
+@property (nonatomic, strong) OSSClientConfiguration * clientConfiguration;
+
+/**
+ oss operation task queue
+ */
+@property (nonatomic, strong, readonly) OSSExecutor * ossOperationExecutor;
+
+/**
+ Initializes an OSSClient instance with the default client configuration.
+ @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
+             For example: "https://oss-cn-hangzhou.aliyuncs.com"
+ @credentialProvider The credential provider
+ */
+- (instancetype)initWithEndpoint:(NSString *)endpoint
+              credentialProvider:(id<OSSCredentialProvider>) credentialProvider;
+
+/**
+ Initializes an OSSClient with the custom client configuration.
+ @endpoint it specifies domain of the bucket's region. Starting 2017, the domain must be prefixed with "https://" to follow Apple's ATS policy.
+             For example: "https://oss-cn-hangzhou.aliyuncs.com"
+ @credentialProvider The credential provider
+ @conf The custom client configuration such as retry time, timeout values, etc.
+ */
+- (instancetype)initWithEndpoint:(NSString *)endpoint
+              credentialProvider:(id<OSSCredentialProvider>)credentialProvider
+             clientConfiguration:(OSSClientConfiguration *)conf;
+
+#pragma mark restful-api
+
+/**
+ The corresponding RESTFul API: GetService
+ Gets all the buckets of the current user
+ Notes:
+ 1. STS is not supported yet in this call.
+ 2. When all buckets are returned, the xml in response body does not have nodes of Prefix, Marker, MaxKeys, IsTruncated and NextMarker.
+    If there're remaining buckets to return, the xml will have these nodes. The nextMarker is the value of marker in the next call.
+ */
+- (OSSTask *)getService:(OSSGetServiceRequest *)request;
+
+@end
+
+
+@interface OSSClient (Bucket)
+
+/**
+ The corresponding RESTFul API: PutBucket
+ Creates a bucket--it does not support anonymous access. By default, the datacenter used is oss-cn-hangzhou.
+ Callers could explicitly specify the datacenter for the bucket to optimize the performance and cost or meet the regulation requirement.
+ Notes:
+ 1. STS is not supported yet.
+ */
+- (OSSTask *)createBucket:(OSSCreateBucketRequest *)request;
+
+/**
+ The corresponding RESTFul API: DeleteBucket
+ Deletes a bucket.
+ */
+- (OSSTask *)deleteBucket:(OSSDeleteBucketRequest *)request;
+
+/**
+ The corresponding RESTFul API: GetBucket
+ Lists all objects in a bucket. It could be specified with filters such as prefix, marker, delimeter and max-keys.
+ */
+- (OSSTask *)getBucket:(OSSGetBucketRequest *)request;
+
+/**
+ The corresponding RESTFul API: GetBucketInfo
+ Gets the {@link Bucket}'s basic information as well as its ACL.
+ */
+- (OSSTask *)getBucketInfo:(OSSGetBucketInfoRequest *)request;
+
+/**
+ The corresponding RESTFul API: GetBucketACL
+ Gets the bucket ACL.
+ */
+- (OSSTask *)getBucketACL:(OSSGetBucketACLRequest *)request;
+
+@end
+
+
+@interface OSSClient (Object)
+
+/**
+ The corresponding RESTFul API: HeadObject
+ Gets the object's metadata information. The object's content is not returned.
+ */
+- (OSSTask *)headObject:(OSSHeadObjectRequest *)request;
+
+/**
+ The corresponding RESTFul API: GetObject
+ Gets the whole object (includes content). It requires caller have read permission on the object.
+ */
+- (OSSTask *)getObject:(OSSGetObjectRequest *)request;
+
+/**
+ The corresponding RESTFul API: GetObjectACL
+ get the acl of an object.
+ */
+- (OSSTask *)getObjectACL:(OSSGetObjectACLRequest *)request;
+
+/**
+ The corresponding RESTFul API: PutObject
+ Uploads a file.
+ */
+- (OSSTask *)putObject:(OSSPutObjectRequest *)request;
+
+/**
+ Sets the object's ACL. Right now an object has three access permissions: private, public-ready, public-read-write.
+ The operation specifies the x-oss-object-acl header in the put request. The caller must be the owner of the object.
+ If succeeds, it returns HTTP status 200; otherwise it returns related error code and error messages.
+ */
+- (OSSTask *)putObjectACL:(OSSPutObjectACLRequest *)request;
+
+/**
+ The corresponding RESTFul API: AppendObject
+ Appends data to an existing or non-existing object. The object created by this operation is appendable.
+ As a comparison, the object created by Put Object is normal (non-appendable).
+ */
+- (OSSTask *)appendObject:(OSSAppendObjectRequest *)request;
+
+/**
+ *  @brief      Appends data to an existing or non-existing object on the OSS server.
+ *              The object created by this operation is appendable.
+ *  @request    request
+ *  @crc64ecma  crc64ecma
+ *             if object has been stored on OSS server, you need to invoke headObject
+ *             api get object's crc64ecma,then use this api to append data to the
+ *             object.
+ */
+- (OSSTask *)appendObject:(OSSAppendObjectRequest *)request withCrc64ecma:(nullable NSString *)crc64ecma;
+
+/**
+ The corresponding RESTFul API: copyObject
+ Copies an existing object to another one.The operation sends a PUT request with x-oss-copy-source header to specify the source object.
+ OSS server side will detect and copy the object. If it succeeds, the new object's metadata information will be returned.
+ The operation applies for files less than 1GB. For big files, use UploadPartCopy RESTFul API.
+ */
+- (OSSTask *)copyObject:(OSSCopyObjectRequest *)request;
+
+/**
+ * Batch deletes the specified files under a specific bucket. If the files
+ * are non-exist, the operation will still return successful.
+ *
+ * @param request
+ *            A OSSDeleteMultipleObjectsRequest instance which specifies the
+ *            bucket and file keys to delete.
+ * @return A OSSTask with result of OSSDeleteMultipleObjectsResult instance which specifies each
+ *         file's result in normal mode or only failed deletions in quite
+ *         mode. By default it's quite mode.
+ */
+- (OSSTask *)deleteMultipleObjects:(OSSDeleteMultipleObjectsRequest *)request;
+
+/**
+ The corresponding RESTFul API: DeleteObject
+ Deletes an object
+ */
+- (OSSTask *)deleteObject:(OSSDeleteObjectRequest *)request;
+
+/**
+ * Creates a symbol link to a target file under the bucket---this is not
+ * supported for archive class bucket.
+ *
+ * @param request
+ *            A OSSPutSymlinkRequest instance that specifies the
+ *            bucket name, symlink name.
+ * @return An instance of OSSTask. On successful execution, `task.result` will
+ *         contain an instance of `OSSPutSymlinkResult`,otherwise will contain
+ *         an instance of NSError.
+ *
+ * for more information,please refer to https://help.aliyun.com/document_detail/45126.html
+ */
+- (OSSTask *)putSymlink:(OSSPutSymlinkRequest *)request;
+
+/**
+ * Gets the symlink information for the given symlink name.
+ *
+ * @param request
+ *            A OSSGetSymlinkRequest instance which specifies the bucket
+ *            name and symlink name.
+ * @return An instance of OSSTask. On successful execution, `task.result` will
+ *         contain an instance of `OSSGetSymlinkResult`,otherwise will contain
+ *         an instance of NSError.
+ *
+ * for more information,please refer to https://help.aliyun.com/document_detail/45146.html
+ */
+- (OSSTask *)getSymlink:(OSSGetSymlinkRequest *)request;
+
+/**
+ * Restores the object of archive storage. The function is not applicable to
+ * Normal or IA storage. The restoreObject() needs to be called prior to
+ * calling getObject() on an archive object.
+ *
+ * @param request
+ *          A container for the necessary parameters to execute the RestoreObject
+ *          service method.
+ *
+ * @return An instance of OSSTask. On successful execution, `task.result` will
+ *         contain an instance of `OSSRestoreObjectResult`,otherwise will contain
+ *         an instance of NSError.
+ *
+ * for more information,please refer to https://help.aliyun.com/document_detail/52930.html
+ */
+- (OSSTask *)restoreObject:(OSSRestoreObjectRequest *)request;
+
+@end
+
+@interface OSSClient (MultipartUpload)
+
+/**
+ The corresponding RESTFul API: InitiateMultipartUpload
+ Initiates a multipart upload to get a upload Id. It's needed before starting uploading parts data.
+ The upload Id is used for subsequential operations such as aborting the upload, querying the uploaded parts, etc.
+ */
+- (OSSTask *)multipartUploadInit:(OSSInitMultipartUploadRequest *)request;
+
+/**
+ The corresponding RESTFul API: UploadPart
+ After the multipart upload is initiated, this API could be called to upload the data to the target file with the upload Id.
+ Every uploaded part has a unique id called part number, which ranges from 1 to 10,000.
+ For a given upload Id, the part number identifies the specific range of the data in the whole file.
+ If the same part number is used for another upload, the existing data will be overwritten by the new upload.
+ Except the last part, all other part's minimal size is 100KB.
+ But no minimal size requirement on the last part.
+ */
+- (OSSTask *)uploadPart:(OSSUploadPartRequest *)request;
+
+/**
+ The corresponding RESTFul API: CompleteMultipartUpload
+ This API is to complete the multipart upload after all parts data have been uploaded.
+ It must be provided with a valid part list (each part has the part number and ETag).
+ OSS will validate every part and then complete the multipart upload.
+ If any part is invalid (e.g. the part is updated by another part upload), this API will fail.
+ */
+- (OSSTask *)completeMultipartUpload:(OSSCompleteMultipartUploadRequest *)request;
+
+/**
+ The corresponding RESTFul API: ListParts
+ Lists all uploaded parts of the specified upload id.
+ */
+- (OSSTask *)listParts:(OSSListPartsRequest *)request;
+
+/**
+ The corresponding RESTFul API: ListMultipartUploads
+ Lists all multipart uploads with the specified bucket.
+ */
+- (OSSTask *)listMultipartUploads:(OSSListMultipartUploadsRequest *)request;
+
+/**
+ The corresponding RESTFul API: AbortMultipartUpload
+ Aborts the multipart upload by the specified upload Id.
+ Once the multipart upload is aborted by this API, all parts data will be deleted and the upload Id is invalid anymore.
+ */
+- (OSSTask *)abortMultipartUpload:(OSSAbortMultipartUploadRequest *)request;
+
+- (OSSTask *)abortResumableMultipartUpload:(OSSResumableUploadRequest *)request;
+
+/**
+ Multipart upload API
+ */
+- (OSSTask *)multipartUpload:(OSSMultipartUploadRequest *)request;
+/**
+ TODOTODO
+ Resumable upload API
+ This API wraps the multipart upload and also enables resuming upload by reading/writing  the checkpoint data.
+ For a new file, multipartUploadInit() needs to be called first to get the upload Id. Then use this upload id to call this API to upload the data.
+ If the upload fails, checks the error messages:
+ If it's a recoverable error, then call this API again with the same upload Id to retry. The uploaded data will not be uploaded again.
+ Otherwise then you may need to recreates a new upload Id and call this method again.
+ Check out demo for the detail.
+ */
+- (OSSTask *)resumableUpload:(OSSResumableUploadRequest *)request;
+
+/**
+ * multipart upload sequentially in order,support resume upload
+ */
+- (OSSTask *)sequentialMultipartUpload:(OSSResumableUploadRequest *)request;
+
+@end
+
+
+@interface OSSClient (PresignURL)
+
+/**
+ Generates a signed URL for the object and anyone has this URL will get the GET permission on the object.
+ @bucketName object's bucket name
+ @objectKey Object name
+ @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object.
+ */
+- (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
+                                 withObjectKey:(NSString *)objectKey
+                        withExpirationInterval:(NSTimeInterval)interval;
+
+/**
+ Generates a signed URL for the object and anyone has this URL will get the specified permission on the object.
+ @bucketName object's bucket name
+ @objectKey Object name
+ @interval Expiration time in seconds. The URL could be specified with the expiration time to limit the access window on the object.
+ @parameter it could specify allowed HTTP methods
+ */
+- (OSSTask *)presignConstrainURLWithBucketName:(NSString *)bucketName
+                                 withObjectKey:(NSString *)objectKey
+                        withExpirationInterval:(NSTimeInterval)interval
+                                withParameters:(NSDictionary *)parameters;
+
+/** TODOTODO
+ If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing.
+ @bucketName Object's bucket name
+ @objectKey Object name
+ */
+- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
+                              withObjectKey:(NSString *)objectKey;
+
+/** TODOTODO
+ If the object's ACL is public read or public read-write, use this API to generate a signed url for sharing.
+ @bucketName Object's bucket name
+ @objectKey Object name
+ @parameter the request parameters.
+ */
+- (OSSTask *)presignPublicURLWithBucketName:(NSString *)bucketName
+                              withObjectKey:(NSString *)objectKey
+                             withParameters:(NSDictionary *)parameters;
+
+@end
+
+
+@interface OSSClient (ImageService)
+
+/*
+ * image persist action
+ * https://help.aliyun.com/document_detail/55811.html
+ */
+- (OSSTask *)imageActionPersist:(OSSImagePersistRequest *)request;
+
+@end
+
+
+@interface OSSClient (Utilities)
+
+/**
+ Checks if the object exists
+ @bucketName Object's bucket name
+ @objectKey Object name
+ 
+ return YES                     Object exists
+ return NO && *error = nil      Object does not exist
+ return NO && *error != nil     Error occured.
+ */
+- (BOOL)doesObjectExistInBucket:(NSString *)bucketName
+                      objectKey:(NSString *)objectKey
+                          error:(const NSError **)error;
+
+@end
+
+
+@interface OSSClient (Callback)
+
+- (OSSTask *)triggerCallBack:(OSSCallBackRequest *)request;
+
+@end
+
+NS_ASSUME_NONNULL_END

File diff suppressed because it is too large
+ 1986 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSClient.m


+ 85 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSCompat.h

@@ -0,0 +1,85 @@
+//
+//  OSSCompat.h
+//  oss_ios_sdk_new
+//
+//  Created by zhouzhuo on 9/10/15.
+//  Copyright (c) 2015 aliyun.com. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "OSSService.h"
+
+@class OSSCancellationTokenSource;
+
+typedef OSSCancellationTokenSource OSSTaskHandler;
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface OSSClient (Compat)
+
+/**
+ The old version's upload API.
+ Please use putObject instead.
+ */
+- (OSSTaskHandler *)uploadData:(NSData *)data
+               withContentType:(NSString *)contentType
+                withObjectMeta:(NSDictionary *)meta
+                  toBucketName:(NSString *)bucketName
+                   toObjectKey:(NSString *)objectKey
+                   onCompleted:(void(^)(BOOL, NSError *))onCompleted
+                    onProgress:(void(^)(float progress))onProgress;
+
+/**
+ The old version's download API.
+ Please use getObject instead.
+ */
+- (OSSTaskHandler *)downloadToDataFromBucket:(NSString *)bucketName
+                   objectKey:(NSString *)objectKey
+                 onCompleted:(void(^)(NSData *, NSError *))onCompleted
+                  onProgress:(void(^)(float progress))onProgress;
+
+/**
+ The old version's upload API.
+ Please use putObject instead.
+ */
+- (OSSTaskHandler *)uploadFile:(NSString *)filePath
+                withContentType:(NSString *)contentType
+                 withObjectMeta:(NSDictionary *)meta
+                   toBucketName:(NSString *)bucketName
+                    toObjectKey:(NSString *)objectKey
+                    onCompleted:(void(^)(BOOL, NSError *))onCompleted
+                     onProgress:(void(^)(float progress))onProgress;
+
+/**
+ The old version's download API.
+ Please use getObject instead.
+ */
+- (OSSTaskHandler *)downloadToFileFromBucket:(NSString *)bucketName
+                  objectKey:(NSString *)objectKey
+                     toFile:(NSString *)filePath
+                onCompleted:(void(^)(BOOL, NSError *))onCompleted
+                 onProgress:(void(^)(float progress))onProgress;
+
+
+/**
+ The old version's upload API with resumable upload support.
+ Please use resumableUpload instead.
+ */
+- (OSSTaskHandler *)resumableUploadFile:(NSString *)filePath
+          withContentType:(NSString *)contentType
+           withObjectMeta:(NSDictionary *)meta
+             toBucketName:(NSString *)bucketName
+              toObjectKey:(NSString *)objectKey
+              onCompleted:(void(^)(BOOL, NSError *))onCompleted
+               onProgress:(void(^)(float progress))onProgress;
+
+/**
+ The old version's delete API.
+ Please use deleteObject instead.
+ */
+- (void)deleteObjectInBucket:(NSString *)bucketName
+                   objectKey:(NSString *)objectKey
+                 onCompleted:(void(^)(BOOL, NSError *))onCompleted;
+@end
+
+NS_ASSUME_NONNULL_END

+ 260 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSCompat.m

@@ -0,0 +1,260 @@
+//
+//  OSSCompat.m
+//  oss_ios_sdk_new
+//
+//  Created by zhouzhuo on 9/10/15.
+//  Copyright (c) 2015 aliyun.com. All rights reserved.
+//
+
+#import "OSSDefine.h"
+#import "OSSCompat.h"
+#import "OSSBolts.h"
+#import "OSSModel.h"
+
+@implementation OSSClient (Compat)
+
+- (OSSTaskHandler *)uploadData:(NSData *)data
+               withContentType:(NSString *)contentType
+                withObjectMeta:(NSDictionary *)meta
+                  toBucketName:(NSString *)bucketName
+                   toObjectKey:(NSString *)objectKey
+                   onCompleted:(void(^)(BOOL, NSError *))onCompleted
+                    onProgress:(void(^)(float progress))onProgress {
+
+    OSSTaskHandler * bcts = [OSSCancellationTokenSource cancellationTokenSource];
+
+    [[[OSSTask taskWithResult:nil] continueWithExecutor:self.ossOperationExecutor withSuccessBlock:^id(OSSTask *task) {
+        OSSPutObjectRequest * put = [OSSPutObjectRequest new];
+        put.bucketName = bucketName;
+        put.objectKey = objectKey;
+        put.objectMeta = meta;
+        put.uploadingData = data;
+        put.contentType = contentType;
+
+        put.uploadProgress = ^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
+            if (totalBytesExpectedToSend) {
+                onProgress((float)totalBytesSent / totalBytesExpectedToSend);
+            }
+        };
+
+        [bcts.token registerCancellationObserverWithBlock:^{
+            [put cancel];
+        }];
+
+        OSSTask * putTask = [self putObject:put];
+        [putTask waitUntilFinished];
+        onProgress(1.0f);
+        return putTask;
+    }] continueWithBlock:^id(OSSTask *task) {
+        if (task.error) {
+            onCompleted(NO, task.error);
+        } else {
+            onCompleted(YES, nil);
+        }
+        return nil;
+    }];
+    return bcts;
+}
+
+- (OSSTaskHandler *)downloadToDataFromBucket:(NSString *)bucketName
+                                 objectKey:(NSString *)objectKey
+                               onCompleted:(void (^)(NSData *, NSError *))onCompleted
+                                onProgress:(void (^)(float))onProgress {
+
+    OSSTaskHandler * bcts = [OSSCancellationTokenSource cancellationTokenSource];
+
+    [[[OSSTask taskWithResult:nil] continueWithExecutor:self.ossOperationExecutor withBlock:^id(OSSTask *task) {
+        OSSGetObjectRequest * get = [OSSGetObjectRequest new];
+        get.bucketName = bucketName;
+        get.objectKey = objectKey;
+
+        get.downloadProgress = ^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
+            if (totalBytesExpectedToWrite) {
+                onProgress((float)totalBytesWritten / totalBytesExpectedToWrite);
+            }
+        };
+
+        [bcts.token registerCancellationObserverWithBlock:^{
+            [get cancel];
+        }];
+
+        OSSTask * getTask = [self getObject:get];
+        [getTask waitUntilFinished];
+        onProgress(1.0f);
+        return getTask;
+    }] continueWithBlock:^id(OSSTask *task) {
+        if (task.error) {
+            onCompleted(nil, task.error);
+        } else {
+            OSSGetObjectResult * result = task.result;
+            onCompleted(result.downloadedData, nil);
+        }
+        return nil;
+    }];
+
+    return bcts;
+}
+
+- (OSSTaskHandler *)downloadToFileFromBucket:(NSString *)bucketName
+                                 objectKey:(NSString *)objectKey
+                                    toFile:(NSString *)filePath
+                               onCompleted:(void (^)(BOOL, NSError *))onCompleted
+                                onProgress:(void (^)(float))onProgress {
+
+    OSSTaskHandler * bcts = [OSSCancellationTokenSource cancellationTokenSource];
+
+    [[[OSSTask taskWithResult:nil] continueWithExecutor:self.ossOperationExecutor withBlock:^id(OSSTask *task) {
+        OSSGetObjectRequest * get = [OSSGetObjectRequest new];
+        get.bucketName = bucketName;
+        get.objectKey = objectKey;
+        get.downloadToFileURL = [NSURL fileURLWithPath:filePath];
+
+        get.downloadProgress = ^(int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite) {
+            if (totalBytesExpectedToWrite) {
+                onProgress((float)totalBytesWritten / totalBytesExpectedToWrite);
+            }
+        };
+
+        [bcts.token registerCancellationObserverWithBlock:^{
+            [get cancel];
+        }];
+
+        OSSTask * getTask = [self getObject:get];
+        [getTask waitUntilFinished];
+        onProgress(1.0f);
+        return getTask;
+    }] continueWithBlock:^id(OSSTask *task) {
+        if (task.error) {
+            onCompleted(NO, task.error);
+        } else {
+            onCompleted(YES, nil);
+        }
+        return nil;
+    }];
+    
+    return bcts;
+}
+
+- (void)deleteObjectInBucket:(NSString *)bucketName
+                   objectKey:(NSString *)objectKey
+                 onCompleted:(void (^)(BOOL, NSError *))onCompleted {
+
+    [[[OSSTask taskWithResult:nil] continueWithExecutor:self.ossOperationExecutor withBlock:^id(OSSTask *task) {
+        OSSDeleteObjectRequest * delete = [OSSDeleteObjectRequest new];
+        delete.bucketName = bucketName;
+        delete.objectKey = objectKey;
+
+        OSSTask * deleteTask = [self deleteObject:delete];
+        [deleteTask waitUntilFinished];
+        return deleteTask;
+    }] continueWithBlock:^id(OSSTask *task) {
+        if (task.error) {
+            onCompleted(NO, task.error);
+        } else {
+            onCompleted(YES, nil);
+        }
+        return nil;
+    }];
+}
+
+- (OSSTaskHandler *)uploadFile:(NSString *)filePath
+               withContentType:(NSString *)contentType
+                withObjectMeta:(NSDictionary *)meta
+                  toBucketName:(NSString *)bucketName
+                   toObjectKey:(NSString *)objectKey
+                   onCompleted:(void (^)(BOOL, NSError *))onCompleted
+                    onProgress:(void (^)(float))onProgress {
+
+    OSSTaskHandler * bcts = [OSSCancellationTokenSource cancellationTokenSource];
+
+    [[[OSSTask taskWithResult:nil] continueWithExecutor:self.ossOperationExecutor withSuccessBlock:^id(OSSTask *task) {
+        OSSPutObjectRequest * put = [OSSPutObjectRequest new];
+        put.bucketName = bucketName;
+        put.objectKey = objectKey;
+        put.objectMeta = meta;
+        put.uploadingFileURL = [NSURL fileURLWithPath:filePath];
+        put.contentType = contentType;
+
+        put.uploadProgress = ^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
+            if (totalBytesExpectedToSend) {
+                onProgress((float)totalBytesSent / totalBytesExpectedToSend);
+            }
+        };
+
+        [bcts.token registerCancellationObserverWithBlock:^{
+            [put cancel];
+        }];
+
+        OSSTask * putTask = [self putObject:put];
+        [putTask waitUntilFinished];
+        onProgress(1.0f);
+        return putTask;
+    }] continueWithBlock:^id(OSSTask *task) {
+        if (task.error) {
+            onCompleted(NO, task.error);
+        } else {
+            onCompleted(YES, nil);
+        }
+        return nil;
+    }];
+    return bcts;
+}
+
+- (OSSTaskHandler *)resumableUploadFile:(NSString *)filePath
+                        withContentType:(NSString *)contentType
+                         withObjectMeta:(NSDictionary *)meta
+                           toBucketName:(NSString *)bucketName
+                            toObjectKey:(NSString *)objectKey
+                            onCompleted:(void(^)(BOOL, NSError *))onComplete
+                             onProgress:(void(^)(float progress))onProgress {
+
+    OSSTaskHandler * bcts = [OSSCancellationTokenSource cancellationTokenSource];
+
+    [[[OSSTask taskWithResult:nil] continueWithBlock:^id(OSSTask *task) {
+        NSURL * fileURL = [NSURL fileURLWithPath:filePath];
+        NSDate * lastModified;
+        NSError * error;
+        [fileURL getResourceValue:&lastModified forKey:NSURLContentModificationDateKey error:&error];
+        if (error) {
+            return [OSSTask taskWithError:error];
+        }
+        OSSResumableUploadRequest * resumableUpload = [OSSResumableUploadRequest new];
+        resumableUpload.bucketName = bucketName;
+        resumableUpload.deleteUploadIdOnCancelling = NO;//cancel not delete record file
+        resumableUpload.contentType = contentType;
+        resumableUpload.completeMetaHeader = meta;
+        NSString *cachesDir = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
+        resumableUpload.recordDirectoryPath = cachesDir; //default record file path
+        resumableUpload.uploadingFileURL = fileURL;
+        resumableUpload.objectKey = objectKey;
+        resumableUpload.uploadId = task.result;
+        resumableUpload.uploadingFileURL = [NSURL fileURLWithPath:filePath];
+        __weak OSSResumableUploadRequest * weakRef = resumableUpload;
+        resumableUpload.uploadProgress = ^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
+            onProgress((float)totalBytesSent/totalBytesExpectedToSend);
+            if (bcts.token.isCancellationRequested || bcts.isCancellationRequested) {
+                [weakRef cancel];
+            }
+            OSSLogDebugNoFile(@"%lld %lld %lld", bytesSent, totalBytesSent, totalBytesExpectedToSend);
+        };
+        return [self resumableUpload:resumableUpload];
+    }] continueWithBlock:^id(OSSTask *task) {
+        if (task.cancelled) {
+            onComplete(NO, [NSError errorWithDomain:OSSClientErrorDomain
+                                               code:OSSClientErrorCodeTaskCancelled
+                                           userInfo:@{OSSErrorMessageTOKEN: @"This task is cancelled"}]);
+        } else if (task.error) {
+            onComplete(NO, task.error);
+        } else if (task.faulted) {
+            onComplete(NO, [NSError errorWithDomain:OSSClientErrorDomain
+                                               code:OSSClientErrorCodeExcpetionCatched
+                                           userInfo:@{OSSErrorMessageTOKEN: [NSString stringWithFormat:@"Catch exception - %@", task.exception]}]);
+        } else {
+            onComplete(YES, nil);
+        }
+        return nil;
+    }];
+    return bcts;
+}
+
+@end

+ 129 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSConstants.h

@@ -0,0 +1,129 @@
+//
+//  OSSConstants.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/22.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef NSString* _Nullable (^OSSCustomSignContentBlock) (NSString * contentToSign, NSError **error);
+typedef NSData * _Nullable (^OSSResponseDecoderBlock) (NSData * data);
+
+typedef void (^OSSNetworkingUploadProgressBlock) (int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend);
+typedef void (^OSSNetworkingDownloadProgressBlock) (int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
+typedef void (^OSSNetworkingRetryBlock) (void);
+typedef void (^OSSNetworkingCompletionHandlerBlock) (id _Nullable responseObject, NSError * _Nullable error);
+typedef void (^OSSNetworkingOnRecieveDataBlock) (NSData * data);
+
+/**
+ The flag of verification about crc64
+ */
+typedef NS_ENUM(NSUInteger, OSSRequestCRCFlag) {
+    OSSRequestCRCUninitialized,
+    OSSRequestCRCOpen,
+    OSSRequestCRCClosed
+};
+
+/**
+ Retry type definition
+ */
+typedef NS_ENUM(NSInteger, OSSNetworkingRetryType) {
+    OSSNetworkingRetryTypeUnknown,
+    OSSNetworkingRetryTypeShouldRetry,
+    OSSNetworkingRetryTypeShouldNotRetry,
+    OSSNetworkingRetryTypeShouldRefreshCredentialsAndRetry,
+    OSSNetworkingRetryTypeShouldCorrectClockSkewAndRetry
+};
+
+/**
+ * @brief: The following constants are provided by OSSNetworking as possible operation types.
+ */
+typedef NS_ENUM(NSInteger, OSSOperationType) {
+    OSSOperationTypeGetService,
+    OSSOperationTypeCreateBucket,
+    OSSOperationTypeDeleteBucket,
+    OSSOperationTypeGetBucket,
+    OSSOperationTypeGetBucketInfo,
+    OSSOperationTypeGetBucketACL,
+    OSSOperationTypeHeadObject,
+    OSSOperationTypeGetObject,
+    OSSOperationTypeGetObjectACL,
+    OSSOperationTypePutObject,
+    OSSOperationTypePutObjectACL,
+    OSSOperationTypeAppendObject,
+    OSSOperationTypeDeleteObject,
+    OSSOperationTypeDeleteMultipleObjects,
+    OSSOperationTypeCopyObject,
+    OSSOperationTypeInitMultipartUpload,
+    OSSOperationTypeUploadPart,
+    OSSOperationTypeCompleteMultipartUpload,
+    OSSOperationTypeAbortMultipartUpload,
+    OSSOperationTypeListMultipart,
+    OSSOperationTypeListMultipartUploads,
+    OSSOperationTypeTriggerCallBack,
+    OSSOperationTypeImagePersist,
+    OSSOperationTypeRestoreObject,
+    OSSOperationTypePutSymlink,
+    OSSOperationTypeGetSymlink,
+};
+
+/**
+ * @brief: The following constants are provided by OSSClient as possible error codes.
+ */
+typedef NS_ENUM(NSInteger, OSSClientErrorCODE) {
+    OSSClientErrorCodeNetworkingFailWithResponseCode0,
+    OSSClientErrorCodeSignFailed,
+    OSSClientErrorCodeFileCantWrite,
+    OSSClientErrorCodeInvalidArgument,
+    OSSClientErrorCodeNilUploadid,
+    OSSClientErrorCodeTaskCancelled,
+    OSSClientErrorCodeNetworkError,
+    OSSClientErrorCodeInvalidCRC,
+    OSSClientErrorCodeCannotResumeUpload,
+    OSSClientErrorCodeExcpetionCatched,
+    OSSClientErrorCodeNotKnown
+};
+
+typedef NS_ENUM(NSInteger, OSSXMLDictionaryAttributesMode)
+{
+    OSSXMLDictionaryAttributesModePrefixed = 0, //default
+    OSSXMLDictionaryAttributesModeDictionary,
+    OSSXMLDictionaryAttributesModeUnprefixed,
+    OSSXMLDictionaryAttributesModeDiscard
+};
+
+
+typedef NS_ENUM(NSInteger, OSSXMLDictionaryNodeNameMode)
+{
+    OSSXMLDictionaryNodeNameModeRootOnly = 0, //default
+    OSSXMLDictionaryNodeNameModeAlways,
+    OSSXMLDictionaryNodeNameModeNever
+};
+
+typedef NS_ENUM(NSInteger, OSSBucketStorageClass)
+{
+    OSSBucketStorageClassStandard,
+    OSSBucketStorageClassIA,
+    OSSBucketStorageClassArchive
+};
+
+typedef NSString * OSSXMLDictionaryAttributeName NS_EXTENSIBLE_STRING_ENUM;
+
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributesKey;
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryCommentsKey;
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryTextKey;
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryNodeNameKey;
+OBJC_EXTERN OSSXMLDictionaryAttributeName const OSSXMLDictionaryAttributePrefix;
+
+OBJC_EXTERN NSString * const OSSHTTPMethodHEAD;
+OBJC_EXTERN NSString * const OSSHTTPMethodGET;
+OBJC_EXTERN NSString * const OSSHTTPMethodPUT;
+OBJC_EXTERN NSString * const OSSHTTPMethodPOST;
+OBJC_EXTERN NSString * const OSSHTTPMethodDELETE;
+
+
+NS_ASSUME_NONNULL_END

+ 21 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSConstants.m

@@ -0,0 +1,21 @@
+//
+//  OSSConstants.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/22.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSConstants.h"
+
+NSString * const OSSXMLDictionaryAttributesKey = @"__attributes";
+NSString * const OSSXMLDictionaryCommentsKey = @"__comments";
+NSString * const OSSXMLDictionaryTextKey = @"__text";
+NSString * const OSSXMLDictionaryNodeNameKey = @"__name";
+NSString * const OSSXMLDictionaryAttributePrefix = @"_";
+
+NSString * const OSSHTTPMethodHEAD = @"HEAD";
+NSString * const OSSHTTPMethodGET = @"GET";
+NSString * const OSSHTTPMethodPUT = @"PUT";
+NSString * const OSSHTTPMethodPOST = @"POST";
+NSString * const OSSHTTPMethodDELETE = @"DELETE";

+ 84 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDefine.h

@@ -0,0 +1,84 @@
+//
+//  OSSDefine.h
+//  AliyunOSSiOS
+//
+//  Created by zhouzhuo on 5/1/16.
+//  Copyright © 2016 zhouzhuo. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#ifndef OSSDefine_h
+#define OSSDefine_h
+
+#if TARGET_OS_IOS
+#define OSSUAPrefix                             @"aliyun-sdk-ios"
+#elif TARGET_OS_OSX
+#define OSSUAPrefix                             @"aliyun-sdk-mac"
+#endif
+#define OSSSDKVersion                           @"2.10.5"
+
+#define OSSListBucketResultXMLTOKEN             @"ListBucketResult"
+#define OSSNameXMLTOKEN                         @"Name"
+#define OSSDelimiterXMLTOKEN                    @"Delimiter"
+#define OSSMarkerXMLTOKEN                       @"Marker"
+#define OSSKeyMarkerXMLTOKEN                    @"KeyMarker"
+#define OSSNextMarkerXMLTOKEN                   @"NextMarker"
+#define OSSNextKeyMarkerXMLTOKEN                @"NextKeyMarker"
+#define OSSUploadIdMarkerXMLTOKEN               @"UploadIdMarker"
+#define OSSNextUploadIdMarkerXMLTOKEN           @"NextUploadIdMarker"
+#define OSSMaxKeysXMLTOKEN                      @"MaxKeys"
+#define OSSMaxUploadsXMLTOKEN                   @"MaxUploads"
+#define OSSIsTruncatedXMLTOKEN                  @"IsTruncated"
+#define OSSContentsXMLTOKEN                     @"Contents"
+#define OSSUploadXMLTOKEN                       @"Upload"
+#define OSSKeyXMLTOKEN                          @"Key"
+#define OSSLastModifiedXMLTOKEN                 @"LastModified"
+#define OSSETagXMLTOKEN                         @"ETag"
+#define OSSTypeXMLTOKEN                         @"Type"
+#define OSSSizeXMLTOKEN                         @"Size"
+#define OSSStorageClassXMLTOKEN                 @"StorageClass"
+#define OSSCommonPrefixesXMLTOKEN               @"CommonPrefixes"
+#define OSSOwnerXMLTOKEN                        @"Owner"
+#define OSSAccessControlListXMLTOKEN            @"AccessControlList"
+#define OSSGrantXMLTOKEN                        @"Grant"
+#define OSSIDXMLTOKEN                           @"ID"
+#define OSSDisplayNameXMLTOKEN                  @"DisplayName"
+#define OSSBucketsXMLTOKEN                      @"Buckets"
+#define OSSBucketXMLTOKEN                       @"Bucket"
+#define OSSCreationDate                         @"CreationDate"
+#define OSSPrefixXMLTOKEN                       @"Prefix"
+#define OSSUploadIdXMLTOKEN                     @"UploadId"
+#define OSSLocationXMLTOKEN                     @"Location"
+#define OSSNextPartNumberMarkerXMLTOKEN         @"NextPartNumberMarker"
+#define OSSMaxPartsXMLTOKEN                     @"MaxParts"
+#define OSSPartXMLTOKEN                         @"Part"
+#define OSSPartNumberXMLTOKEN                   @"PartNumber"
+
+#define OSSClientErrorDomain                    @"com.aliyun.oss.clientError"
+#define OSSServerErrorDomain                    @"com.aliyun.oss.serverError"
+
+#define OSSErrorMessageTOKEN                    @"ErrorMessage"
+
+#define OSSHttpHeaderContentDisposition         @"Content-Disposition"
+#define OSSHttpHeaderXOSSCallback               @"x-oss-callback"
+#define OSSHttpHeaderXOSSCallbackVar            @"x-oss-callback-var"
+#define OSSHttpHeaderContentEncoding            @"Content-Encoding"
+#define OSSHttpHeaderContentType                @"Content-Type"
+#define OSSHttpHeaderContentMD5                 @"Content-MD5"
+#define OSSHttpHeaderCacheControl               @"Cache-Control"
+#define OSSHttpHeaderExpires                    @"Expires"
+#define OSSHttpHeaderHashSHA1                   @"x-oss-hash-sha1"
+#define OSSHttpHeaderBucketACL                  @"x-oss-acl"
+#define OSSHttpHeaderObjectACL                  @"x-oss-object-acl"
+#define OSSHttpHeaderCopySource                 @"x-oss-copy-source"
+#define OSSHttpHeaderSymlinkTarget              @"x-oss-symlink-target"
+
+#define OSSHttpQueryProcess                     @"x-oss-process"
+
+#define OSSDefaultRetryCount                    3
+#define OSSDefaultMaxConcurrentNum              5
+#define OSSDefaultTimeoutForRequestInSecond     15
+#define OSSDefaultTimeoutForResourceInSecond    7 * 24 * 60 * 60
+
+#endif /* OSSDefine_h */

+ 31 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsRequest.h

@@ -0,0 +1,31 @@
+//
+//  OSSDeleteMultipleObjectsRequest.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+#import <Foundation/Foundation.h>
+#import "OSSRequest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface OSSDeleteMultipleObjectsRequest : OSSRequest
+
+@property (nonatomic, copy) NSString *bucketName;
+
+@property (nonatomic, copy) NSArray<NSString *> *keys;
+
+/**
+ invalid value is @"url"
+ */
+@property (nonatomic, copy, nullable) NSString *encodingType;
+
+/**
+ whether to show verbose result,the default value is YES.
+ */
+@property (nonatomic, assign) BOOL quiet;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 22 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsRequest.m

@@ -0,0 +1,22 @@
+//
+//  OSSDeleteMultipleObjectsRequest.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSDeleteMultipleObjectsRequest.h"
+
+@implementation OSSDeleteMultipleObjectsRequest
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        _quiet = YES;
+    }
+    return self;
+}
+
+@end

+ 17 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsResult.h

@@ -0,0 +1,17 @@
+//
+//  OSSDeleteMultipleObjectsResult.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSResult.h"
+
+@interface OSSDeleteMultipleObjectsResult : OSSResult
+
+@property (nonatomic, copy) NSArray<NSString *> *deletedObjects;
+
+@property (nonatomic, copy) NSString *encodingType;
+
+@end

+ 13 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSDeleteMultipleObjectsResult.m

@@ -0,0 +1,13 @@
+//
+//  OSSDeleteMultipleObjectsResult.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSDeleteMultipleObjectsResult.h"
+
+@implementation OSSDeleteMultipleObjectsResult
+
+@end

+ 75 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSCocoaLumberjack.h

@@ -0,0 +1,75 @@
+// Software License Agreement (BSD License)
+//
+// Copyright (c) 2010-2016, Deusty, LLC
+// All rights reserved.
+//
+// Redistribution and use of this software in source and binary forms,
+// with or without modification, are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+//   this list of conditions and the following disclaimer.
+//
+// * Neither the name of Deusty nor the names of its contributors may be used
+//   to endorse or promote products derived from this software without specific
+//   prior written permission of Deusty, LLC.
+
+/**
+ * Welcome to CocoaLumberjack!
+ *
+ * The project page has a wealth of documentation if you have any questions.
+ *
+ * If you're new to the project you may wish to read "Getting Started" at:
+ * Documentation/GettingStarted.md
+ *
+ * Otherwise, here is a quick refresher.
+ * There are three steps to using the macros:
+ *
+ * Step 1:
+ * Import the header in your implementation or prefix file:
+ *
+ * #import <CocoaLumberjack/CocoaLumberjack.h>
+ *
+ * Step 2:
+ * Define your logging level in your implementation file:
+ *
+ * // Log levels: off, error, warn, info, verbose
+ * static const DDLogLevel ddLogLevel = DDLogLevelVerbose;
+ *
+ * Step 2 [3rd party frameworks]:
+ *
+ * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel:
+ *
+ * // #undef LOG_LEVEL_DEF // Undefine first only if needed
+ * #define LOG_LEVEL_DEF myLibLogLevel
+ *
+ * Define your logging level in your implementation file:
+ *
+ * // Log levels: off, error, warn, info, verbose
+ * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose;
+ *
+ * Step 3:
+ * Replace your NSLog statements with DDLog statements according to the severity of the message.
+ *
+ * NSLog(@"Fatal error, no dohickey found!"); -> OSSLogError(@"Fatal error, no dohickey found!");
+ *
+ * DDLog works exactly the same as NSLog.
+ * This means you can pass it multiple variables just like NSLog.
+ **/
+
+#import <Foundation/Foundation.h>
+
+// Disable legacy macros
+#ifndef OSSDD_LEGACY_MACROS
+    #define OSSDD_LEGACY_MACROS 0
+#endif
+
+// Core
+#import "OSSDDLog.h"
+
+// Main macros
+#import "OSSLogMacros.h"
+
+// Loggers
+#import "OSSFileLogger.h"
+#import "OSSNSLogger.h"
+

+ 860 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSDDLog.h

@@ -0,0 +1,860 @@
+// Software License Agreement (BSD License)
+//
+// Copyright (c) 2010-2016, Deusty, LLC
+// All rights reserved.
+//
+// Redistribution and use of this software in source and binary forms,
+// with or without modification, are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+//   this list of conditions and the following disclaimer.
+//
+// * Neither the name of Deusty nor the names of its contributors may be used
+//   to endorse or promote products derived from this software without specific
+//   prior written permission of Deusty, LLC.
+
+#import <Foundation/Foundation.h>
+
+// Enable 1.9.x legacy macros if imported directly
+#ifndef OSSDD_LEGACY_MACROS
+    #define OSSDD_LEGACY_MACROS 1
+#endif
+
+#if OS_OBJECT_USE_OBJC
+    #define DISPATCH_QUEUE_REFERENCE_TYPE strong
+#else
+    #define DISPATCH_QUEUE_REFERENCE_TYPE assign
+#endif
+
+@class OSSDDLogMessage;
+@class OSSDDLoggerInformation;
+@protocol OSSDDLogger;
+@protocol OSSDDLogFormatter;
+
+/**
+ * Define the standard options.
+ *
+ * We default to only 4 levels because it makes it easier for beginners
+ * to make the transition to a logging framework.
+ *
+ * More advanced users may choose to completely customize the levels (and level names) to suite their needs.
+ * For more information on this see the "Custom Log Levels" page:
+ * Documentation/CustomLogLevels.md
+ *
+ * Advanced users may also notice that we're using a bitmask.
+ * This is to allow for custom fine grained logging:
+ * Documentation/FineGrainedLogging.md
+ *
+ * -- Flags --
+ *
+ * Typically you will use the LOG_LEVELS (see below), but the flags may be used directly in certain situations.
+ * For example, say you have a lot of warning log messages, and you wanted to disable them.
+ * However, you still needed to see your error and info log messages.
+ * You could accomplish that with the following:
+ *
+ * static const DDLogLevel ddLogLevel = DDLogFlagError | DDLogFlagInfo;
+ *
+ * When LOG_LEVEL_DEF is defined as ddLogLevel.
+ *
+ * Flags may also be consulted when writing custom log formatters,
+ * as the DDLogMessage class captures the individual flag that caused the log message to fire.
+ *
+ * -- Levels --
+ *
+ * Log levels are simply the proper bitmask of the flags.
+ *
+ * -- Booleans --
+ *
+ * The booleans may be used when your logging code involves more than one line.
+ * For example:
+ *
+ * if (LOG_VERBOSE) {
+ *     for (id sprocket in sprockets)
+ *         DDLogVerbose(@"sprocket: %@", [sprocket description])
+ * }
+ *
+ * -- Async --
+ *
+ * Defines the default asynchronous options.
+ * The default philosophy for asynchronous logging is very simple:
+ *
+ * Log messages with errors should be executed synchronously.
+ *     After all, an error just occurred. The application could be unstable.
+ *
+ * All other log messages, such as debug output, are executed asynchronously.
+ *     After all, if it wasn't an error, then it was just informational output,
+ *     or something the application was easily able to recover from.
+ *
+ * -- Changes --
+ *
+ * You are strongly discouraged from modifying this file.
+ * If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project.
+ * Instead, create your own MyLogging.h or ApplicationNameLogging.h or CompanyLogging.h
+ *
+ * For an example of customizing your logging experience, see the "Custom Log Levels" page:
+ * Documentation/CustomLogLevels.md
+ **/
+
+/**
+ *  Flags accompany each log. They are used together with levels to filter out logs.
+ */
+typedef NS_OPTIONS(NSUInteger, OSSDDLogFlag){
+    /**
+     *  0...00001 DDLogFlagError
+     */
+    OSSDDLogFlagError      = (1 << 0),
+    
+    /**
+     *  0...00010 DDLogFlagWarning
+     */
+    OSSDDLogFlagWarning    = (1 << 1),
+    
+    /**
+     *  0...00100 DDLogFlagInfo
+     */
+    OSSDDLogFlagInfo       = (1 << 2),
+    
+    /**
+     *  0...01000 DDLogFlagDebug
+     */
+    OSSDDLogFlagDebug      = (1 << 3),
+    
+    /**
+     *  0...10000 DDLogFlagVerbose
+     */
+    OSSDDLogFlagVerbose    = (1 << 4)
+};
+
+/**
+ *  Log levels are used to filter out logs. Used together with flags.
+ */
+typedef NS_ENUM(NSUInteger, OSSDDLogLevel){
+    /**
+     *  No logs
+     */
+    OSSDDLogLevelOff       = 0,
+    
+    /**
+     *  Error logs only
+     */
+    OSSDDLogLevelError     = (OSSDDLogFlagError),
+    
+    /**
+     *  Error and warning logs
+     */
+    OSSDDLogLevelWarning   = (OSSDDLogLevelError   | OSSDDLogFlagWarning),
+    
+    /**
+     *  Error, warning and info logs
+     */
+    OSSDDLogLevelInfo      = (OSSDDLogLevelWarning | OSSDDLogFlagInfo),
+    
+    /**
+     *  Error, warning, info and debug logs
+     */
+    OSSDDLogLevelDebug     = (OSSDDLogLevelInfo    | OSSDDLogFlagDebug),
+    
+    /**
+     *  Error, warning, info, debug and verbose logs
+     */
+    OSSDDLogLevelVerbose   = (OSSDDLogLevelDebug   | OSSDDLogFlagVerbose),
+    
+    /**
+     *  All logs (1...11111)
+     */
+    OSSDDLogLevelAll       = NSUIntegerMax
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ *  Extracts just the file name, no path or extension
+ *
+ *  @param filePath input file path
+ *  @param copy     YES if we want the result to be copied
+ *
+ *  @return the file name
+ */
+NSString * __nullable OSSDDExtractFileNameWithoutExtension(const char *filePath, BOOL copy);
+
+/**
+ * The THIS_FILE macro gives you an NSString of the file name.
+ * For simplicity and clarity, the file name does not include the full path or file extension.
+ *
+ * For example: DDLogWarn(@"%@: Unable to find thingy", THIS_FILE) -> @"MyViewController: Unable to find thingy"
+ **/
+#define THIS_FILE         (DDExtractFileNameWithoutExtension(__FILE__, NO))
+
+/**
+ * The THIS_METHOD macro gives you the name of the current objective-c method.
+ *
+ * For example: DDLogWarn(@"%@ - Requires non-nil strings", THIS_METHOD) -> @"setMake:model: requires non-nil strings"
+ *
+ * Note: This does NOT work in straight C functions (non objective-c).
+ * Instead you should use the predefined __FUNCTION__ macro.
+ **/
+#define THIS_METHOD       NSStringFromSelector(_cmd)
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  The main class, exposes all logging mechanisms, loggers, ...
+ *  For most of the users, this class is hidden behind the logging functions like `DDLogInfo`
+ */
+@interface OSSDDLog : NSObject
+
+/**
+ *  Returns the singleton `DDLog`.
+ *  The instance is used by `DDLog` class methods.
+ */
+@property (class, nonatomic, strong, readonly) OSSDDLog *sharedInstance;
+
+/**
+ * Provides access to the underlying logging queue.
+ * This may be helpful to Logger classes for things like thread synchronization.
+ **/
+@property (class, nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggingQueue;
+
+/**
+ * Logging Primitive.
+ *
+ * This method is used by the macros or logging functions.
+ * It is suggested you stick with the macros as they're easier to use.
+ *
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
+ *  @param level        the log level
+ *  @param flag         the log flag
+ *  @param context      the context (if any is defined)
+ *  @param file         the current file
+ *  @param function     the current function
+ *  @param line         the current code line
+ *  @param tag          potential tag
+ *  @param format       the log format
+ */
++ (void)log:(BOOL)asynchronous
+      level:(OSSDDLogLevel)level
+       flag:(OSSDDLogFlag)flag
+    context:(NSInteger)context
+       file:(const char *)file
+   function:(const char *)function
+       line:(NSUInteger)line
+        tag:(id __nullable)tag
+     format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10);
+
+/**
+ * Logging Primitive.
+ *
+ * This method is used by the macros or logging functions.
+ * It is suggested you stick with the macros as they're easier to use.
+ *
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
+ *  @param level        the log level
+ *  @param flag         the log flag
+ *  @param context      the context (if any is defined)
+ *  @param file         the current file
+ *  @param function     the current function
+ *  @param line         the current code line
+ *  @param tag          potential tag
+ *  @param format       the log format
+ */
+- (void)log:(BOOL)asynchronous
+      level:(OSSDDLogLevel)level
+       flag:(OSSDDLogFlag)flag
+    context:(NSInteger)context
+       file:(const char *)file
+   function:(const char *)function
+       line:(NSUInteger)line
+        tag:(id __nullable)tag
+     format:(NSString *)format, ... NS_FORMAT_FUNCTION(9,10);
+
+/**
+ * Logging Primitive.
+ *
+ * This method can be used if you have a prepared va_list.
+ * Similar to `log:level:flag:context:file:function:line:tag:format:...`
+ *
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
+ *  @param level        the log level
+ *  @param flag         the log flag
+ *  @param context      the context (if any is defined)
+ *  @param file         the current file
+ *  @param function     the current function
+ *  @param line         the current code line
+ *  @param tag          potential tag
+ *  @param format       the log format
+ *  @param argList      the arguments list as a va_list
+ */
++ (void)log:(BOOL)asynchronous
+      level:(OSSDDLogLevel)level
+       flag:(OSSDDLogFlag)flag
+    context:(NSInteger)context
+       file:(const char *)file
+   function:(const char *)function
+       line:(NSUInteger)line
+        tag:(id __nullable)tag
+     format:(NSString *)format
+       args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:));
+
+/**
+ * Logging Primitive.
+ *
+ * This method can be used if you have a prepared va_list.
+ * Similar to `log:level:flag:context:file:function:line:tag:format:...`
+ *
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
+ *  @param level        the log level
+ *  @param flag         the log flag
+ *  @param context      the context (if any is defined)
+ *  @param file         the current file
+ *  @param function     the current function
+ *  @param line         the current code line
+ *  @param tag          potential tag
+ *  @param format       the log format
+ *  @param argList      the arguments list as a va_list
+ */
+- (void)log:(BOOL)asynchronous
+      level:(OSSDDLogLevel)level
+       flag:(OSSDDLogFlag)flag
+    context:(NSInteger)context
+       file:(const char *)file
+   function:(const char *)function
+       line:(NSUInteger)line
+        tag:(id __nullable)tag
+     format:(NSString *)format
+       args:(va_list)argList NS_SWIFT_NAME(log(asynchronous:level:flag:context:file:function:line:tag:format:arguments:));
+
+/**
+ * Logging Primitive.
+ *
+ * This method can be used if you manualy prepared DDLogMessage.
+ *
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
+ *  @param logMessage   the log message stored in a `DDLogMessage` model object
+ */
++ (void)log:(BOOL)asynchronous
+    message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:));
+
+/**
+ * Logging Primitive.
+ *
+ * This method can be used if you manualy prepared DDLogMessage.
+ *
+ *  @param asynchronous YES if the logging is done async, NO if you want to force sync
+ *  @param logMessage   the log message stored in a `DDLogMessage` model object
+ */
+- (void)log:(BOOL)asynchronous
+    message:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(asynchronous:message:));
+
+/**
+ * Since logging can be asynchronous, there may be times when you want to flush the logs.
+ * The framework invokes this automatically when the application quits.
+ **/
++ (void)flushLog;
+
+/**
+ * Since logging can be asynchronous, there may be times when you want to flush the logs.
+ * The framework invokes this automatically when the application quits.
+ **/
+- (void)flushLog;
+
+/**
+ * Loggers
+ *
+ * In order for your log statements to go somewhere, you should create and add a logger.
+ *
+ * You can add multiple loggers in order to direct your log statements to multiple places.
+ * And each logger can be configured separately.
+ * So you could have, for example, verbose logging to the console, but a concise log file with only warnings & errors.
+ **/
+
+/**
+ * Adds the logger to the system.
+ *
+ * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`.
+ **/
++ (void)addLogger:(id <OSSDDLogger>)logger;
+
+/**
+ * Adds the logger to the system.
+ *
+ * This is equivalent to invoking `[DDLog addLogger:logger withLogLevel:DDLogLevelAll]`.
+ **/
+- (void)addLogger:(id <OSSDDLogger>)logger;
+
+/**
+ * Adds the logger to the system.
+ *
+ * The level that you provide here is a preemptive filter (for performance).
+ * That is, the level specified here will be used to filter out logMessages so that
+ * the logger is never even invoked for the messages.
+ *
+ * More information:
+ * When you issue a log statement, the logging framework iterates over each logger,
+ * and checks to see if it should forward the logMessage to the logger.
+ * This check is done using the level parameter passed to this method.
+ *
+ * For example:
+ *
+ * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];`
+ * `[DDLog addLogger:fileLogger    withLogLevel:DDLogLevelWarning];`
+ *
+ * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger
+ * `DDLogInfo(@"hi");`     => gets forwarded to consoleLogger only
+ *
+ * It is important to remember that Lumberjack uses a BITMASK.
+ * Many developers & third party frameworks may define extra log levels & flags.
+ * For example:
+ *
+ * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000`
+ *
+ * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages.
+ *
+ * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO`
+ *
+ * Consider passing `DDLogLevelAll` to this method, which has all bits set.
+ * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set,
+ * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug:
+ *
+ * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)`
+ **/
++ (void)addLogger:(id <OSSDDLogger>)logger withLevel:(OSSDDLogLevel)level;
+
+/**
+ * Adds the logger to the system.
+ *
+ * The level that you provide here is a preemptive filter (for performance).
+ * That is, the level specified here will be used to filter out logMessages so that
+ * the logger is never even invoked for the messages.
+ *
+ * More information:
+ * When you issue a log statement, the logging framework iterates over each logger,
+ * and checks to see if it should forward the logMessage to the logger.
+ * This check is done using the level parameter passed to this method.
+ *
+ * For example:
+ *
+ * `[DDLog addLogger:consoleLogger withLogLevel:DDLogLevelVerbose];`
+ * `[DDLog addLogger:fileLogger    withLogLevel:DDLogLevelWarning];`
+ *
+ * `DDLogError(@"oh no");` => gets forwarded to consoleLogger & fileLogger
+ * `DDLogInfo(@"hi");`     => gets forwarded to consoleLogger only
+ *
+ * It is important to remember that Lumberjack uses a BITMASK.
+ * Many developers & third party frameworks may define extra log levels & flags.
+ * For example:
+ *
+ * `#define SOME_FRAMEWORK_LOG_FLAG_TRACE (1 << 6) // 0...1000000`
+ *
+ * So if you specify `DDLogLevelVerbose` to this method, you won't see the framework's trace messages.
+ *
+ * `(SOME_FRAMEWORK_LOG_FLAG_TRACE & DDLogLevelVerbose) => (01000000 & 00011111) => NO`
+ *
+ * Consider passing `DDLogLevelAll` to this method, which has all bits set.
+ * You can also use the exclusive-or bitwise operator to get a bitmask that has all flags set,
+ * except the ones you explicitly don't want. For example, if you wanted everything except verbose & debug:
+ *
+ * `((DDLogLevelAll ^ DDLogLevelVerbose) | DDLogLevelInfo)`
+ **/
+- (void)addLogger:(id <OSSDDLogger>)logger withLevel:(OSSDDLogLevel)level;
+
+/**
+ *  Remove the logger from the system
+ */
++ (void)removeLogger:(id <OSSDDLogger>)logger;
+
+/**
+ *  Remove the logger from the system
+ */
+- (void)removeLogger:(id <OSSDDLogger>)logger;
+
+/**
+ *  Remove all the current loggers
+ */
++ (void)removeAllLoggers;
+
+/**
+ *  Remove all the current loggers
+ */
+- (void)removeAllLoggers;
+
+/**
+ *  Return all the current loggers
+ */
+@property (class, nonatomic, copy, readonly) NSArray<id<OSSDDLogger>> *allLoggers;
+
+/**
+ *  Return all the current loggers
+ */
+@property (nonatomic, copy, readonly) NSArray<id<OSSDDLogger>> *allLoggers;
+
+/**
+ *  Return all the current loggers with their level (aka DDLoggerInformation).
+ */
+@property (class, nonatomic, copy, readonly) NSArray<OSSDDLoggerInformation *> *allLoggersWithLevel;
+
+/**
+ *  Return all the current loggers with their level (aka DDLoggerInformation).
+ */
+@property (nonatomic, copy, readonly) NSArray<OSSDDLoggerInformation *> *allLoggersWithLevel;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  This protocol describes a basic logger behavior. 
+ *  Basically, it can log messages, store a logFormatter plus a bunch of optional behaviors.
+ *  (i.e. flush, get its loggerQueue, get its name, ...
+ */
+@protocol OSSDDLogger <NSObject>
+
+/**
+ *  The log message method
+ *
+ *  @param logMessage the message (model)
+ */
+- (void)logMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(log(message:));
+
+/**
+ * Formatters may optionally be added to any logger.
+ *
+ * If no formatter is set, the logger simply logs the message as it is given in logMessage,
+ * or it may use its own built in formatting style.
+ **/
+@property (nonatomic, strong) id <OSSDDLogFormatter> logFormatter;
+
+@optional
+
+/**
+ * Since logging is asynchronous, adding and removing loggers is also asynchronous.
+ * In other words, the loggers are added and removed at appropriate times with regards to log messages.
+ *
+ * - Loggers will not receive log messages that were executed prior to when they were added.
+ * - Loggers will not receive log messages that were executed after they were removed.
+ *
+ * These methods are executed in the logging thread/queue.
+ * This is the same thread/queue that will execute every logMessage: invocation.
+ * Loggers may use these methods for thread synchronization or other setup/teardown tasks.
+ **/
+- (void)didAddLogger;
+
+/**
+ * Since logging is asynchronous, adding and removing loggers is also asynchronous.
+ * In other words, the loggers are added and removed at appropriate times with regards to log messages.
+ *
+ * - Loggers will not receive log messages that were executed prior to when they were added.
+ * - Loggers will not receive log messages that were executed after they were removed.
+ *
+ * These methods are executed in the logging thread/queue given in parameter.
+ * This is the same thread/queue that will execute every logMessage: invocation.
+ * Loggers may use the queue parameter to set specific values on the queue with dispatch_set_specific() function.
+ **/
+- (void)didAddLoggerInQueue:(dispatch_queue_t)queue;
+
+/**
+ *  See the above description for `didAddLoger`
+ */
+- (void)willRemoveLogger;
+
+/**
+ * Some loggers may buffer IO for optimization purposes.
+ * For example, a database logger may only save occasionaly as the disk IO is slow.
+ * In such loggers, this method should be implemented to flush any pending IO.
+ *
+ * This allows invocations of DDLog's flushLog method to be propogated to loggers that need it.
+ *
+ * Note that DDLog's flushLog method is invoked automatically when the application quits,
+ * and it may be also invoked manually by the developer prior to application crashes, or other such reasons.
+ **/
+- (void)flush;
+
+/**
+ * Each logger is executed concurrently with respect to the other loggers.
+ * Thus, a dedicated dispatch queue is used for each logger.
+ * Logger implementations may optionally choose to provide their own dispatch queue.
+ **/
+@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE, readonly) dispatch_queue_t loggerQueue;
+
+/**
+ * If the logger implementation does not choose to provide its own queue,
+ * one will automatically be created for it.
+ * The created queue will receive its name from this method.
+ * This may be helpful for debugging or profiling reasons.
+ **/
+@property (nonatomic, readonly) NSString *loggerName;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  This protocol describes the behavior of a log formatter
+ */
+@protocol OSSDDLogFormatter <NSObject>
+@required
+
+/**
+ * Formatters may optionally be added to any logger.
+ * This allows for increased flexibility in the logging environment.
+ * For example, log messages for log files may be formatted differently than log messages for the console.
+ *
+ * For more information about formatters, see the "Custom Formatters" page:
+ * Documentation/CustomFormatters.md
+ *
+ * The formatter may also optionally filter the log message by returning nil,
+ * in which case the logger will not log the message.
+ **/
+- (NSString * __nullable)formatLogMessage:(OSSDDLogMessage *)logMessage NS_SWIFT_NAME(format(message:));
+
+@optional
+
+/**
+ * A single formatter instance can be added to multiple loggers.
+ * These methods provides hooks to notify the formatter of when it's added/removed.
+ *
+ * This is primarily for thread-safety.
+ * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
+ * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
+ * it could possibly use these hooks to switch to thread-safe versions of the code.
+ **/
+- (void)didAddToLogger:(id <OSSDDLogger>)logger;
+
+/**
+ * A single formatter instance can be added to multiple loggers.
+ * These methods provides hooks to notify the formatter of when it's added/removed.
+ *
+ * This is primarily for thread-safety.
+ * If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
+ * Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
+ * it could possibly use these hooks to switch to thread-safe versions of the code or use dispatch_set_specific()
+.* to add its own specific values.
+ **/
+- (void)didAddToLogger:(id <OSSDDLogger>)logger inQueue:(dispatch_queue_t)queue;
+
+/**
+ *  See the above description for `didAddToLogger:`
+ */
+- (void)willRemoveFromLogger:(id <OSSDDLogger>)logger;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  This protocol describes a dynamic logging component
+ */
+@protocol OSSDDRegisteredDynamicLogging
+
+/**
+ * Implement these methods to allow a file's log level to be managed from a central location.
+ *
+ * This is useful if you'd like to be able to change log levels for various parts
+ * of your code from within the running application.
+ *
+ * Imagine pulling up the settings for your application,
+ * and being able to configure the logging level on a per file basis.
+ *
+ * The implementation can be very straight-forward:
+ *
+ * ```
+ * + (int)ddLogLevel
+ * {
+ *     return ddLogLevel;
+ * }
+ *
+ * + (void)ddSetLogLevel:(DDLogLevel)level
+ * {
+ *     ddLogLevel = level;
+ * }
+ * ```
+ **/
+@property (class, nonatomic, readwrite, setter=ddSetLogLevel:) OSSDDLogLevel ossLogLevel;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef NS_DESIGNATED_INITIALIZER
+    #define NS_DESIGNATED_INITIALIZER
+#endif
+
+/**
+ *  Log message options, allow copying certain log elements
+ */
+typedef NS_OPTIONS(NSInteger, OSSDDLogMessageOptions){
+    /**
+     *  Use this to use a copy of the file path
+     */
+    OSSDDLogMessageCopyFile        = 1 << 0,
+    /**
+     *  Use this to use a copy of the function name
+     */
+    OSSDDLogMessageCopyFunction    = 1 << 1,
+    /**
+     *  Use this to use avoid a copy of the message
+     */
+    OSSDDLogMessageDontCopyMessage = 1 << 2
+};
+
+/**
+ * The `DDLogMessage` class encapsulates information about the log message.
+ * If you write custom loggers or formatters, you will be dealing with objects of this class.
+ **/
+@interface OSSDDLogMessage : NSObject <NSCopying>
+{
+    // Direct accessors to be used only for performance
+    @public
+    NSString *_message;
+    OSSDDLogLevel _level;
+    OSSDDLogFlag _flag;
+    NSInteger _context;
+    NSString *_file;
+    NSString *_fileName;
+    NSString *_function;
+    NSUInteger _line;
+    id _tag;
+    OSSDDLogMessageOptions _options;
+    NSDate *_timestamp;
+    NSString *_threadID;
+    NSString *_threadName;
+    NSString *_queueLabel;
+}
+
+/**
+ *  Default `init` for empty messages.
+ */
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Standard init method for a log message object.
+ * Used by the logging primitives. (And the macros use the logging primitives.)
+ *
+ * If you find need to manually create logMessage objects, there is one thing you should be aware of:
+ *
+ * If no flags are passed, the method expects the file and function parameters to be string literals.
+ * That is, it expects the given strings to exist for the duration of the object's lifetime,
+ * and it expects the given strings to be immutable.
+ * In other words, it does not copy these strings, it simply points to them.
+ * This is due to the fact that __FILE__ and __FUNCTION__ are usually used to specify these parameters,
+ * so it makes sense to optimize and skip the unnecessary allocations.
+ * However, if you need them to be copied you may use the options parameter to specify this.
+ *
+ *  @param message   the message
+ *  @param level     the log level
+ *  @param flag      the log flag
+ *  @param context   the context (if any is defined)
+ *  @param file      the current file
+ *  @param function  the current function
+ *  @param line      the current code line
+ *  @param tag       potential tag
+ *  @param options   a bitmask which supports DDLogMessageCopyFile and DDLogMessageCopyFunction.
+ *  @param timestamp the log timestamp
+ *
+ *  @return a new instance of a log message model object
+ */
+- (instancetype)initWithMessage:(NSString *)message
+                          level:(OSSDDLogLevel)level
+                           flag:(OSSDDLogFlag)flag
+                        context:(NSInteger)context
+                           file:(NSString *)file
+                       function:(NSString * __nullable)function
+                           line:(NSUInteger)line
+                            tag:(id __nullable)tag
+                        options:(OSSDDLogMessageOptions)options
+                      timestamp:(NSDate * __nullable)timestamp NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Read-only properties
+ **/
+
+/**
+ *  The log message
+ */
+@property (readonly, nonatomic) NSString *message;
+@property (readonly, nonatomic) OSSDDLogLevel level;
+@property (readonly, nonatomic) OSSDDLogFlag flag;
+@property (readonly, nonatomic) NSInteger context;
+@property (readonly, nonatomic) NSString *file;
+@property (readonly, nonatomic) NSString *fileName;
+@property (readonly, nonatomic) NSString * __nullable function;
+@property (readonly, nonatomic) NSUInteger line;
+@property (readonly, nonatomic) id __nullable tag;
+@property (readonly, nonatomic) OSSDDLogMessageOptions options;
+@property (readonly, nonatomic) NSDate *timestamp;
+@property (readonly, nonatomic) NSString *threadID; // ID as it appears in NSLog calculated from the machThreadID
+@property (readonly, nonatomic) NSString *threadName;
+@property (readonly, nonatomic) NSString *queueLabel;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * The `DDLogger` protocol specifies that an optional formatter can be added to a logger.
+ * Most (but not all) loggers will want to support formatters.
+ *
+ * However, writting getters and setters in a thread safe manner,
+ * while still maintaining maximum speed for the logging process, is a difficult task.
+ *
+ * To do it right, the implementation of the getter/setter has strict requiremenets:
+ * - Must NOT require the `logMessage:` method to acquire a lock.
+ * - Must NOT require the `logMessage:` method to access an atomic property (also a lock of sorts).
+ *
+ * To simplify things, an abstract logger is provided that implements the getter and setter.
+ *
+ * Logger implementations may simply extend this class,
+ * and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their `logMessage:` method!
+ **/
+@interface OSSDDAbstractLogger : NSObject <OSSDDLogger>
+{
+    // Direct accessors to be used only for performance
+    @public
+    id <OSSDDLogFormatter> _logFormatter;
+    dispatch_queue_t _loggerQueue;
+}
+
+@property (nonatomic, strong, nullable) id <OSSDDLogFormatter> logFormatter;
+@property (nonatomic, DISPATCH_QUEUE_REFERENCE_TYPE) dispatch_queue_t loggerQueue;
+
+// For thread-safety assertions
+
+/**
+ *  Return YES if the current logger uses a global queue for logging
+ */
+@property (nonatomic, readonly, getter=isOnGlobalLoggingQueue)  BOOL onGlobalLoggingQueue;
+
+/**
+ *  Return YES if the current logger uses the internal designated queue for logging
+ */
+@property (nonatomic, readonly, getter=isOnInternalLoggerQueue) BOOL onInternalLoggerQueue;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+@interface OSSDDLoggerInformation : NSObject
+
+@property (nonatomic, readonly) id <OSSDDLogger> logger;
+@property (nonatomic, readonly) OSSDDLogLevel level;
+
++ (OSSDDLoggerInformation *)informationWithLogger:(id <OSSDDLogger>)logger
+                           andLevel:(OSSDDLogLevel)level;
+
+@end
+
+NS_ASSUME_NONNULL_END

File diff suppressed because it is too large
+ 1247 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSDDLog.m


+ 509 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSFileLogger.h

@@ -0,0 +1,509 @@
+// Software License Agreement (BSD License)
+//
+// Copyright (c) 2010-2016, Deusty, LLC
+// All rights reserved.
+//
+// Redistribution and use of this software in source and binary forms,
+// with or without modification, are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+//   this list of conditions and the following disclaimer.
+//
+// * Neither the name of Deusty nor the names of its contributors may be used
+//   to endorse or promote products derived from this software without specific
+//   prior written permission of Deusty, LLC.
+
+// Disable legacy macros
+#ifndef DD_LEGACY_MACROS
+    #define DD_LEGACY_MACROS 0
+#endif
+
+#import "OSSDDLog.h"
+
+@class OSSDDLogFileInfo;
+
+/**
+ * This class provides a logger to write log statements to a file.
+ **/
+
+
+// Default configuration and safety/sanity values.
+//
+// maximumFileSize         -> kDDDefaultLogMaxFileSize
+// rollingFrequency        -> kDDDefaultLogRollingFrequency
+// maximumNumberOfLogFiles -> kDDDefaultLogMaxNumLogFiles
+// logFilesDiskQuota       -> kDDDefaultLogFilesDiskQuota
+//
+// You should carefully consider the proper configuration values for your application.
+
+extern unsigned long long const osskDDDefaultLogMaxFileSize;
+extern NSTimeInterval     const osskDDDefaultLogRollingFrequency;
+extern NSUInteger         const osskDDDefaultLogMaxNumLogFiles;
+extern unsigned long long const osskDDDefaultLogFilesDiskQuota;
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  The LogFileManager protocol is designed to allow you to control all aspects of your log files.
+ *
+ *  The primary purpose of this is to allow you to do something with the log files after they have been rolled.
+ *  Perhaps you want to compress them to save disk space.
+ *  Perhaps you want to upload them to an FTP server.
+ *  Perhaps you want to run some analytics on the file.
+ *
+ *  A default LogFileManager is, of course, provided.
+ *  The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property.
+ *
+ *  This protocol provides various methods to fetch the list of log files.
+ *
+ *  There are two variants: sorted and unsorted.
+ *  If sorting is not necessary, the unsorted variant is obviously faster.
+ *  The sorted variant will return an array sorted by when the log files were created,
+ *  with the most recently created log file at index 0, and the oldest log file at the end of the array.
+ *
+ *  You can fetch only the log file paths (full path including name), log file names (name only),
+ *  or an array of `DDLogFileInfo` objects.
+ *  The `DDLogFileInfo` class is documented below, and provides a handy wrapper that
+ *  gives you easy access to various file attributes such as the creation date or the file size.
+ */
+@protocol OSSDDLogFileManager <NSObject>
+@required
+
+// Public properties
+
+/**
+ * The maximum number of archived log files to keep on disk.
+ * For example, if this property is set to 3,
+ * then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk.
+ * Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted.
+ *
+ * You may optionally disable this option by setting it to zero.
+ **/
+@property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles;
+
+/**
+ * The maximum space that logs can take. On rolling logfile all old logfiles that exceed logFilesDiskQuota will
+ * be deleted.
+ *
+ * You may optionally disable this option by setting it to zero.
+ **/
+@property (readwrite, assign, atomic) unsigned long long logFilesDiskQuota;
+
+// Public methods
+
+/**
+ *  Returns the logs directory (path)
+ */
+@property (nonatomic, readonly, copy) NSString *logsDirectory;
+
+/**
+ * Returns an array of `NSString` objects,
+ * each of which is the filePath to an existing log file on disk.
+ **/
+@property (nonatomic, readonly, strong) NSArray<NSString *> *unsortedLogFilePaths;
+
+/**
+ * Returns an array of `NSString` objects,
+ * each of which is the fileName of an existing log file on disk.
+ **/
+@property (nonatomic, readonly, strong) NSArray<NSString *> *unsortedLogFileNames;
+
+/**
+ * Returns an array of `DDLogFileInfo` objects,
+ * each representing an existing log file on disk,
+ * and containing important information about the log file such as it's modification date and size.
+ **/
+@property (nonatomic, readonly, strong) NSArray<OSSDDLogFileInfo *> *unsortedLogFileInfos;
+
+/**
+ * Just like the `unsortedLogFilePaths` method, but sorts the array.
+ * The items in the array are sorted by creation date.
+ * The first item in the array will be the most recently created log file.
+ **/
+@property (nonatomic, readonly, strong) NSArray<NSString *> *sortedLogFilePaths;
+
+/**
+ * Just like the `unsortedLogFileNames` method, but sorts the array.
+ * The items in the array are sorted by creation date.
+ * The first item in the array will be the most recently created log file.
+ **/
+@property (nonatomic, readonly, strong) NSArray<NSString *> *sortedLogFileNames;
+
+/**
+ * Just like the `unsortedLogFileInfos` method, but sorts the array.
+ * The items in the array are sorted by creation date.
+ * The first item in the array will be the most recently created log file.
+ **/
+@property (nonatomic, readonly, strong) NSArray<OSSDDLogFileInfo *> *sortedLogFileInfos;
+
+// Private methods (only to be used by DDFileLogger)
+
+/**
+ * Generates a new unique log file path, and creates the corresponding log file.
+ **/
+- (NSString *)createNewLogFile;
+
+@optional
+
+// Notifications from DDFileLogger
+
+/**
+ *  Called when a log file was archieved
+ */
+- (void)didArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didArchiveLogFile(atPath:));
+
+/**
+ *  Called when the roll action was executed and the log was archieved
+ */
+- (void)didRollAndArchiveLogFile:(NSString *)logFilePath NS_SWIFT_NAME(didRollAndArchiveLogFile(atPath:));
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Default log file manager.
+ *
+ * All log files are placed inside the logsDirectory.
+ * If a specific logsDirectory isn't specified, the default directory is used.
+ * On Mac, this is in `~/Library/Logs/<Application Name>`.
+ * On iPhone, this is in `~/Library/Caches/Logs`.
+ *
+ * Log files are named `"<bundle identifier> <date> <time>.log"`
+ * Example: `com.organization.myapp 2013-12-03 17-14.log`
+ *
+ * Archived log files are automatically deleted according to the `maximumNumberOfLogFiles` property.
+ **/
+@interface OSSDDLogFileManagerDefault : NSObject <OSSDDLogFileManager>
+
+/**
+ *  Default initializer
+ */
+- (instancetype)init;
+
+/**
+ *  Designated initialized, requires the logs directory
+ */
+- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory NS_DESIGNATED_INITIALIZER;
+
+#if TARGET_OS_IPHONE
+/*
+ * Calling this constructor you can override the default "automagically" chosen NSFileProtection level.
+ * Useful if you are writing a command line utility / CydiaSubstrate addon for iOS that has no NSBundle
+ * or like SpringBoard no BackgroundModes key in the NSBundle:
+ *    iPhone:~ root# cycript -p SpringBoard
+ *    cy# [NSBundle mainBundle]
+ *    #"NSBundle </System/Library/CoreServices/SpringBoard.app> (loaded)"
+ *    cy# [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
+ *    null
+ *    cy#
+ **/
+- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory defaultFileProtectionLevel:(NSFileProtectionType)fileProtectionLevel;
+#endif
+
+/*
+ * Methods to override.
+ *
+ * Log files are named `"<bundle identifier> <date> <time>.log"`
+ * Example: `com.organization.myapp 2013-12-03 17-14.log`
+ *
+ * If you wish to change default filename, you can override following two methods.
+ * - `newLogFileName` method would be called on new logfile creation.
+ * - `isLogFile:` method would be called to filter logfiles from all other files in logsDirectory.
+ *   You have to parse given filename and return YES if it is logFile.
+ *
+ * **NOTE**
+ * `newLogFileName` returns filename. If appropriate file already exists, number would be added
+ * to filename before extension. You have to handle this case in isLogFile: method.
+ *
+ * Example:
+ * - newLogFileName returns `"com.organization.myapp 2013-12-03.log"`,
+ *   file `"com.organization.myapp 2013-12-03.log"` would be created.
+ * - after some time `"com.organization.myapp 2013-12-03.log"` is archived
+ * - newLogFileName again returns `"com.organization.myapp 2013-12-03.log"`,
+ *   file `"com.organization.myapp 2013-12-03 2.log"` would be created.
+ * - after some time `"com.organization.myapp 2013-12-03 1.log"` is archived
+ * - newLogFileName again returns `"com.organization.myapp 2013-12-03.log"`,
+ *   file `"com.organization.myapp 2013-12-03 3.log"` would be created.
+ **/
+
+/**
+ * Generates log file name with default format `"<bundle identifier> <date> <time>.log"`
+ * Example: `MobileSafari 2013-12-03 17-14.log`
+ *
+ * You can change it by overriding `newLogFileName` and `isLogFile:` methods.
+ **/
+@property (readonly, copy) NSString *newLogFileName;
+
+/**
+ * Default log file name is `"<bundle identifier> <date> <time>.log"`.
+ * Example: `MobileSafari 2013-12-03 17-14.log`
+ *
+ * You can change it by overriding `newLogFileName` and `isLogFile:` methods.
+ **/
+- (BOOL)isLogFile:(NSString *)fileName NS_SWIFT_NAME(isLogFile(withName:));
+
+/* Inherited from DDLogFileManager protocol:
+
+   @property (readwrite, assign, atomic) NSUInteger maximumNumberOfLogFiles;
+   @property (readwrite, assign, atomic) NSUInteger logFilesDiskQuota;
+
+   - (NSString *)logsDirectory;
+
+   - (NSArray *)unsortedLogFilePaths;
+   - (NSArray *)unsortedLogFileNames;
+   - (NSArray *)unsortedLogFileInfos;
+
+   - (NSArray *)sortedLogFilePaths;
+   - (NSArray *)sortedLogFileNames;
+   - (NSArray *)sortedLogFileInfos;
+
+ */
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * Most users will want file log messages to be prepended with the date and time.
+ * Rather than forcing the majority of users to write their own formatter,
+ * we will supply a logical default formatter.
+ * Users can easily replace this formatter with their own by invoking the `setLogFormatter:` method.
+ * It can also be removed by calling `setLogFormatter:`, and passing a nil parameter.
+ *
+ * In addition to the convenience of having a logical default formatter,
+ * it will also provide a template that makes it easy for developers to copy and change.
+ **/
+@interface OSSDDLogFileFormatterDefault : NSObject <OSSDDLogFormatter>
+
+/**
+ *  Default initializer
+ */
+- (instancetype)init;
+
+/**
+ *  Designated initializer, requires a date formatter
+ */
+- (instancetype)initWithDateFormatter:(NSDateFormatter *)dateFormatter NS_DESIGNATED_INITIALIZER;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  The standard implementation for a file logger
+ */
+@interface OSSDDFileLogger : OSSDDAbstractLogger <OSSDDLogger> {
+	OSSDDLogFileInfo *_currentLogFileInfo;
+}
+
+/**
+ *  Default initializer
+ */
+- (instancetype)init;
+
+/**
+ *  Designated initializer, requires a `DDLogFileManager` instance
+ */
+- (instancetype)initWithLogFileManager:(id <OSSDDLogFileManager>)logFileManager NS_DESIGNATED_INITIALIZER;
+
+/**
+ *  Called when the logger is about to write message. Call super before your implementation.
+ */
+- (void)willLogMessage NS_REQUIRES_SUPER;
+
+/**
+ *  Called when the logger wrote message. Call super after your implementation.
+ */
+- (void)didLogMessage NS_REQUIRES_SUPER;
+
+/**
+ *  Called when the logger checks archive or not current log file. 
+ *  Override this method to exdend standart behavior. By default returns NO.
+ */
+- (BOOL)shouldArchiveRecentLogFileInfo:(OSSDDLogFileInfo *)recentLogFileInfo;
+
+/**
+ * Log File Rolling:
+ *
+ * `maximumFileSize`:
+ *   The approximate maximum size (in bytes) to allow log files to grow.
+ *   If a log file is larger than this value after a log statement is appended,
+ *   then the log file is rolled.
+ *
+ * `rollingFrequency`
+ *   How often to roll the log file.
+ *   The frequency is given as an `NSTimeInterval`, which is a double that specifies the interval in seconds.
+ *   Once the log file gets to be this old, it is rolled.
+ *
+ * `doNotReuseLogFiles`
+ *   When set, will always create a new log file at application launch.
+ *
+ * Both the `maximumFileSize` and the `rollingFrequency` are used to manage rolling.
+ * Whichever occurs first will cause the log file to be rolled.
+ *
+ * For example:
+ * The `rollingFrequency` is 24 hours,
+ * but the log file surpasses the `maximumFileSize` after only 20 hours.
+ * The log file will be rolled at that 20 hour mark.
+ * A new log file will be created, and the 24 hour timer will be restarted.
+ *
+ * You may optionally disable rolling due to filesize by setting `maximumFileSize` to zero.
+ * If you do so, rolling is based solely on `rollingFrequency`.
+ *
+ * You may optionally disable rolling due to time by setting `rollingFrequency` to zero (or any non-positive number).
+ * If you do so, rolling is based solely on `maximumFileSize`.
+ *
+ * If you disable both `maximumFileSize` and `rollingFrequency`, then the log file won't ever be rolled.
+ * This is strongly discouraged.
+ **/
+@property (readwrite, assign) unsigned long long maximumFileSize;
+
+/**
+ *  See description for `maximumFileSize`
+ */
+@property (readwrite, assign) NSTimeInterval rollingFrequency;
+
+/**
+ *  See description for `maximumFileSize`
+ */
+@property (readwrite, assign, atomic) BOOL doNotReuseLogFiles;
+
+/**
+ * The DDLogFileManager instance can be used to retrieve the list of log files,
+ * and configure the maximum number of archived log files to keep.
+ *
+ * @see DDLogFileManager.maximumNumberOfLogFiles
+ **/
+@property (strong, nonatomic, readonly) id <OSSDDLogFileManager> logFileManager;
+
+/**
+ * When using a custom formatter you can set the `logMessage` method not to append
+ * `\n` character after each output. This allows for some greater flexibility with
+ * custom formatters. Default value is YES.
+ **/
+@property (nonatomic, readwrite, assign) BOOL automaticallyAppendNewlineForCustomFormatters;
+
+/**
+ *  You can optionally force the current log file to be rolled with this method.
+ *  CompletionBlock will be called on main queue.
+ */
+- (void)rollLogFileWithCompletionBlock:(void (^)(void))completionBlock NS_SWIFT_NAME(rollLogFile(withCompletion:));
+
+/**
+ *  Method is deprecated.
+ *  @deprecated Use `rollLogFileWithCompletionBlock:` method instead.
+ */
+- (void)rollLogFile __attribute((deprecated));
+
+// Inherited from DDAbstractLogger
+
+// - (id <DDLogFormatter>)logFormatter;
+// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
+
+/**
+ * Returns the log file that should be used.
+ * If there is an existing log file that is suitable,
+ * within the constraints of `maximumFileSize` and `rollingFrequency`, then it is returned.
+ *
+ * Otherwise a new file is created and returned.
+ **/
+@property (nonatomic, readonly, strong) OSSDDLogFileInfo *currentLogFileInfo;
+
+@end
+
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+#pragma mark -
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ * `DDLogFileInfo` is a simple class that provides access to various file attributes.
+ * It provides good performance as it only fetches the information if requested,
+ * and it caches the information to prevent duplicate fetches.
+ *
+ * It was designed to provide quick snapshots of the current state of log files,
+ * and to help sort log files in an array.
+ *
+ * This class does not monitor the files, or update it's cached attribute values if the file changes on disk.
+ * This is not what the class was designed for.
+ *
+ * If you absolutely must get updated values,
+ * you can invoke the reset method which will clear the cache.
+ **/
+@interface OSSDDLogFileInfo : NSObject
+
+@property (strong, nonatomic, readonly) NSString *filePath;
+@property (strong, nonatomic, readonly) NSString *fileName;
+
+#if FOUNDATION_SWIFT_SDK_EPOCH_AT_LEAST(8)
+@property (strong, nonatomic, readonly) NSDictionary<NSFileAttributeKey, id> *fileAttributes;
+#else
+@property (strong, nonatomic, readonly) NSDictionary<NSString *, id> *fileAttributes;
+#endif
+
+@property (strong, nonatomic, readonly) NSDate *creationDate;
+@property (strong, nonatomic, readonly) NSDate *modificationDate;
+
+@property (nonatomic, readonly) unsigned long long fileSize;
+
+@property (nonatomic, readonly) NSTimeInterval age;
+
+@property (nonatomic, readwrite) BOOL isArchived;
+
++ (instancetype)logFileWithPath:(NSString *)filePath NS_SWIFT_UNAVAILABLE("Use init(filePath:)");
+
+- (instancetype)init NS_UNAVAILABLE;
+- (instancetype)initWithFilePath:(NSString *)filePath NS_DESIGNATED_INITIALIZER;
+
+- (void)reset;
+- (void)renameFile:(NSString *)newFileName NS_SWIFT_NAME(renameFile(to:));
+
+#if TARGET_IPHONE_SIMULATOR
+
+// So here's the situation.
+// Extended attributes are perfect for what we're trying to do here (marking files as archived).
+// This is exactly what extended attributes were designed for.
+//
+// But Apple screws us over on the simulator.
+// Everytime you build-and-go, they copy the application into a new folder on the hard drive,
+// and as part of the process they strip extended attributes from our log files.
+// Normally, a copy of a file preserves extended attributes.
+// So obviously Apple has gone to great lengths to piss us off.
+//
+// Thus we use a slightly different tactic for marking log files as archived in the simulator.
+// That way it "just works" and there's no confusion when testing.
+//
+// The difference in method names is indicative of the difference in functionality.
+// On the simulator we add an attribute by appending a filename extension.
+//
+// For example:
+// "mylog.txt" -> "mylog.archived.txt"
+// "mylog"     -> "mylog.archived"
+
+- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName;
+
+- (void)addExtensionAttributeWithName:(NSString *)attrName;
+- (void)removeExtensionAttributeWithName:(NSString *)attrName;
+
+#else /* if TARGET_IPHONE_SIMULATOR */
+
+// Normal use of extended attributes used everywhere else,
+// such as on Macs and on iPhone devices.
+
+- (BOOL)hasExtendedAttributeWithName:(NSString *)attrName;
+
+- (void)addExtendedAttributeWithName:(NSString *)attrName;
+- (void)removeExtendedAttributeWithName:(NSString *)attrName;
+
+#endif /* if TARGET_IPHONE_SIMULATOR */
+
+@end

File diff suppressed because it is too large
+ 1460 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSFileLogger.m


+ 82 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSLogMacros.h

@@ -0,0 +1,82 @@
+// Software License Agreement (BSD License)
+//
+// Copyright (c) 2010-2016, Deusty, LLC
+// All rights reserved.
+//
+// Redistribution and use of this software in source and binary forms,
+// with or without modification, are permitted provided that the following conditions are met:
+//
+// * Redistributions of source code must retain the above copyright notice,
+//   this list of conditions and the following disclaimer.
+//
+// * Neither the name of Deusty nor the names of its contributors may be used
+//   to endorse or promote products derived from this software without specific
+//   prior written permission of Deusty, LLC.
+
+// Disable legacy macros
+#ifndef OSSDD_LEGACY_MACROS
+    #define OSSDD_LEGACY_MACROS 0
+#endif
+
+#import "OSSDDLog.h"
+
+/**
+ * The constant/variable/method responsible for controlling the current log level.
+ **/
+#ifndef OSSLOG_LEVEL_DEF
+    #define OSSLOG_LEVEL_DEF ossLogLevel
+#endif
+
+/**
+ * Whether async should be used by log messages, excluding error messages that are always sent sync.
+ **/
+#ifndef OSSLOG_ASYNC_ENABLED
+    #define OSSLOG_ASYNC_ENABLED YES
+#endif
+
+/**
+ * These are the two macros that all other macros below compile into.
+ * These big multiline macros makes all the other macros easier to read.
+ **/
+#define OSSLOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \
+        [OSSDDLog log : isAsynchronous                                     \
+             level : lvl                                                \
+              flag : flg                                                \
+           context : ctx                                                \
+              file : __FILE__                                           \
+          function : fnct                                               \
+              line : __LINE__                                           \
+               tag : atag                                               \
+            format : (frmt), ## __VA_ARGS__]
+
+/**
+ * Define version of the macro that only execute if the log level is above the threshold.
+ * The compiled versions essentially look like this:
+ *
+ * if (logFlagForThisLogMsg & ddLogLevel) { execute log message }
+ *
+ * When LOG_LEVEL_DEF is defined as ddLogLevel.
+ *
+ * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels.
+ * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques.
+ *
+ * Note that when compiler optimizations are enabled (as they are for your release builds),
+ * the log messages above your logging threshold will automatically be compiled out.
+ *
+ * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see
+ *  if the 'if' statement would execute, and if not it strips it from the binary.)
+ *
+ * We also define shorthand versions for asynchronous and synchronous logging.
+ **/
+#define OSSLOG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \
+        do { if(lvl & flg) OSSLOG_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0)
+
+/**
+ * Ready to use log macros with no context or tag.
+ **/
+#define OSSDDLogError(frmt, ...)   OSSLOG_MAYBE(NO,                OSSLOG_LEVEL_DEF, OSSDDLogFlagError,   0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
+#define OSSDDLogWarn(frmt, ...)    OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
+#define OSSDDLogInfo(frmt, ...)    OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagInfo,    0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
+#define OSSDDLogDebug(frmt, ...)   OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagDebug,   0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
+#define OSSDDLogVerbose(frmt, ...) OSSLOG_MAYBE(OSSLOG_ASYNC_ENABLED, OSSLOG_LEVEL_DEF, OSSDDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, ##__VA_ARGS__)
+

+ 14 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSNSLogger.h

@@ -0,0 +1,14 @@
+//
+//  OSSNSLogger.h
+//  AliyunOSSiOS
+//
+//  Created by jingdan on 2017/10/24.
+//  Copyright © 2017年 zhouzhuo. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "OSSDDLog.h"
+
+@interface OSSNSLogger : OSSDDAbstractLogger <OSSDDLogger>
+@property (class, readonly, strong) OSSNSLogger *sharedInstance;
+@end

+ 32 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSNSLogger.m

@@ -0,0 +1,32 @@
+//
+//  OSSNSLogger.m
+//  AliyunOSSiOS
+//
+//  Created by jingdan on 2017/10/24.
+//  Copyright © 2017年 zhouzhuo. All rights reserved.
+//
+
+#import "OSSNSLogger.h"
+
+static OSSNSLogger *sharedInstance;
+
+@implementation OSSNSLogger
++ (instancetype)sharedInstance {
+    static dispatch_once_t OSSNSLoggerOnceToken;
+    
+    dispatch_once(&OSSNSLoggerOnceToken, ^{
+        sharedInstance = [[[self class] alloc] init];
+    });
+    
+    return sharedInstance;
+}
+
+- (void)logMessage:(OSSDDLogMessage *)logMessage {
+    NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message;
+    
+    if (message) {
+        NSLog(@"%@",message);
+    }
+}
+
+@end

+ 64 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSReachability.h

@@ -0,0 +1,64 @@
+/*
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ See LICENSE.txt for this sample’s licensing information
+ 
+ Abstract:
+ Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
+ */
+
+#import <Foundation/Foundation.h>
+#import <SystemConfiguration/SystemConfiguration.h>
+#import <netinet/in.h>
+
+
+typedef enum : NSInteger {
+	OSSNotReachable = 0,
+	OSSReachableViaWiFi,
+	OSSReachableViaWWAN
+} OSSNetworkStatus;
+
+#pragma mark IPv6 Support
+//Reachability fully support IPv6.  For full details, see ReadMe.md.
+
+
+extern NSString *ossReachabilityChangedNotification;
+
+
+@interface OSSReachability : NSObject
+
+/*!
+ * Use to check the reachability of a given host name.
+ */
++ (instancetype)reachabilityWithHostName:(NSString *)hostName;
+
+/*!
+ * Use to check the reachability of a given IP address.
+ */
++ (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress;
+
+/*!
+ * Checks whether the default route is available. Should be used by applications that do not connect to a particular host.
+ */
++ (instancetype)reachabilityForInternetConnection;
+
+
+#pragma mark reachabilityForLocalWiFi
+//reachabilityForLocalWiFi has been removed from the sample.  See ReadMe.md for more information.
+//+ (instancetype)reachabilityForLocalWiFi;
+
+/*!
+ * Start listening for reachability notifications on the current run loop.
+ */
+- (BOOL)startNotifier;
+- (void)stopNotifier;
+
+- (OSSNetworkStatus)currentReachabilityStatus;
+
+/*!
+ * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand.
+ */
+- (BOOL)connectionRequired;
+
+@end
+
+

+ 248 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSFileLog/OSSReachability.m

@@ -0,0 +1,248 @@
+/*
+ Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ See LICENSE.txt for this sample’s licensing information
+ 
+ Abstract:
+ Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
+ */
+
+#import <arpa/inet.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+#import <sys/socket.h>
+#import <netinet/in.h>
+#import <CoreFoundation/CoreFoundation.h>
+
+#import "OSSReachability.h"
+
+#pragma mark IPv6 Support
+//Reachability fully support IPv6.  For full details, see ReadMe.md.
+
+
+NSString *ossReachabilityChangedNotification = @"ossNetworkReachabilityChangedNotification";
+
+#ifndef kShouldPrintReachabilityFlags
+#if TARGET_OS_IOS
+#define kShouldPrintReachabilityFlags 1
+#else
+#define kShouldPrintReachabilityFlags 0
+#endif
+#endif
+
+#pragma mark - Supporting functions
+static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment)
+{
+#if kShouldPrintReachabilityFlags
+
+    NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n",
+          (flags & kSCNetworkReachabilityFlagsIsWWAN)				? 'W' : '-',
+          (flags & kSCNetworkReachabilityFlagsReachable)            ? 'R' : '-',
+
+          (flags & kSCNetworkReachabilityFlagsTransientConnection)  ? 't' : '-',
+          (flags & kSCNetworkReachabilityFlagsConnectionRequired)   ? 'c' : '-',
+          (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic)  ? 'C' : '-',
+          (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',
+          (flags & kSCNetworkReachabilityFlagsConnectionOnDemand)   ? 'D' : '-',
+          (flags & kSCNetworkReachabilityFlagsIsLocalAddress)       ? 'l' : '-',
+          (flags & kSCNetworkReachabilityFlagsIsDirect)             ? 'd' : '-',
+          comment
+          );
+#endif
+}
+
+
+static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
+{
+#pragma unused (target, flags)
+	NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback");
+	NSCAssert([(__bridge NSObject*) info isKindOfClass: [OSSReachability class]], @"info was wrong class in ReachabilityCallback");
+
+    OSSReachability* noteObject = (__bridge OSSReachability *)info;
+    // Post a notification to notify the client that the network reachability changed.
+    [[NSNotificationCenter defaultCenter] postNotificationName: ossReachabilityChangedNotification object: noteObject];
+}
+
+
+#pragma mark - Reachability implementation
+
+@implementation OSSReachability
+{
+	SCNetworkReachabilityRef _reachabilityRef;
+}
+
++ (instancetype)reachabilityWithHostName:(NSString *)hostName
+{
+	OSSReachability* returnValue = NULL;
+	SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]);
+	if (reachability != NULL)
+	{
+		returnValue= [[self alloc] init];
+		if (returnValue != NULL)
+		{
+			returnValue->_reachabilityRef = reachability;
+		}
+        else {
+            CFRelease(reachability);
+        }
+	}
+	return returnValue;
+}
+
+
++ (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress
+{
+	SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, hostAddress);
+
+	OSSReachability* returnValue = NULL;
+
+	if (reachability != NULL)
+	{
+		returnValue = [[self alloc] init];
+		if (returnValue != NULL)
+		{
+			returnValue->_reachabilityRef = reachability;
+		}
+        else {
+            CFRelease(reachability);
+        }
+	}
+	return returnValue;
+}
+
+
++ (instancetype)reachabilityForInternetConnection
+{
+	struct sockaddr_in zeroAddress;
+	bzero(&zeroAddress, sizeof(zeroAddress));
+	zeroAddress.sin_len = sizeof(zeroAddress);
+	zeroAddress.sin_family = AF_INET;
+    
+    return [self reachabilityWithAddress: (const struct sockaddr *) &zeroAddress];
+}
+
+#pragma mark reachabilityForLocalWiFi
+//reachabilityForLocalWiFi has been removed from the sample.  See ReadMe.md for more information.
+//+ (instancetype)reachabilityForLocalWiFi
+
+
+
+#pragma mark - Start and stop notifier
+
+- (BOOL)startNotifier
+{
+	BOOL returnValue = NO;
+	SCNetworkReachabilityContext context = {0, (__bridge void *)(self), NULL, NULL, NULL};
+
+	if (SCNetworkReachabilitySetCallback(_reachabilityRef, ReachabilityCallback, &context))
+	{
+		if (SCNetworkReachabilityScheduleWithRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode))
+		{
+			returnValue = YES;
+		}
+	}
+    
+	return returnValue;
+}
+
+
+- (void)stopNotifier
+{
+	if (_reachabilityRef != NULL)
+	{
+		SCNetworkReachabilityUnscheduleFromRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
+	}
+}
+
+
+- (void)dealloc
+{
+	[self stopNotifier];
+	if (_reachabilityRef != NULL)
+	{
+		CFRelease(_reachabilityRef);
+	}
+}
+
+
+#pragma mark - Network Flag Handling
+
+- (OSSNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
+{
+	PrintReachabilityFlags(flags, "networkStatusForFlags");
+	if ((flags & kSCNetworkReachabilityFlagsReachable) == 0)
+	{
+		// The target host is not reachable.
+		return OSSNotReachable;
+	}
+
+    OSSNetworkStatus returnValue = OSSNotReachable;
+
+	if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0)
+	{
+		/*
+         If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi...
+         */
+		returnValue = OSSReachableViaWiFi;
+	}
+
+	if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) ||
+        (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0))
+	{
+        /*
+         ... and the connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs...
+         */
+
+        if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0)
+        {
+            /*
+             ... and no [user] intervention is needed...
+             */
+            returnValue = OSSReachableViaWiFi;
+        }
+    }
+
+#if TARGET_OS_IOS
+    if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN)
+    {
+        /*
+         ... but WWAN connections are OK if the calling application is using the CFNetwork APIs.
+         */
+        returnValue = OSSReachableViaWWAN;
+    }
+#endif
+
+    
+	return returnValue;
+}
+
+
+- (BOOL)connectionRequired
+{
+	NSAssert(_reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef");
+	SCNetworkReachabilityFlags flags;
+
+	if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags))
+	{
+		return (flags & kSCNetworkReachabilityFlagsConnectionRequired);
+	}
+
+    return NO;
+}
+
+
+- (OSSNetworkStatus)currentReachabilityStatus
+{
+	NSAssert(_reachabilityRef != NULL, @"currentOSSNetworkStatus called with NULL SCNetworkReachabilityRef");
+	OSSNetworkStatus returnValue = OSSNotReachable;
+	SCNetworkReachabilityFlags flags;
+    
+	if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags))
+	{
+        returnValue = [self networkStatusForFlags:flags];
+	}
+    
+	return returnValue;
+}
+
+
+@end

+ 15 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoRequest.h

@@ -0,0 +1,15 @@
+//
+//  OSSGetBucketInfoRequest.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/7/10.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSRequest.h"
+
+@interface OSSGetBucketInfoRequest : OSSRequest
+
+@property (nonatomic, copy) NSString *bucketName;
+
+@end

+ 17 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoRequest.m

@@ -0,0 +1,17 @@
+//
+//  OSSGetBucketInfoRequest.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/7/10.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSGetBucketInfoRequest.h"
+
+@implementation OSSGetBucketInfoRequest
+
+- (NSDictionary *)requestParams {
+    return @{@"bucketInfo": @""};
+}
+
+@end

+ 57 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoResult.h

@@ -0,0 +1,57 @@
+//
+//  OSSGetBucketInfoResult.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/7/10.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSResult.h"
+
+@interface OSSBucketOwner : NSObject
+
+@property (nonatomic, copy) NSString *userName;
+
+@property (nonatomic, copy) NSString *userId;
+
+@end
+
+@interface OSSAccessControlList : NSObject
+
+@property (nonatomic, copy) NSString *grant;
+
+@end
+
+
+
+@interface OSSGetBucketInfoResult : OSSResult
+
+/// Created date.
+@property (nonatomic, copy) NSString *creationDate;
+
+/// Bucket name.
+@property (nonatomic, copy) NSString *bucketName;
+
+/// Bucket location.
+@property (nonatomic, copy) NSString *location;
+
+/// Storage class (Standard, IA, Archive)
+@property (nonatomic, copy) NSString *storageClass;
+
+/**
+ Internal endpoint. It could be accessed within AliCloud under the same
+ location.
+ */
+@property (nonatomic, copy) NSString *intranetEndpoint;
+
+/**
+ External endpoint.It could be accessed from anywhere.
+ */
+@property (nonatomic, copy) NSString *extranetEndpoint;
+
+/// Bucket owner.
+@property (nonatomic, strong) OSSBucketOwner *owner;
+
+@property (nonatomic, strong) OSSAccessControlList *acl;
+
+@end

+ 23 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetBucketInfoResult.m

@@ -0,0 +1,23 @@
+//
+//  OSSGetBucketInfoResult.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/7/10.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSGetBucketInfoResult.h"
+
+@implementation OSSBucketOwner
+
+@end
+
+@implementation OSSAccessControlList
+
+@end
+
+
+
+@implementation OSSGetBucketInfoResult
+
+@end

+ 26 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLRequest.h

@@ -0,0 +1,26 @@
+//
+//  OSSGetObjectACLRequest.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSRequest.h"
+
+NS_ASSUME_NONNULL_BEGIN
+@interface OSSGetObjectACLRequest : OSSRequest
+
+/**
+ the bucket's name which object stored
+ */
+@property (nonatomic, copy) NSString *bucketName;
+
+/**
+ the name of object
+ */
+@property (nonatomic, copy) NSString *objectName;
+
+
+@end
+NS_ASSUME_NONNULL_END

+ 13 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLRequest.m

@@ -0,0 +1,13 @@
+//
+//  OSSGetObjectACLRequest.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSGetObjectACLRequest.h"
+
+@implementation OSSGetObjectACLRequest
+
+@end

+ 19 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLResult.h

@@ -0,0 +1,19 @@
+//
+//  OSSGetObjectACLResult.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSResult.h"
+
+@interface OSSGetObjectACLResult : OSSResult
+
+/**
+ the ACL of object,valid values: @"private",@"public-read",@"public-read-write".
+ if object's ACL inherit from bucket,it will return @"default".
+ */
+@property (nonatomic, copy) NSString *grant;
+
+@end

+ 13 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetObjectACLResult.m

@@ -0,0 +1,13 @@
+//
+//  OSSGetObjectACLResult.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/26.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSGetObjectACLResult.h"
+
+@implementation OSSGetObjectACLResult
+
+@end

+ 17 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkRequest.h

@@ -0,0 +1,17 @@
+//
+//  OSSGetSymlinkRequest.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/8/1.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSRequest.h"
+
+@interface OSSGetSymlinkRequest : OSSRequest
+
+@property (nonatomic, copy) NSString *bucketName;
+
+@property (nonatomic, copy) NSString *objectKey;
+
+@end

+ 17 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkRequest.m

@@ -0,0 +1,17 @@
+//
+//  OSSGetSymlinkRequest.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/8/1.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSGetSymlinkRequest.h"
+
+@implementation OSSGetSymlinkRequest
+
+- (NSDictionary *)requestParams {
+    return @{@"symlink": @""};
+}
+
+@end

+ 13 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkResult.h

@@ -0,0 +1,13 @@
+//
+//  OSSGetSymlinkResult.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/8/1.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSResult.h"
+
+@interface OSSGetSymlinkResult : OSSResult
+
+@end

+ 13 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSGetSymlinkResult.m

@@ -0,0 +1,13 @@
+//
+//  OSSGetSymlinkResult.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/8/1.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSGetSymlinkResult.h"
+
+@implementation OSSGetSymlinkResult
+
+@end

+ 39 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpResponseParser.h

@@ -0,0 +1,39 @@
+//
+//  OSSHttpResponseParser.h
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/22.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "OSSConstants.h"
+#import "OSSTask.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ HTTP response parser
+ */
+@interface OSSHttpResponseParser : NSObject
+
+@property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveBlock;
+
+@property (nonatomic, strong) NSURL *downloadingFileURL;
+
+/**
+ *  A Boolean value that determines whether verfifying crc64.
+ When set to YES, it will verify crc64 when transmission is completed normally.
+ The default value of this property is NO.
+ */
+@property (nonatomic, assign) BOOL crc64Verifiable;
+
+- (instancetype)initForOperationType:(OSSOperationType)operationType;
+- (void)consumeHttpResponse:(NSHTTPURLResponse *)response;
+- (OSSTask *)consumeHttpResponseBody:(NSData *)data;
+- (nullable id)constructResultObject;
+- (void)reset;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 655 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpResponseParser.m

@@ -0,0 +1,655 @@
+//
+//  OSSHttpResponseParser.m
+//  AliyunOSSSDK
+//
+//  Created by huaixu on 2018/1/22.
+//  Copyright © 2018年 aliyun. All rights reserved.
+//
+
+#import "OSSHttpResponseParser.h"
+
+#import "NSMutableData+OSS_CRC.h"
+#import "OSSXMLDictionary.h"
+#import "OSSDefine.h"
+#import "OSSModel.h"
+#import "OSSUtil.h"
+#import "OSSLog.h"
+#import "OSSGetObjectACLResult.h"
+#import "OSSDeleteMultipleObjectsResult.h"
+#import "OSSGetBucketInfoResult.h"
+#import "OSSRestoreObjectResult.h"
+#import "OSSPutSymlinkResult.h"
+#import "OSSGetSymlinkResult.h"
+
+
+@implementation OSSHttpResponseParser {
+    
+    OSSOperationType _operationTypeForThisParser;
+    
+    NSFileHandle * _fileHandle;
+    NSMutableData * _collectingData;
+    NSHTTPURLResponse * _response;
+    uint64_t _crc64ecma;
+}
+
+- (void)reset {
+    _collectingData = nil;
+    _fileHandle = nil;
+    _response = nil;
+}
+
+- (instancetype)initForOperationType:(OSSOperationType)operationType {
+    if (self = [super init]) {
+        _operationTypeForThisParser = operationType;
+    }
+    return self;
+}
+
+- (void)consumeHttpResponse:(NSHTTPURLResponse *)response {
+    _response = response;
+}
+
+- (OSSTask *)consumeHttpResponseBody:(NSData *)data
+{
+    if (_crc64Verifiable&&(_operationTypeForThisParser == OSSOperationTypeGetObject))
+    {
+        NSMutableData *mutableData = [NSMutableData dataWithData:data];
+        if (_crc64ecma != 0)
+        {
+            _crc64ecma = [OSSUtil crc64ForCombineCRC1:_crc64ecma
+                                                 CRC2:[mutableData oss_crc64]
+                                               length:mutableData.length];
+        }else
+        {
+            _crc64ecma = [mutableData oss_crc64];
+        }
+    }
+    
+    if (self.onRecieveBlock) {
+        self.onRecieveBlock(data);
+        return [OSSTask taskWithResult:nil];
+    }
+    
+    NSError * error;
+    if (self.downloadingFileURL)
+    {
+        if (!_fileHandle)
+        {
+            NSFileManager * fm = [NSFileManager defaultManager];
+            NSString * dirName = [[self.downloadingFileURL path] stringByDeletingLastPathComponent];
+            if (![fm fileExistsAtPath:dirName])
+            {
+                [fm createDirectoryAtPath:dirName withIntermediateDirectories:YES attributes:nil error:&error];
+            }
+            if (![fm fileExistsAtPath:dirName] || error)
+            {
+                return [OSSTask taskWithError:[NSError errorWithDomain:OSSClientErrorDomain
+                                                                  code:OSSClientErrorCodeFileCantWrite
+                                                              userInfo:@{OSSErrorMessageTOKEN: [NSString stringWithFormat:@"Can't create dir at %@", dirName]}]];
+            }
+            [fm createFileAtPath:[self.downloadingFileURL path] contents:nil attributes:nil];
+            if (![fm fileExistsAtPath:[self.downloadingFileURL path]])
+            {
+                return [OSSTask taskWithError:[NSError errorWithDomain:OSSClientErrorDomain
+                                                                  code:OSSClientErrorCodeFileCantWrite
+                                                              userInfo:@{OSSErrorMessageTOKEN: [NSString stringWithFormat:@"Can't create file at %@", [self.downloadingFileURL path]]}]];
+            }
+            _fileHandle = [NSFileHandle fileHandleForWritingToURL:self.downloadingFileURL error:&error];
+            if (error)
+            {
+                return [OSSTask taskWithError:[NSError errorWithDomain:OSSClientErrorDomain
+                                                                  code:OSSClientErrorCodeFileCantWrite
+                                                              userInfo:[error userInfo]]];
+            }
+            [_fileHandle writeData:data];
+        } else
+        {
+            @try {
+                [_fileHandle writeData:data];
+            }
+            @catch (NSException *exception) {
+                return [OSSTask taskWithError:[NSError errorWithDomain:OSSServerErrorDomain
+                                                                  code:OSSClientErrorCodeFileCantWrite
+                                                              userInfo:@{OSSErrorMessageTOKEN: [exception description]}]];
+            }
+        }
+    } else
+    {
+        if (!_collectingData)
+        {
+            _collectingData = [[NSMutableData alloc] initWithData:data];
+        }
+        else
+        {
+            [_collectingData appendData:data];
+        }
+    }
+    return [OSSTask taskWithResult:nil];
+}
+
+- (void)parseResponseHeader:(NSHTTPURLResponse *)response toResultObject:(OSSResult *)result
+{
+    result.httpResponseCode = [_response statusCode];
+    result.httpResponseHeaderFields = [NSDictionary dictionaryWithDictionary:[_response allHeaderFields]];
+    [[_response allHeaderFields] enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+        NSString * keyString = (NSString *)key;
+        if ([keyString isEqualToString:@"x-oss-request-id"])
+        {
+            result.requestId = obj;
+        }
+        else if ([keyString isEqualToString:@"x-oss-hash-crc64ecma"])
+        {
+            result.remoteCRC64ecma = obj;
+        }
+    }];
+}
+
+- (NSDictionary *)parseResponseHeaderToGetMeta:(NSHTTPURLResponse *)response
+{
+    NSMutableDictionary * meta = [NSMutableDictionary new];
+    
+    /* define a constant array to contain all meta header name */
+    static NSArray * OSSObjectMetaFieldNames = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        OSSObjectMetaFieldNames = @[@"Content-Type", @"Content-Length", @"Etag", @"Last-Modified", @"x-oss-request-id", @"x-oss-object-type",
+                                    @"If-Modified-Since", @"If-Unmodified-Since", @"If-Match", @"If-None-Match"];
+    });
+    /****************************************************************/
+    
+    [[_response allHeaderFields] enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+        NSString * keyString = (NSString *)key;
+        if ([OSSObjectMetaFieldNames containsObject:keyString] || [keyString hasPrefix:@"x-oss-meta"]) {
+            [meta setObject:obj forKey:key];
+        }
+    }];
+    return meta;
+}
+
+- (nullable id)constructResultObject
+{
+    if (self.onRecieveBlock)
+    {
+        return nil;
+    }
+    
+    switch (_operationTypeForThisParser)
+    {
+        case OSSOperationTypeGetService:
+        {
+            OSSGetServiceResult * getServiceResult = [OSSGetServiceResult new];
+            if (_response)
+            {
+                [self parseResponseHeader:_response toResultObject:getServiceResult];
+            }
+            if (_collectingData)
+            {
+                NSDictionary * parseDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                OSSLogVerbose(@"Get service dict: %@", parseDict);
+                if (parseDict)
+                {
+                    getServiceResult.ownerId = [[parseDict objectForKey:OSSOwnerXMLTOKEN] objectForKey:OSSIDXMLTOKEN];
+                    getServiceResult.ownerDispName = [[parseDict objectForKey:OSSOwnerXMLTOKEN] objectForKey:OSSDisplayNameXMLTOKEN];
+                    getServiceResult.prefix = [parseDict objectForKey:OSSPrefixXMLTOKEN];
+                    getServiceResult.marker = [parseDict objectForKey:OSSMarkerXMLTOKEN];
+                    getServiceResult.maxKeys = [[parseDict objectForKey:OSSMaxKeysXMLTOKEN] intValue];
+                    getServiceResult.isTruncated = [[parseDict objectForKey:OSSIsTruncatedXMLTOKEN] boolValue];
+                    
+                    id bucketObject = [[parseDict objectForKey:OSSBucketsXMLTOKEN] objectForKey:OSSBucketXMLTOKEN];
+                    if ([bucketObject isKindOfClass:[NSArray class]]) {
+                        getServiceResult.buckets = bucketObject;
+                    } else if ([bucketObject isKindOfClass:[NSDictionary class]]) {
+                        NSArray * arr = [NSArray arrayWithObject:bucketObject];
+                        getServiceResult.buckets = arr;
+                    } else {
+                        getServiceResult.buckets = nil;
+                    }
+                }
+            }
+            return getServiceResult;
+        }
+            
+        case OSSOperationTypeCreateBucket:
+        {
+            OSSCreateBucketResult * createBucketResult = [OSSCreateBucketResult new];
+            if (_response)
+            {
+                [self parseResponseHeader:_response toResultObject:createBucketResult];
+                [_response.allHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+                    if ([((NSString *)key) isEqualToString:@"Location"]) {
+                        createBucketResult.location = obj;
+                        *stop = YES;
+                    }
+                }];
+            }
+            return createBucketResult;
+        }
+            
+        case OSSOperationTypeGetBucketACL:
+        {
+            OSSGetBucketACLResult * getBucketACLResult = [OSSGetBucketACLResult new];
+            if (_response)
+            {
+                [self parseResponseHeader:_response toResultObject:getBucketACLResult];
+            }
+            if (_collectingData)
+            {
+                NSDictionary * parseDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                OSSLogVerbose(@"Get service dict: %@", parseDict);
+                if (parseDict)
+                {
+                    getBucketACLResult.aclGranted = [[parseDict objectForKey:OSSAccessControlListXMLTOKEN] objectForKey:OSSGrantXMLTOKEN];
+                }
+            }
+            return getBucketACLResult;
+        }
+            
+        case OSSOperationTypeDeleteBucket:
+        {
+            OSSDeleteBucketResult * deleteBucketResult = [OSSDeleteBucketResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:deleteBucketResult];
+            }
+            return deleteBucketResult;
+        }
+            
+        case OSSOperationTypeGetBucket:
+        {
+            OSSGetBucketResult * getBucketResult = [OSSGetBucketResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:getBucketResult];
+            }
+            if (_collectingData) {
+                NSDictionary * parsedDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                OSSLogVerbose(@"Get bucket dict: %@", parsedDict);
+                
+                if (parsedDict) {
+                    getBucketResult.bucketName = [parsedDict objectForKey:OSSNameXMLTOKEN];
+                    getBucketResult.prefix = [parsedDict objectForKey:OSSPrefixXMLTOKEN];
+                    getBucketResult.marker = [parsedDict objectForKey:OSSMarkerXMLTOKEN];
+                    getBucketResult.nextMarker = [parsedDict objectForKey:OSSNextMarkerXMLTOKEN];
+                    getBucketResult.maxKeys = (int32_t)[[parsedDict objectForKey:OSSMaxKeysXMLTOKEN] integerValue];
+                    getBucketResult.delimiter = [parsedDict objectForKey:OSSDelimiterXMLTOKEN];
+                    getBucketResult.isTruncated = [[parsedDict objectForKey:OSSIsTruncatedXMLTOKEN] boolValue];
+                    
+                    id contentObject = [parsedDict objectForKey:OSSContentsXMLTOKEN];
+                    if ([contentObject isKindOfClass:[NSArray class]]) {
+                        getBucketResult.contents = contentObject;
+                    } else if ([contentObject isKindOfClass:[NSDictionary class]]) {
+                        NSArray * arr = [NSArray arrayWithObject:contentObject];
+                        getBucketResult.contents = arr;
+                    } else {
+                        getBucketResult.contents = nil;
+                    }
+                    
+                    NSMutableArray * commentPrefixesArr = [NSMutableArray new];
+                    id commentPrefixes = [parsedDict objectForKey:OSSCommonPrefixesXMLTOKEN];
+                    if ([commentPrefixes isKindOfClass:[NSArray class]]) {
+                        for (NSDictionary * prefix in commentPrefixes) {
+                            [commentPrefixesArr addObject:[prefix objectForKey:@"Prefix"]];
+                        }
+                    } else if ([commentPrefixes isKindOfClass:[NSDictionary class]]) {
+                        [commentPrefixesArr addObject:[(NSDictionary *)commentPrefixes objectForKey:@"Prefix"]];
+                    } else {
+                        commentPrefixesArr = nil;
+                    }
+                    
+                    getBucketResult.commentPrefixes = commentPrefixesArr;
+                }
+            }
+            return getBucketResult;
+        }
+            
+        case OSSOperationTypeListMultipartUploads:
+        {
+            OSSListMultipartUploadsResult * listMultipartUploadsResult = [OSSListMultipartUploadsResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:listMultipartUploadsResult];
+            }
+            if (_collectingData) {
+                NSDictionary * parsedDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                OSSLogVerbose(@"List multipart uploads dict: %@", parsedDict);
+                
+                if (parsedDict) {
+                    listMultipartUploadsResult.bucketName = [parsedDict objectForKey:OSSBucketXMLTOKEN];
+                    listMultipartUploadsResult.prefix = [parsedDict objectForKey:OSSPrefixXMLTOKEN];
+                    listMultipartUploadsResult.uploadIdMarker = [parsedDict objectForKey:OSSUploadIdMarkerXMLTOKEN];
+                    listMultipartUploadsResult.nextUploadIdMarker = [parsedDict objectForKey:OSSUploadIdMarkerXMLTOKEN];
+                    listMultipartUploadsResult.keyMarker = [parsedDict objectForKey:OSSKeyMarkerXMLTOKEN];
+                    listMultipartUploadsResult.nextKeyMarker = [parsedDict objectForKey:OSSNextKeyMarkerXMLTOKEN];
+                    listMultipartUploadsResult.maxUploads = (int32_t)[[parsedDict objectForKey:OSSMaxUploadsXMLTOKEN] integerValue];
+                    listMultipartUploadsResult.delimiter = [parsedDict objectForKey:OSSDelimiterXMLTOKEN];
+                    listMultipartUploadsResult.isTruncated = [[parsedDict objectForKey:OSSIsTruncatedXMLTOKEN] boolValue];
+                    
+                    id contentObject = [parsedDict objectForKey:OSSUploadXMLTOKEN];
+                    if ([contentObject isKindOfClass:[NSArray class]]) {
+                        listMultipartUploadsResult.uploads = contentObject;
+                    } else if ([contentObject isKindOfClass:[NSDictionary class]]) {
+                        NSArray * arr = [NSArray arrayWithObject:contentObject];
+                        listMultipartUploadsResult.uploads = arr;
+                    } else {
+                        listMultipartUploadsResult.uploads = nil;
+                    }
+                    
+                    NSMutableArray * commentPrefixesArr = [NSMutableArray new];
+                    id commentPrefixes = [parsedDict objectForKey:OSSCommonPrefixesXMLTOKEN];
+                    if ([commentPrefixes isKindOfClass:[NSArray class]]) {
+                        for (NSDictionary * prefix in commentPrefixes) {
+                            [commentPrefixesArr addObject:[prefix objectForKey:@"Prefix"]];
+                        }
+                    } else if ([commentPrefixes isKindOfClass:[NSDictionary class]]) {
+                        [commentPrefixesArr addObject:[(NSDictionary *)commentPrefixes objectForKey:@"Prefix"]];
+                    } else {
+                        commentPrefixesArr = nil;
+                    }
+                    
+                    listMultipartUploadsResult.commonPrefixes = commentPrefixesArr;
+                }
+            }
+            return listMultipartUploadsResult;
+        }
+            
+        case OSSOperationTypeHeadObject:
+        {
+            OSSHeadObjectResult * headObjectResult = [OSSHeadObjectResult new];
+            if (_response)
+            {
+                [self parseResponseHeader:_response toResultObject:headObjectResult];
+                headObjectResult.objectMeta = [self parseResponseHeaderToGetMeta:_response];
+            }
+            return headObjectResult;
+        }
+            
+        case OSSOperationTypeGetObject:
+        {
+            OSSGetObjectResult * getObejctResult = [OSSGetObjectResult new];
+            OSSLogDebug(@"GetObjectResponse: %@", _response);
+            if (_response)
+            {
+                [self parseResponseHeader:_response toResultObject:getObejctResult];
+                getObejctResult.objectMeta = [self parseResponseHeaderToGetMeta:_response];
+                if (_crc64ecma != 0)
+                {
+                    getObejctResult.localCRC64ecma = [NSString stringWithFormat:@"%llu",_crc64ecma];
+                }
+            }
+            if (_fileHandle) {
+                [_fileHandle closeFile];
+            }
+            
+            if (_collectingData) {
+                getObejctResult.downloadedData = _collectingData;
+            }
+            return getObejctResult;
+        }
+        case OSSOperationTypeGetObjectACL:
+        {
+            OSSGetObjectACLResult * getObjectACLResult = [OSSGetObjectACLResult new];
+            OSSLogDebug(@"GetObjectResponse: %@", _response);
+            if (_response)
+            {
+                [self parseResponseHeader:_response toResultObject:getObjectACLResult];
+            }
+            
+            if (_collectingData) {
+                NSDictionary * parseDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                OSSLogVerbose(@"Get service dict: %@", parseDict);
+                getObjectACLResult.grant = parseDict[@"AccessControlList"][@"Grant"];
+            }
+            
+            
+            return getObjectACLResult;
+        }
+            
+        case OSSOperationTypePutObject:
+        {
+            OSSPutObjectResult * putObjectResult = [OSSPutObjectResult new];
+            if (_response)
+            {
+                [self parseResponseHeader:_response toResultObject:putObjectResult];
+                [_response.allHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+                    if ([((NSString *)key) isEqualToString:@"Etag"]) {
+                        putObjectResult.eTag = obj;
+                        *stop = YES;
+                    }
+                }];
+            }
+            if (_collectingData) {
+                putObjectResult.serverReturnJsonString = [[NSString alloc] initWithData:_collectingData encoding:NSUTF8StringEncoding];
+            }
+            return putObjectResult;
+        }
+            
+        case OSSOperationTypeAppendObject:
+        {
+            OSSAppendObjectResult * appendObjectResult = [OSSAppendObjectResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:appendObjectResult];
+                [_response.allHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+                    if ([((NSString *)key) isEqualToString:@"Etag"]) {
+                        appendObjectResult.eTag = obj;
+                    }
+                    if ([((NSString *)key) isEqualToString:@"x-oss-next-append-position"]) {
+                        appendObjectResult.xOssNextAppendPosition = [((NSString *)obj) longLongValue];
+                    }
+                }];
+            }
+            return appendObjectResult;
+        }
+            
+        case OSSOperationTypeDeleteObject: {
+            OSSDeleteObjectResult * deleteObjectResult = [OSSDeleteObjectResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:deleteObjectResult];
+            }
+            return deleteObjectResult;
+        }
+        case OSSOperationTypeDeleteMultipleObjects: {
+            OSSDeleteMultipleObjectsResult * deleteObjectResult = [OSSDeleteMultipleObjectsResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:deleteObjectResult];
+            }
+            
+            if (_collectingData) {
+                NSDictionary *dict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                deleteObjectResult.encodingType = dict[@"EncodingType"];
+                deleteObjectResult.deletedObjects = dict[@"Deleted"];
+            }
+            
+            return deleteObjectResult;
+        }
+        case OSSOperationTypePutObjectACL: {
+            OSSPutObjectACLResult * putObjectACLResult = [OSSPutObjectACLResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:putObjectACLResult];
+            }
+            return putObjectACLResult;
+        }
+            
+        case OSSOperationTypeCopyObject: {
+            OSSCopyObjectResult * copyObjectResult = [OSSCopyObjectResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:copyObjectResult];
+            }
+            if (_collectingData) {
+                OSSLogVerbose(@"copy object dict: %@", [NSDictionary oss_dictionaryWithXMLData:_collectingData]);
+                NSDictionary * parsedDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                if (parsedDict) {
+                    copyObjectResult.lastModifed = [parsedDict objectForKey:OSSLastModifiedXMLTOKEN];
+                    copyObjectResult.eTag = [parsedDict objectForKey:OSSETagXMLTOKEN];
+                }
+            }
+            return copyObjectResult;
+        }
+            
+        case OSSOperationTypeInitMultipartUpload: {
+            OSSInitMultipartUploadResult * initMultipartUploadResult = [OSSInitMultipartUploadResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:initMultipartUploadResult];
+            }
+            if (_collectingData) {
+                NSDictionary * parsedDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                OSSLogVerbose(@"init multipart upload result: %@", parsedDict);
+                if (parsedDict) {
+                    initMultipartUploadResult.uploadId = [parsedDict objectForKey:OSSUploadIdXMLTOKEN];
+                }
+            }
+            return initMultipartUploadResult;
+        }
+            
+        case OSSOperationTypeUploadPart: {
+            OSSUploadPartResult * uploadPartResult = [OSSUploadPartResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:uploadPartResult];
+                [_response.allHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
+                    if ([((NSString *)key) isEqualToString:@"Etag"]) {
+                        uploadPartResult.eTag = obj;
+                        *stop = YES;
+                    }
+                }];
+            }
+            return uploadPartResult;
+        }
+            
+        case OSSOperationTypeCompleteMultipartUpload: {
+            OSSCompleteMultipartUploadResult * completeMultipartUploadResult = [OSSCompleteMultipartUploadResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:completeMultipartUploadResult];
+            }
+            if (_collectingData) {
+                if ([[[_response.allHeaderFields objectForKey:OSSHttpHeaderContentType] description] isEqual:@"application/xml"]) {
+                    OSSLogVerbose(@"complete multipart upload result: %@", [NSDictionary oss_dictionaryWithXMLData:_collectingData]);
+                    NSDictionary * parsedDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                    if (parsedDict) {
+                        completeMultipartUploadResult.location = [parsedDict objectForKey:OSSLocationXMLTOKEN];
+                        completeMultipartUploadResult.eTag = [parsedDict objectForKey:OSSETagXMLTOKEN];
+                    }
+                } else {
+                    completeMultipartUploadResult.serverReturnJsonString = [[NSString alloc] initWithData:_collectingData encoding:NSUTF8StringEncoding];
+                }
+            }
+            return completeMultipartUploadResult;
+        }
+            
+        case OSSOperationTypeListMultipart: {
+            OSSListPartsResult * listPartsReuslt = [OSSListPartsResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:listPartsReuslt];
+            }
+            if (_collectingData) {
+                NSDictionary * parsedDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                OSSLogVerbose(@"list multipart upload result: %@", parsedDict);
+                if (parsedDict) {
+                    listPartsReuslt.nextPartNumberMarker = [[parsedDict objectForKey:OSSNextPartNumberMarkerXMLTOKEN] intValue];
+                    listPartsReuslt.maxParts = [[parsedDict objectForKey:OSSMaxPartsXMLTOKEN] intValue];
+                    listPartsReuslt.isTruncated = [[parsedDict objectForKey:OSSIsTruncatedXMLTOKEN] boolValue];
+                    
+                    id partsObject = [parsedDict objectForKey:OSSPartXMLTOKEN];
+                    if ([partsObject isKindOfClass:[NSArray class]]) {
+                        listPartsReuslt.parts = partsObject;
+                    } else if ([partsObject isKindOfClass:[NSDictionary class]]) {
+                        NSArray * arr = [NSArray arrayWithObject:partsObject];
+                        listPartsReuslt.parts = arr;
+                    } else {
+                        listPartsReuslt.parts = nil;
+                    }
+                }
+            }
+            return listPartsReuslt;
+        }
+            
+        case OSSOperationTypeAbortMultipartUpload: {
+            OSSAbortMultipartUploadResult * abortMultipartUploadResult = [OSSAbortMultipartUploadResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:abortMultipartUploadResult];
+            }
+            return abortMultipartUploadResult;
+        }
+        case OSSOperationTypeTriggerCallBack: {
+            OSSCallBackResult *callbackResult = [OSSCallBackResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:callbackResult];
+            }
+            
+            if (_collectingData) {
+                if ([[[_response.allHeaderFields objectForKey:OSSHttpHeaderContentType] description] isEqual:@"application/xml"]) {
+                    NSDictionary * parsedDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                    OSSLogVerbose(@"callback trigger result<xml>: %@", parsedDict);
+                    callbackResult.serverReturnXML = parsedDict;
+                } else if ([[[_response.allHeaderFields objectForKey:OSSHttpHeaderContentType] description] isEqual:@"application/json"]) {
+                    callbackResult.serverReturnJsonString = [[NSString alloc] initWithData:_collectingData encoding:NSUTF8StringEncoding];
+                    OSSLogVerbose(@"callback trigger result<json>: %@", callbackResult.serverReturnJsonString);
+                }
+            }
+            return callbackResult;
+        }
+        case OSSOperationTypeImagePersist: {
+            OSSImagePersistResult *imagePersistResult = [OSSImagePersistResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:imagePersistResult];
+            }
+            return imagePersistResult;
+        }
+        case OSSOperationTypeGetBucketInfo: {
+            OSSGetBucketInfoResult *bucketInfoResult = [[OSSGetBucketInfoResult alloc] init];
+            if (_collectingData)
+            {
+                NSDictionary * parseDict = [NSDictionary oss_dictionaryWithXMLData:_collectingData];
+                if ([parseDict valueForKey:@"Bucket"])
+                {
+                    NSDictionary *result = [parseDict valueForKey:@"Bucket"];
+                    OSSLogVerbose(@"Get bucketInfo dict: %@", parseDict);
+                    bucketInfoResult.bucketName = [result valueForKey:@"Name"];
+                    bucketInfoResult.storageClass = [result valueForKey:@"StorageClass"];
+                    bucketInfoResult.location = [result valueForKey:@"Location"];
+                    bucketInfoResult.intranetEndpoint = [result valueForKey:@"IntranetEndpoint"];
+                    bucketInfoResult.extranetEndpoint = [result valueForKey:@"ExtranetEndpoint"];
+                    bucketInfoResult.creationDate = [result valueForKey:@"CreationDate"];
+                    
+                    if ([result valueForKey:@"Owner"]) {
+                        bucketInfoResult.owner = [[OSSBucketOwner alloc] init];
+                        bucketInfoResult.owner.userName = [[result valueForKey:@"Owner"] valueForKey:@"DisplayName"];
+                        bucketInfoResult.owner.userId = [[result valueForKey:@"Owner"] valueForKey:@"ID"];
+                    }
+                    
+                    if ([result valueForKey:@"AccessControlList"]) {
+                        bucketInfoResult.acl = [OSSAccessControlList new];
+                        bucketInfoResult.acl.grant = [[result valueForKey:@"AccessControlList"] valueForKey:@"Grant"];
+                    }
+                }
+            }
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:bucketInfoResult];
+            }
+            return bucketInfoResult;
+        }
+        case OSSOperationTypeRestoreObject: {
+            OSSRestoreObjectResult * restoreObjectResult = [OSSRestoreObjectResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:restoreObjectResult];
+            }
+            return restoreObjectResult;
+        }
+        case OSSOperationTypePutSymlink: {
+            OSSPutSymlinkResult * putSymlinkResult = [OSSPutSymlinkResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:putSymlinkResult];
+            }
+            return putSymlinkResult;
+        }
+        case OSSOperationTypeGetSymlink: {
+            OSSGetSymlinkResult * getSymlinkResult = [OSSGetSymlinkResult new];
+            if (_response) {
+                [self parseResponseHeader:_response toResultObject:getSymlinkResult];
+            }
+            return getSymlinkResult;
+        }
+        default: {
+            OSSLogError(@"unknown operation type");
+            break;
+        }
+    }
+    return nil;
+}
+
+@end

+ 16 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpdns.h

@@ -0,0 +1,16 @@
+//
+//  OSSHttpdns.h
+//  AliyunOSSiOS
+//
+//  Created by zhouzhuo on 5/1/16.
+//  Copyright © 2016 zhouzhuo. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface OSSHttpdns : NSObject
+
++ (instancetype)sharedInstance;
+
+- (NSString *)asynGetIpByHost:(NSString *)host;
+@end

+ 140 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSHttpdns.m

@@ -0,0 +1,140 @@
+//
+//  OSSHttpdns.m
+//  AliyunOSSiOS
+//
+//  Created by zhouzhuo on 5/1/16.
+//  Copyright © 2016 zhouzhuo. All rights reserved.
+//
+
+#import "OSSLog.h"
+#import "OSSHttpdns.h"
+#import "OSSIPv6Adapter.h"
+
+NSString * const OSS_HTTPDNS_SERVER_IP = @"203.107.1.1";
+NSString * const OSS_HTTPDNS_SERVER_PORT = @"80";
+
+NSString * const ACCOUNT_ID = @"181345";
+NSTimeInterval const MAX_ENDURABLE_EXPIRED_TIME_IN_SECOND = 60; // The DNS entry's expiration time in seconds. After it expires, the entry is invalid.
+NSTimeInterval const PRERESOLVE_IN_ADVANCE_IN_SECOND = 10; // Once the remaining valid time of an DNS entry is less than this number, issue a DNS request to prefetch the data.
+
+@interface IpObject : NSObject
+
+@property (nonatomic, copy) NSString * ip;
+@property (nonatomic, assign) NSTimeInterval expiredTime;
+
+@end
+
+@implementation IpObject
+@end
+
+
+@implementation OSSHttpdns {
+    NSMutableDictionary * gHostIpMap;
+    NSMutableSet * penddingSet;
+}
+
++ (instancetype)sharedInstance {
+    static OSSHttpdns * sharedInstance = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        sharedInstance = [OSSHttpdns new];
+    });
+    return sharedInstance;
+}
+
+- (instancetype)init {
+    if (self = [super init]) {
+        gHostIpMap = [NSMutableDictionary new];
+        penddingSet = [NSMutableSet new];
+    }
+    return self;
+}
+
+/**
+ *  OSS SDK specific
+ *
+ *  @param host it needs strictly follow the domain's format, such as oss-cn-hangzhou.aliyuncs.com
+ *
+ *  @return an ip in the ip list of the resolved host.
+ */
+- (NSString *)asynGetIpByHost:(NSString *)host {
+    IpObject * ipObject = [gHostIpMap objectForKey:host];
+    if (!ipObject) {
+
+        // if the host is not resolved, asynchronously resolve it and return nil
+        [self resolveHost:host];
+        return nil;
+    } else if ([[NSDate date] timeIntervalSince1970] - ipObject.expiredTime > MAX_ENDURABLE_EXPIRED_TIME_IN_SECOND) {
+
+        // If the entry is expired, asynchronously resolve it and return nil.
+        [self resolveHost:host];
+        return nil;
+    } else if (ipObject.expiredTime -[[NSDate date] timeIntervalSince1970] < PRERESOLVE_IN_ADVANCE_IN_SECOND) {
+
+        // If the entry is about to expire, asynchronously resolve it and return the current value.
+        [self resolveHost:host];
+        return ipObject.ip;
+    } else {
+
+        // returns the current result.
+        return ipObject.ip;
+    }
+}
+
+/**
+ *  resolve the host asynchronously
+
+ *  If the host is being resolved, the call will be skipped.
+ *
+ *  @param host the host to resolve
+ */
+- (void)resolveHost:(NSString *)host {
+
+    @synchronized (self) {
+        if ([penddingSet containsObject:host]) {
+            return;
+        } else {
+            [penddingSet addObject:host];
+        }
+    }
+
+    NSURL * url = [NSURL URLWithString:[NSString stringWithFormat:@"https://%@/%@/d?host=%@", [[OSSIPv6Adapter getInstance] handleIpv4Address:OSS_HTTPDNS_SERVER_IP], ACCOUNT_ID, host]];
+    NSURLSession * session = [NSURLSession sharedSession];
+
+    NSURLSessionDataTask * dataTask = [session dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
+
+        IpObject * ipObject = nil;
+        NSUInteger statusCode = ((NSHTTPURLResponse *)response).statusCode;
+        if (statusCode != 200) {
+            OSSLogError(@"Httpdns resolve host: %@ failed, responseCode: %lu", host, (unsigned long)statusCode);
+        } else {
+            NSError *error = nil;
+            NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
+
+            NSTimeInterval expiredTime = [[NSDate new] timeIntervalSince1970] + [[json objectForKey:@"ttl"] longLongValue];
+
+            NSArray *ips = [json objectForKey:@"ips"];
+            if (ips == nil || [ips count] == 0) {
+                OSSLogError(@"Httpdns resolve host: %@ failed, ip list empty.", host);
+            } else {
+                NSString * ip = ips[0];
+                ipObject = [IpObject new];
+                ipObject.expiredTime = expiredTime;
+                ipObject.ip = ip;
+                OSSLogDebug(@"Httpdns resolve host: %@ success, ip: %@, expiredTime: %lf", host, ipObject.ip, ipObject.expiredTime);
+            }
+        }
+
+        @synchronized (self) {
+            if (ipObject) {
+                gHostIpMap[host] = ipObject;
+            }
+
+            [penddingSet removeObject:host];
+        }
+    }];
+
+    [dataTask resume];
+}
+
+@end

+ 114 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6Adapter.h

@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2000-2015 Apple Inc. All rights reserved.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ *
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * https://www.opensource.apple.com/apsl/ and read it before using this file.
+ *
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
+ *
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
+ */
+/*
+ * Copyright (c) 1980, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)route.h	8.3 (Berkeley) 4/19/94
+ * $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $
+ */
+
+
+#ifndef AlicloudIPv6Adapter_h
+#define AlicloudIPv6Adapter_h
+#import <Foundation/Foundation.h>
+
+@interface OSSIPv6Adapter : NSObject
+
++ (instancetype)getInstance;
+
+/**
+ *	@brief	Checks if it's a IPv6-only network. If it's true, it's IPv6-only.
+ *
+ *	@return return YES for IPv6-only network,otherWise return NO
+ */
+- (BOOL)isIPv6OnlyNetwork;
+
+/**
+ *	@brief	Refresh the IPV6-only check
+ *
+ *	@return return YES for IPv6-only network,otherWise return NO
+ */
+- (BOOL)reResolveIPv6OnlyStatus;
+
+/**
+ *	@brief	Adapts the IPv4 address into IPv6 format under IPv6-only network.
+ *          For example:
+                42.156.220.114 -> 64:ff9b::2a9c:dc72
+ *	@param 	addr
+ *          ip address
+ *
+ *	@return return an IPv6 address
+ */
+- (NSString *)handleIpv4Address:(NSString *)addr;
+
+/**
+ *	@brief	Checks if it's an IPv4 address.
+ *
+ *	@return return YES while addr is an IPv4 address,otherwise return NO
+ */
+- (BOOL)isIPv4Address:(NSString *)addr;
+
+/**
+ *	@brief	Checks if it's an IPv6 address
+ *
+ *	@return return YES while addr is an IPv6 address,otherwise return NO
+ */
+- (BOOL)isIPv6Address:(NSString *)addr;
+
+@end
+
+#endif /* OSSIPv6Adapter_h */

+ 197 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6Adapter.m

@@ -0,0 +1,197 @@
+//
+//  OSSIPv6Adapter.m
+//
+//  Created by lingkun on 16/5/16.
+//  Copyright © 2016 Ali. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "OSSIPv6Adapter.h"
+#import "OSSIPv6PrefixResolver.h"
+#import "OSSReachabilityManager.h"
+#import "OSSLog.h"
+
+#include <arpa/inet.h>
+#include <dns.h>
+#include <err.h>
+#include <ifaddrs.h>
+#include <net/if.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+
+#if TARGET_OS_IOS
+#import <UIKit/UIApplication.h>
+#elif TARGET_OS_OSX
+#import <AppKit/NSApplication.h>
+#endif
+
+#define UNKNOWN_STACK         0
+#define SUPPORT_IPV4_STACK    1
+#define SUPPORT_IPV6_STACK    2
+#define ROUNDUP_LEN(a) \
+((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+#define TypeEN    "en0"
+
+#define IOS_9_VERSION     @"9.0"
+
+@implementation OSSIPv6Adapter
+{
+    BOOL isIPv6Only;
+    BOOL isIPv6OnlyResolved;
+}
+
+- (instancetype)init {
+    if (self = [super init]) {
+        isIPv6Only = NO;
+        isIPv6OnlyResolved = NO;
+        
+        NSString *notificationName;
+#if TARGET_OS_IOS
+        notificationName = UIApplicationDidBecomeActiveNotification;
+#elif TARGET_OS_OSX
+        notificationName = NSApplicationDidBecomeActiveNotification;
+#endif
+
+        // When App switches to active status, refresh the IPv6-only check.
+        NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
+        [defaultCenter addObserver:self
+                          selector:@selector(appDidBecomeActiveFunc)
+                              name:notificationName
+                            object:nil];
+    }
+    return self;
+}
+
++ (instancetype)getInstance {
+    static id singletonInstance = nil;
+    static dispatch_once_t once_token;
+    dispatch_once(&once_token, ^{
+        if (!singletonInstance) {
+            singletonInstance = [[super allocWithZone:NULL] init];
+        }
+    });
+    return singletonInstance;
+}
+
+- (BOOL)isIPv6OnlyNetwork {
+    @synchronized(self) {
+        if (isIPv6OnlyResolved) {
+            return isIPv6Only;
+        }
+        
+        OSSLogDebug(@"Start resolved network to see if in IPv6-Only env.");
+        int localStack = 0;
+        
+        localStack = SUPPORT_IPV4_STACK | SUPPORT_IPV6_STACK;
+        localStack &= [self getDNSServersIpStack];
+        
+        if (localStack & SUPPORT_IPV4_STACK) {
+            // support IPv4
+            isIPv6Only = NO;
+        } else if (localStack & SUPPORT_IPV6_STACK) {
+            // IPv6-Only
+            isIPv6Only = YES;
+            [[OSSIPv6PrefixResolver getInstance] updateIPv6Prefix];
+        } else {
+            OSSLogDebug(@"[%s]: Error.", __FUNCTION__);
+            isIPv6Only = NO;
+        }
+        isIPv6OnlyResolved = YES;
+        if (isIPv6Only) {
+            OSSLogDebug(@"[%s]: IPv6-Only network now.", __FUNCTION__);
+        } else {
+            OSSLogDebug(@"[%s]: Not IPv6-Only network now.", __FUNCTION__);
+        }
+        return isIPv6Only;
+    }
+}
+
+- (void)appDidBecomeActiveFunc {
+    OSSLogDebug(@"[%s]: App become active, refresh IPv6-Only status.", __FUNCTION__);
+    [self reResolveIPv6OnlyStatus];
+}
+
+- (BOOL)reResolveIPv6OnlyStatus {
+    isIPv6OnlyResolved = NO;
+    return [self isIPv6OnlyNetwork];
+}
+
+- (NSString *)handleIpv4Address:(NSString *)addr {
+    if (addr == nil || addr.length == 0) {
+        return nil;
+    }
+    
+    if ([self isIPv6Address:addr]) return [NSString stringWithFormat:@"[%@]", addr];
+    
+    NSString *convertedAddr;
+    if ([self isIPv6OnlyNetwork]) {
+        convertedAddr = [[OSSIPv6PrefixResolver getInstance] convertIPv4toIPv6:addr];
+        return [NSString stringWithFormat:@"[%@]", convertedAddr];
+    } else  {
+        convertedAddr = addr;
+    }
+    return convertedAddr;
+}
+
+/**
+ *	@brief	Looks up the DNS server stack and returns the flag combinations of SUPPORT_IPV4_STACK and SUPPORT_IPV6_STACK.
+ *
+ *	@return the flag combinations of SUPPORT_IPV4_STACK and SUPPORT_IPV6_STACK
+ */
+- (int)getDNSServersIpStack {
+    int dns_stack = 0;
+    res_state res = malloc(sizeof(struct __res_state));
+    int result = res_ninit(res);
+    if (result == 0) {
+        union res_9_sockaddr_union *addr_union = malloc(res->nscount * sizeof(union res_9_sockaddr_union));
+        res_getservers(res, addr_union, res->nscount);
+        for (int i = 0; i < res->nscount; i++) {
+            if (addr_union[i].sin.sin_family == AF_INET) {
+                char ip[INET_ADDRSTRLEN];
+                if (inet_ntop(AF_INET, &(addr_union[i].sin.sin_addr), ip, INET_ADDRSTRLEN)) {
+                    dns_stack |= SUPPORT_IPV4_STACK;
+                }
+            } else if (addr_union[i].sin6.sin6_family == AF_INET6) {
+                char ip[INET6_ADDRSTRLEN];
+                if (inet_ntop(AF_INET6, &(addr_union[i].sin6.sin6_addr), ip, INET6_ADDRSTRLEN)) {
+                    dns_stack |= SUPPORT_IPV6_STACK;
+                }
+            } else {
+                OSSLogDebug(@"%s: Undefined family.", __FUNCTION__);
+            }
+        }
+        free(addr_union);
+    }
+    res_ndestroy(res);
+    free(res);
+    return dns_stack;
+}
+
+- (BOOL)isIPv4Address:(NSString *)addr {
+    if (addr == nil) {
+        return NO;
+    }
+    const char *utf8 = [addr UTF8String];
+    // Check valid IPv4.
+    struct in_addr dst;
+    int success = inet_pton(AF_INET, utf8, &(dst.s_addr));
+    return success == 1;
+}
+
+- (BOOL)isIPv6Address:(NSString *)addr {
+    if (addr == nil) {
+        return NO;
+    }
+    const char *utf8 = [addr UTF8String];
+    // Check valid IPv6.
+    struct in6_addr dst6;
+    int success = inet_pton(AF_INET6, utf8, &dst6);
+    return (success == 1);
+}
+
+@end

+ 23 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6PrefixResolver.h

@@ -0,0 +1,23 @@
+//
+//  OSSIPv6PrefixResolver.h
+//
+//  Created by lingkun on 16/5/16.
+//  Edit by zhouzhuo on 16/5/22
+//  Copyright © 2016 Ali. All rights reserved.
+//
+
+#ifndef AlicloudIPv6PrefixResolver_h
+#define AlicloudIPv6PrefixResolver_h
+#import <Foundation/Foundation.h>
+
+@interface OSSIPv6PrefixResolver : NSObject
+
++ (instancetype)getInstance;
+
+- (void)updateIPv6Prefix;
+
+- (NSString *)convertIPv4toIPv6:(NSString *)ipv4;
+
+@end
+
+#endif /* OSSIPv6PrefixResolver_h */

+ 205 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSIPv6PrefixResolver.m

@@ -0,0 +1,205 @@
+//
+//  OSSIPv6PrefixResolver.m
+//
+//  Created by lingkun on 16/5/16.
+//  Edit by zhouzhuo on 2016/5/22
+//  Copyright © 2016 Ali. All rights reserved.
+
+#import "OSSIPv6PrefixResolver.h"
+#import "OSSLog.h"
+
+#import <Foundation/Foundation.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+static const __uint8_t NS_PREFIX_32[4] = {0x20, 0x01, 0x0d, 0xb8};
+static const __uint8_t NS_PREFIX_40[5] = {0x20, 0x01, 0x0d, 0xb8, 0x01};
+static const __uint8_t NS_PREFIX_48[6] = {0x20, 0x01, 0x0d, 0xb8, 0x01, 0x22};
+static const __uint8_t NS_PREFIX_56[7] = {0x20, 0x01, 0x0d, 0xb8, 0x01, 0x22, 0x03};
+static const __uint8_t NS_PREFIX_64[8] = {0x20, 0x01, 0x0d, 0xb8, 0x01, 0x22, 0x03, 0x44};
+static const __uint8_t NS_PREFIX_96[12] = {0x20, 0x01, 0x0d, 0xb8, 0x01, 0x22, 0x03, 0x44, 0x00, 0x00, 0x00, 0x00};
+static const __uint8_t WK_PREFIX_96[12] = {0x00, 0x64, 0xff, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const __uint8_t* V6_PREFIX_CONTENT_TABLE[7] = {
+    WK_PREFIX_96,
+    NS_PREFIX_32,
+    NS_PREFIX_40,
+    NS_PREFIX_48,
+    NS_PREFIX_56,
+    NS_PREFIX_64,
+    NS_PREFIX_96};
+
+static const __uint8_t V6_PREFIX_SIZE_TABLE[7] = {
+    sizeof(WK_PREFIX_96)/sizeof(__uint8_t),
+    sizeof(NS_PREFIX_32)/sizeof(__uint8_t),
+    sizeof(NS_PREFIX_40)/sizeof(__uint8_t),
+    sizeof(NS_PREFIX_48)/sizeof(__uint8_t),
+    sizeof(NS_PREFIX_56)/sizeof(__uint8_t),
+    sizeof(NS_PREFIX_64)/sizeof(__uint8_t),
+    sizeof(NS_PREFIX_96)/sizeof(__uint8_t)};
+
+static const __uint8_t V6_PREFIX_TABLE_SIZE = 7;
+
+typedef enum {
+    IPv6PrefixUnResolved = 0,
+    IPv6PrefixResolving,
+    IPv6PrefixResolved
+} IPv6PrefixResolveStatus;
+
+@implementation OSSIPv6PrefixResolver {
+    IPv6PrefixResolveStatus ipv6PrefixResolveStatus;
+    __uint8_t *ipv6Prefix;
+    int prefixLen;
+}
+
+- (instancetype)init {
+    if (self = [super init]) {
+        ipv6PrefixResolveStatus = IPv6PrefixUnResolved;
+        ipv6Prefix = (__uint8_t *)V6_PREFIX_CONTENT_TABLE[0];
+        prefixLen = V6_PREFIX_SIZE_TABLE[0];
+    }
+    return self;
+}
+
++ (instancetype)getInstance {
+    static id singletonInstance = nil;
+    static dispatch_once_t once_token;
+    dispatch_once(&once_token, ^{
+        if (!singletonInstance) {
+            singletonInstance = [[super allocWithZone:NULL] init];
+        }
+    });
+    return singletonInstance;
+}
+
+/**
+ *	@brief	Updates IPv6 Prefix
+ */
+- (void)updateIPv6Prefix {
+    @synchronized(self) {
+        ipv6PrefixResolveStatus = IPv6PrefixUnResolved;
+        [self resolveIPv6Prefix:ipv6Prefix];
+    }
+}
+
+- (BOOL)isIPv6Prefix:(__uint8_t *)v6Prefix
+       withPrefixLen:(int)pLen
+              withIP:(__uint8_t *)ip
+           withIPLen:(int)ipLen {
+    for (int i = 0; i < pLen && i < ipLen; i++) {
+        if (*(v6Prefix + i) != *(ip + i)) {
+            return NO;
+        }
+    }
+    return YES;
+}
+
+- (__uint8_t)resolveIPv6Prefix:(__uint8_t *)prefix {
+    if ( !prefix ) {
+        return 0;
+    }
+    __uint8_t len = prefixLen;
+    memcpy(prefix, ipv6Prefix, prefixLen);
+    @synchronized(self) {
+        if (ipv6PrefixResolveStatus==IPv6PrefixUnResolved ) {
+            ipv6PrefixResolveStatus = IPv6PrefixResolving;
+            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                struct addrinfo hints, *addr;
+                memset(&hints, 0, sizeof(hints));
+                hints.ai_family = PF_INET6;
+                hints.ai_socktype = SOCK_STREAM;
+                hints.ai_flags = AI_DEFAULT;
+                
+                if (0 != getaddrinfo("ipv4only.arpa", "http", &hints, &addr)) {
+                    ipv6PrefixResolveStatus = IPv6PrefixUnResolved;
+                    return;
+                }
+                
+                if (addr && AF_INET6 == addr->ai_addr->sa_family) {
+                    struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)(addr->ai_addr);
+                    if ( !addr6 ) {
+                        ipv6PrefixResolveStatus = IPv6PrefixUnResolved;
+                        return;
+                    }
+                    
+                    __uint8_t* u8 = addr6->sin6_addr.__u6_addr.__u6_addr8;
+                    for (__uint8_t i=0; i < V6_PREFIX_TABLE_SIZE; i++) {
+                        if ([self isIPv6Prefix:(__uint8_t *)V6_PREFIX_CONTENT_TABLE[i]
+                                 withPrefixLen:V6_PREFIX_SIZE_TABLE[i]
+                                        withIP:u8
+                                     withIPLen:16]) {
+                            
+                            ipv6Prefix = (__uint8_t *)V6_PREFIX_CONTENT_TABLE[i];
+                            prefixLen = V6_PREFIX_SIZE_TABLE[i];
+                            ipv6PrefixResolveStatus = IPv6PrefixResolved;
+                            break;
+                        }
+                    }
+                    ipv6PrefixResolveStatus = IPv6PrefixUnResolved;
+                }
+                
+            });
+        }
+    }
+    
+    return len;
+}
+
+- (NSString *)convertIPv4toIPv6:(NSString *)ipv4 {
+    if ([ipv4 length] <= 0) {
+        return nil;
+    }
+    
+    __uint8_t ipv6[16] = {0x00};
+    __uint8_t length = [self resolveIPv6Prefix:ipv6];
+    
+    if (length <= 0) {
+        return nil;
+    }
+    
+    in_addr_t addr_v4 = inet_addr([ipv4 UTF8String]);
+    
+    // 按length的不同情况进行处理
+    if (length==4 || length==12) { //32 bits or 96 bits
+        ipv6[length+0] |= (__uint8_t)(addr_v4>>0 & 0xff);
+        ipv6[length+1] |= (__uint8_t)(addr_v4>>8 & 0xff);
+        ipv6[length+2] |= (__uint8_t)(addr_v4>>16 & 0xff);
+        ipv6[length+3] |= (__uint8_t)(addr_v4>>24 & 0xff);
+    }
+    else if (length == 5) { //40 bits  :a.b.c.0.d
+        ipv6[length+0] |= (__uint8_t)(addr_v4>>0 & 0xff);
+        ipv6[length+1] |= (__uint8_t)(addr_v4>>8 & 0xff);
+        ipv6[length+2] |= (__uint8_t)(addr_v4>>16 & 0xff);
+        ipv6[length+4] |= (__uint8_t)(addr_v4>>24 & 0xff);
+    }
+    else if (length == 6) { //48 bits   :a.b.0.c.d
+        ipv6[length+0] |= (__uint8_t)(addr_v4>>0 & 0xff);
+        ipv6[length+1] |= (__uint8_t)(addr_v4>>8 & 0xff);
+        ipv6[length+3] |= (__uint8_t)(addr_v4>>16 & 0xff);
+        ipv6[length+4] |= (__uint8_t)(addr_v4>>24 & 0xff);
+    }
+    else if (length == 7) { //56 bits   :a.0.b.c.d
+        ipv6[length+0] |= (__uint8_t)(addr_v4>>0 & 0xff);
+        ipv6[length+2] |= (__uint8_t)(addr_v4>>8 & 0xff);
+        ipv6[length+3] |= (__uint8_t)(addr_v4>>16 & 0xff);
+        ipv6[length+4] |= (__uint8_t)(addr_v4>>24 & 0xff);
+    }
+    else if (length == 8) { //64 bits   :0.a.b.c.d
+        ipv6[length+1] |= (__uint8_t)(addr_v4>>0 & 0xff);
+        ipv6[length+2] |= (__uint8_t)(addr_v4>>8 & 0xff);
+        ipv6[length+3] |= (__uint8_t)(addr_v4>>16 & 0xff);
+        ipv6[length+4] |= (__uint8_t)(addr_v4>>24 & 0xff);
+    }
+    
+    // constructs the IPv6 structure
+    char addr_text[ MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN) ];
+    if(inet_ntop(AF_INET6, ipv6, addr_text, INET6_ADDRSTRLEN)) {
+        NSString *ret = [NSString stringWithUTF8String:addr_text];
+        return ret;
+    }
+    return nil;
+}
+
+@end

+ 15 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSReachabilityManager.h

@@ -0,0 +1,15 @@
+//
+//  OSSReachabilityManager.h
+//
+//  Created by 亿刀 on 14-1-9.
+//  Edited by junmo on 15-5-16
+//  Copyright (c) 2014 Twitter. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface OSSReachabilityManager : NSObject
+
++ (OSSReachabilityManager *)shareInstance;
+
+@end

+ 97 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSIPv6/OSSReachabilityManager.m

@@ -0,0 +1,97 @@
+//
+//  OSSReachabilityManager.m
+//
+//  Created by 亿刀 on 14-1-9.
+//  Edited by junmo on 15-5-16
+//  Edited by zhouzhuo on 2016/5/22
+//  Copyright (c) 2014 Twitter. All rights reserved.
+//
+
+#import "OSSReachabilityManager.h"
+#import "OSSIPv6Adapter.h"
+#import "OSSLog.h"
+
+#import <arpa/inet.h>
+#import <CommonCrypto/CommonDigest.h>
+#import <CoreTelephony/CTCarrier.h>
+#import <CoreTelephony/CTTelephonyNetworkInfo.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+#import <netinet/in.h>
+#import <netinet6/in6.h>
+#import <sys/socket.h>
+#import <SystemConfiguration/CaptiveNetwork.h>
+#import <SystemConfiguration/SystemConfiguration.h>
+
+static char *const OSSReachabilityQueueIdentifier = "com.alibaba.oss.network.ReachabilityQueue";
+static dispatch_queue_t reachabilityQueue;
+static NSString *const CHECK_HOSTNAME = @"www.taobao.com";
+
+@implementation OSSReachabilityManager {
+    SCNetworkReachabilityRef            _reachabilityRef;
+}
+
++ (OSSReachabilityManager *)shareInstance
+{
+    static OSSReachabilityManager *s_SPDYNetworkStatusManager = nil;
+    
+    @synchronized([self class])
+    {
+        if (!s_SPDYNetworkStatusManager)
+        {
+            s_SPDYNetworkStatusManager = [[OSSReachabilityManager alloc] init];
+        }
+    }
+    
+    return s_SPDYNetworkStatusManager;
+}
+
+- (id)init
+{
+    self = [super init];
+    if (self)
+    {
+        _reachabilityRef =  SCNetworkReachabilityCreateWithName(NULL, [CHECK_HOSTNAME UTF8String]);
+
+        // Start network monitor
+        [self _startNotifier];
+    }
+
+    return self;
+}
+
+- (BOOL)_startNotifier
+{
+    if (!_reachabilityRef)
+    {
+        _reachabilityRef =  SCNetworkReachabilityCreateWithName(NULL, [CHECK_HOSTNAME UTF8String]);
+    }
+
+    if (_reachabilityRef)
+    {
+        SCNetworkReachabilityContext context = {0, (__bridge void *)(self), NULL, NULL, NULL};
+        
+        if(SCNetworkReachabilitySetCallback(_reachabilityRef, ReachabilityCallback, &context))
+        {
+            reachabilityQueue = dispatch_queue_create(OSSReachabilityQueueIdentifier, DISPATCH_QUEUE_SERIAL);
+            SCNetworkReachabilitySetDispatchQueue(_reachabilityRef, reachabilityQueue);
+
+            return YES;
+        }
+    }
+    return NO;
+}
+
+// Callback of Network change 
+static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info)
+{
+    if ([[OSSIPv6Adapter getInstance] isIPv6OnlyNetwork]) {
+        OSSLogDebug(@"[AlicloudReachabilityManager]: Network changed, Pre network status is IPv6-Only.");
+    } else {
+        OSSLogDebug(@"[AlicloudReachabilityManager]: Network changed, Pre network status is not IPv6-Only.");
+    }
+
+    [[OSSIPv6Adapter getInstance] reResolveIPv6OnlyStatus];
+}
+
+@end

+ 22 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSInputStreamHelper.h

@@ -0,0 +1,22 @@
+//
+//  OSSInputStreamHelper.h
+//  AliyunOSSSDK
+//
+//  Created by 怀叙 on 2017/12/7.
+//  Copyright © 2017年 阿里云. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+@interface OSSInputStreamHelper : NSObject
+
+@property (nonatomic, assign) uint64_t crc64;
+
+- (instancetype)initWithFileAtPath:(nonnull NSString *)path;
+- (instancetype)initWithURL:(nonnull NSURL *)URL;
+
+- (void)syncReadBuffers;
+
+@end
+NS_ASSUME_NONNULL_END

+ 80 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSInputStreamHelper.m

@@ -0,0 +1,80 @@
+//
+//  OSSInputStreamHelper.m
+//  AliyunOSSSDK
+//
+//  Created by 怀叙 on 2017/12/7.
+//  Copyright © 2017年 阿里云. All rights reserved.
+//
+
+#import "OSSInputStreamHelper.h"
+#import "OSSLog.h"
+#import "aos_crc64.h"
+
+@interface OSSInputStreamHelper ()
+{
+    NSInputStream *_inputStream;
+    CFAbsoluteTime _startTime;
+    dispatch_semaphore_t _semaphore;
+}
+
+@end
+
+@implementation OSSInputStreamHelper
+
+- (instancetype)initWithFileAtPath:(nonnull NSString *)path
+{
+    self = [super init];
+    if (self) {
+        _crc64 = 0;
+        _inputStream = [NSInputStream inputStreamWithFileAtPath:path];
+        _semaphore = dispatch_semaphore_create(1);
+    }
+    return self;
+}
+
+- (instancetype)initWithURL:(nonnull NSURL *)URL
+{
+    self = [super init];
+    if (self) {
+        _crc64 = 0;
+        _inputStream = [NSInputStream inputStreamWithURL:URL];
+        _semaphore = dispatch_semaphore_create(1);
+    }
+    return self;
+}
+
+- (void)syncReadBuffers
+{
+    dispatch_semaphore_wait(_semaphore, DISPATCH_TIME_FOREVER);
+
+    _startTime = CFAbsoluteTimeGetCurrent();
+    [_inputStream open];
+    NSInteger length = 1;
+    while (length > 0)
+    {
+        @autoreleasepool{
+            uint8_t streamData[1024 * 4];
+            length = [_inputStream read:streamData maxLength:1024 * 4];
+            if (length > 0) {
+                _crc64 = aos_crc64(_crc64, streamData, length);
+            }
+        }
+    }
+    
+    if (length < 0) {
+        OSSLogError(@"there is an error when reading buffer from file!");
+    }
+    [_inputStream close];
+    
+    CFAbsoluteTime duration =  CFAbsoluteTimeGetCurrent() - _startTime;
+    OSSLogDebug(@"read file cost time is :%f",duration);
+    
+    dispatch_semaphore_signal(_semaphore);
+}
+
+- (uint64_t)crc64
+{
+    return _crc64;
+}
+
+@end

+ 54 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSLog.h

@@ -0,0 +1,54 @@
+//
+//  OSSLog.h
+//  oss_ios_sdk
+//
+//  Created by zhouzhuo on 8/16/15.
+//  Copyright (c) 2015 aliyun.com. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "OSSCocoaLumberjack.h"
+static const OSSDDLogLevel ossLogLevel = OSSDDLogLevelAll;
+
+// colorful log configuration
+// see https://github.com/robbiehanson/XcodeColors
+
+#define XCODE_COLORS_ESCAPE @"\033["
+
+#define XCODE_COLORS_RESET_FG  XCODE_COLORS_ESCAPE @"fg;" // Clear any foreground color
+#define XCODE_COLORS_RESET_BG  XCODE_COLORS_ESCAPE @"bg;" // Clear any background color
+#define XCODE_COLORS_RESET     XCODE_COLORS_ESCAPE @";"   // Clear any foreground or background color
+
+#define OSSLogVerbose(frmt, ...)\
+if ([OSSLog isLogEnable]) {\
+OSSDDLogVerbose(@"[Verbose]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
+}
+
+#define OSSLogDebug(frmt, ...)\
+if ([OSSLog isLogEnable]) {\
+OSSDDLogDebug(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
+}
+
+#define OSSLogDebugNoFile(frmt, ...)\
+if ([OSSLog isLogEnable]) {\
+NSLog(@"[Debug]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
+}
+
+#define OSSLogError(frmt, ...)\
+if ([OSSLog isLogEnable]) {\
+OSSDDLogError(@"[Error]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
+}
+
+#define OSSLogWarn(frmt, ...)\
+if ([OSSLog isLogEnable]) {\
+OSSDDLogWarn(@"[Warning]: %@", [NSString stringWithFormat:(frmt), ##__VA_ARGS__]);\
+}
+
+static BOOL isEnable;
+
+@interface OSSLog : NSObject
+
++ (void)enableLog;
++ (void)disableLog;
++ (BOOL)isLogEnable;
+@end

+ 31 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSLog.m

@@ -0,0 +1,31 @@
+//
+//  OSSLog.m
+//  oss_ios_sdk
+//
+//  Created by zhouzhuo on 8/16/15.
+//  Copyright (c) 2015 aliyun.com. All rights reserved.
+//
+
+#import "OSSLog.h"
+#import "OSSUtil.h"
+
+@implementation OSSLog
++ (void)enableLog {
+    if([OSSUtil hasPhoneFreeSpace]){
+        isEnable = YES;
+        [OSSDDLog removeAllLoggers];
+        [OSSDDLog addLogger:[OSSNSLogger sharedInstance]];
+        OSSDDFileLogger *fileLogger = [[OSSDDFileLogger alloc] init];
+        [OSSDDLog addLogger:fileLogger];
+    }
+}
+
++ (void)disableLog {
+    isEnable = NO;
+}
+
++ (BOOL)isLogEnable {
+    return isEnable;
+}
+
+@end

File diff suppressed because it is too large
+ 1480 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSModel.h


+ 855 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSModel.m

@@ -0,0 +1,855 @@
+//
+//  OSSModel.m
+//  oss_ios_sdk
+//
+//  Created by zhouzhuo on 8/16/15.
+//  Copyright (c) 2015 aliyun.com. All rights reserved.
+//
+#import "OSSDefine.h"
+#import "OSSModel.h"
+#import "OSSBolts.h"
+#import "OSSUtil.h"
+#import "OSSNetworking.h"
+#import "OSSLog.h"
+#import "OSSXMLDictionary.h"
+#if TARGET_OS_IOS
+#import <UIKit/UIDevice.h>
+#endif
+
+#import "OSSAllRequestNeededMessage.h"
+
+@implementation NSDictionary (OSS)
+
+- (NSString *)base64JsonString {
+    NSError * error;
+    NSData * jsonData = [NSJSONSerialization dataWithJSONObject:self
+                                                        options:0
+                                                          error:&error];
+
+    if (!jsonData) {
+        return @"e30="; // base64("{}");
+    } else {
+        NSString * jsonStr = [[[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] stringByReplacingOccurrencesOfString:@"\\/" withString:@"/"];
+        NSLog(@"callback json - %@", jsonStr);
+        return [[jsonStr dataUsingEncoding:NSUTF8StringEncoding] base64EncodedStringWithOptions:0];
+    }
+}
+
+@end
+
+@implementation OSSSyncMutableDictionary
+
+- (instancetype)init {
+    if (self = [super init]) {
+        _dictionary = [NSMutableDictionary dictionary];
+        _dispatchQueue = dispatch_queue_create("com.aliyun.aliyunsycmutabledictionary", DISPATCH_QUEUE_SERIAL);
+    }
+
+    return self;
+}
+
+- (NSArray *)allKeys {
+    __block NSArray *allKeys = nil;
+    dispatch_sync(self.dispatchQueue, ^{
+        allKeys = [self.dictionary allKeys];
+    });
+    return allKeys;
+}
+
+- (id)objectForKey:(id)aKey {
+    __block id returnObject = nil;
+
+    dispatch_sync(self.dispatchQueue, ^{
+        returnObject = [self.dictionary objectForKey:aKey];
+    });
+
+    return returnObject;
+}
+
+- (void)setObject:(id)anObject forKey:(id <NSCopying>)aKey {
+    dispatch_sync(self.dispatchQueue, ^{
+        [self.dictionary oss_setObject:anObject forKey:aKey];
+    });
+}
+
+- (void)removeObjectForKey:(id)aKey {
+    dispatch_sync(self.dispatchQueue, ^{
+        [self.dictionary removeObjectForKey:aKey];
+    });
+}
+
+@end
+
+@implementation OSSFederationToken
+
+- (NSString *)description
+{
+    return [NSString stringWithFormat:@"OSSFederationToken<%p>:{AccessKeyId: %@\nAccessKeySecret: %@\nSecurityToken: %@\nExpiration: %@}", self, _tAccessKey, _tSecretKey, _tToken, _expirationTimeInGMTFormat];
+}
+
+@end
+
+@implementation OSSPlainTextAKSKPairCredentialProvider
+
+- (instancetype)initWithPlainTextAccessKey:(nonnull NSString *)accessKey secretKey:(nonnull NSString *)secretKey {
+    if (self = [super init]) {
+        self.accessKey = [accessKey oss_trim];
+        self.secretKey = [secretKey oss_trim];
+    }
+    return self;
+}
+
+- (nullable NSString *)sign:(NSString *)content error:(NSError **)error {
+    if (![self.accessKey oss_isNotEmpty] || ![self.secretKey oss_isNotEmpty])
+    {
+        if (error != nil)
+        {
+            *error = [NSError errorWithDomain:OSSClientErrorDomain
+                                         code:OSSClientErrorCodeSignFailed
+                                     userInfo:@{OSSErrorMessageTOKEN: @"accessKey or secretKey can't be null"}];
+        }
+        
+        return nil;
+    }
+    NSString * sign = [OSSUtil calBase64Sha1WithData:content withSecret:self.secretKey];
+    return [NSString stringWithFormat:@"OSS %@:%@", self.accessKey, sign];
+}
+
+@end
+
+@implementation OSSCustomSignerCredentialProvider
+
+- (instancetype)initWithImplementedSigner:(OSSCustomSignContentBlock)signContent
+{
+    NSParameterAssert(signContent);
+    if (self = [super init])
+    {
+        _signContent = signContent;
+    }
+    return self;
+}
+
+- (NSString *)sign:(NSString *)content error:(NSError **)error
+{
+    NSString * signature = @"";
+    @synchronized(self) {
+        signature = self.signContent(content, error);
+    }
+    if (*error) {
+        *error = [NSError errorWithDomain:OSSClientErrorDomain
+                                     code:OSSClientErrorCodeSignFailed
+                                 userInfo:[[NSDictionary alloc] initWithDictionary:[*error userInfo]]];
+        return nil;
+    }
+    return signature;
+}
+
+@end
+
+@implementation OSSFederationCredentialProvider
+
+- (instancetype)initWithFederationTokenGetter:(OSSGetFederationTokenBlock)federationTokenGetter {
+    if (self = [super init]) {
+        self.federationTokenGetter = federationTokenGetter;
+    }
+    return self;
+}
+
+- (nullable OSSFederationToken *)getToken:(NSError **)error {
+    OSSFederationToken * validToken = nil;
+    @synchronized(self) {
+        if (self.cachedToken == nil) {
+
+            self.cachedToken = self.federationTokenGetter();
+        } else {
+            if (self.cachedToken.expirationTimeInGMTFormat) {
+                NSDateFormatter * fm = [NSDateFormatter new];
+                [fm setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"];
+                self.cachedToken.expirationTimeInMilliSecond = [[fm dateFromString:self.cachedToken.expirationTimeInGMTFormat] timeIntervalSince1970] * 1000;
+                self.cachedToken.expirationTimeInGMTFormat = nil;
+                OSSLogVerbose(@"Transform GMT date to expirationTimeInMilliSecond: %lld", self.cachedToken.expirationTimeInMilliSecond);
+            }
+
+            NSDate * expirationDate = [NSDate dateWithTimeIntervalSince1970:(NSTimeInterval)(self.cachedToken.expirationTimeInMilliSecond / 1000)];
+            NSTimeInterval interval = [expirationDate timeIntervalSinceDate:[NSDate oss_clockSkewFixedDate]];
+            /* if this token will be expired after less than 2min, we abort it in case of when request arrived oss server,
+               it's expired already. */
+            if (interval < 5 * 60) {
+                OSSLogDebug(@"get federation token, but after %lf second it would be expired", interval);
+                self.cachedToken = self.federationTokenGetter();
+            }
+        }
+
+        validToken = self.cachedToken;
+    }
+    if (!validToken)
+    {
+        if (error != nil)
+        {
+            *error = [NSError errorWithDomain:OSSClientErrorDomain
+                                         code:OSSClientErrorCodeSignFailed
+                                     userInfo:@{OSSErrorMessageTOKEN: @"Can't get a federation token"}];
+        }
+        
+        return nil;
+    }
+    return validToken;
+}
+
+@end
+
+@implementation OSSStsTokenCredentialProvider
+
+- (OSSFederationToken *)getToken {
+    OSSFederationToken * token = [OSSFederationToken new];
+    token.tAccessKey = self.accessKeyId;
+    token.tSecretKey = self.secretKeyId;
+    token.tToken = self.securityToken;
+    token.expirationTimeInMilliSecond = NSIntegerMax;
+    return token;
+}
+
+- (instancetype)initWithAccessKeyId:(NSString *)accessKeyId secretKeyId:(NSString *)secretKeyId securityToken:(NSString *)securityToken {
+    if (self = [super init]) {
+        self.accessKeyId = [accessKeyId oss_trim];
+        self.secretKeyId = [secretKeyId oss_trim];
+        self.securityToken = [securityToken oss_trim];
+    }
+    return self;
+}
+
+- (NSString *)sign:(NSString *)content error:(NSError **)error {
+    NSString * sign = [OSSUtil calBase64Sha1WithData:content withSecret:self.secretKeyId];
+    return [NSString stringWithFormat:@"OSS %@:%@", self.accessKeyId, sign];
+}
+
+@end
+
+@implementation OSSAuthCredentialProvider
+
+- (instancetype)initWithAuthServerUrl:(NSString *)authServerUrl
+{
+    return [self initWithAuthServerUrl:authServerUrl responseDecoder:nil];
+}
+
+- (instancetype)initWithAuthServerUrl:(NSString *)authServerUrl responseDecoder:(nullable OSSResponseDecoderBlock)decoder
+{
+    self = [super initWithFederationTokenGetter:^OSSFederationToken * {
+        NSURL * url = [NSURL URLWithString:self.authServerUrl];
+        NSURLRequest * request = [NSURLRequest requestWithURL:url];
+        OSSTaskCompletionSource * tcs = [OSSTaskCompletionSource taskCompletionSource];
+        NSURLSession * session = [NSURLSession sharedSession];
+        NSURLSessionTask * sessionTask = [session dataTaskWithRequest:request
+                                                    completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
+                                                        if (error) {
+                                                            [tcs setError:error];
+                                                            return;
+                                                        }
+                                                        [tcs setResult:data];
+                                                    }];
+        [sessionTask resume];
+        [tcs.task waitUntilFinished];
+        if (tcs.task.error) {
+            return nil;
+        } else {
+            NSData* data = tcs.task.result;
+            if(decoder){
+                data = decoder(data);
+            }
+            NSDictionary * object = [NSJSONSerialization JSONObjectWithData:data
+                                                                    options:kNilOptions
+                                                                      error:nil];
+            int statusCode = [[object objectForKey:@"StatusCode"] intValue];
+            if (statusCode == 200) {
+                OSSFederationToken * token = [OSSFederationToken new];
+                // All the entries below are mandatory.
+                token.tAccessKey = [object objectForKey:@"AccessKeyId"];
+                token.tSecretKey = [object objectForKey:@"AccessKeySecret"];
+                token.tToken = [object objectForKey:@"SecurityToken"];
+                token.expirationTimeInGMTFormat = [object objectForKey:@"Expiration"];
+                OSSLogDebug(@"token: %@ %@ %@ %@", token.tAccessKey, token.tSecretKey, token.tToken, [object objectForKey:@"Expiration"]);
+                return token;
+            }else{
+                return nil;
+            }
+            
+        }
+    }];
+    if(self){
+        self.authServerUrl = authServerUrl;
+    }
+    return self;
+}
+
+@end
+
+NSString * const BACKGROUND_SESSION_IDENTIFIER = @"com.aliyun.oss.backgroundsession";
+
+@implementation OSSClientConfiguration
+
+- (instancetype)init {
+    if (self = [super init]) {
+        self.maxRetryCount = OSSDefaultRetryCount;
+        self.maxConcurrentRequestCount = OSSDefaultMaxConcurrentNum;
+        self.enableBackgroundTransmitService = NO;
+        self.isHttpdnsEnable = YES;
+        self.backgroundSesseionIdentifier = BACKGROUND_SESSION_IDENTIFIER;
+        self.timeoutIntervalForRequest = OSSDefaultTimeoutForRequestInSecond;
+        self.timeoutIntervalForResource = OSSDefaultTimeoutForResourceInSecond;
+    }
+    return self;
+}
+
+- (void)setCnameExcludeList:(NSArray *)cnameExcludeList {
+    NSMutableArray * array = [NSMutableArray new];
+    [cnameExcludeList enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        NSString * host = [(NSString *)obj lowercaseString];
+        if ([host containsString:@"://"]) {
+            NSString * trimHost = [host substringFromIndex:[host rangeOfString:@"://"].location + 3];
+            [array addObject:trimHost];
+        } else {
+            [array addObject:host];
+        }
+    }];
+    _cnameExcludeList = array.copy;
+}
+
+@end
+
+@implementation OSSSignerInterceptor
+
+- (instancetype)initWithCredentialProvider:(id<OSSCredentialProvider>)credentialProvider {
+    if (self = [super init]) {
+        self.credentialProvider = credentialProvider;
+    }
+    return self;
+}
+
+- (OSSTask *)interceptRequestMessage:(OSSAllRequestNeededMessage *)requestMessage {
+    OSSLogVerbose(@"signing intercepting - ");
+    NSError * error = nil;
+
+    /****************************************************************
+    * define a constant array to contain all specified subresource */
+    static NSArray * OSSSubResourceARRAY = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        OSSSubResourceARRAY = @[@"acl", @"uploadId", @"partNumber", @"uploads", @"logging", @"website", @"location",
+                                @"lifecycle", @"referer", @"cors", @"delete", @"append", @"position", @"security-token", @"x-oss-process", @"sequential",@"bucketInfo",@"symlink", @"restore"];
+    });
+    /****************************************************************/
+
+    /* initial each part of content to sign */
+    NSString * method = requestMessage.httpMethod;
+    NSString * contentType = @"";
+    NSString * contentMd5 = @"";
+    NSString * date = requestMessage.date;
+    NSString * xossHeader = @"";
+    NSString * resource = @"";
+
+    OSSFederationToken * federationToken = nil;
+
+    if (requestMessage.contentType) {
+        contentType = requestMessage.contentType;
+    }
+    if (requestMessage.contentMd5) {
+        contentMd5 = requestMessage.contentMd5;
+    }
+
+    /* if credential provider is a federation token provider, it need to specially handle */
+    if ([self.credentialProvider isKindOfClass:[OSSFederationCredentialProvider class]]) {
+        federationToken = [(OSSFederationCredentialProvider *)self.credentialProvider getToken:&error];
+        if (error) {
+            return [OSSTask taskWithError:error];
+        }
+        [requestMessage.headerParams oss_setObject:federationToken.tToken forKey:@"x-oss-security-token"];
+    } else if ([self.credentialProvider isKindOfClass:[OSSStsTokenCredentialProvider class]]) {
+        federationToken = [(OSSStsTokenCredentialProvider *)self.credentialProvider getToken];
+        [requestMessage.headerParams oss_setObject:federationToken.tToken forKey:@"x-oss-security-token"];
+    }
+    
+    [requestMessage.headerParams oss_setObject:requestMessage.contentSHA1 forKey:OSSHttpHeaderHashSHA1];
+        
+    /* construct CanonicalizedOSSHeaders */
+    if (requestMessage.headerParams) {
+        NSMutableArray * params = [[NSMutableArray alloc] init];
+        NSArray * sortedKey = [[requestMessage.headerParams allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
+            return [obj1 compare:obj2];
+        }];
+        for (NSString * key in sortedKey) {
+            if ([key hasPrefix:@"x-oss-"]) {
+                [params addObject:[NSString stringWithFormat:@"%@:%@", key, [requestMessage.headerParams objectForKey:key]]];
+            }
+        }
+        if ([params count]) {
+            xossHeader = [NSString stringWithFormat:@"%@\n", [params componentsJoinedByString:@"\n"]];
+        }
+    }
+
+    /* construct CanonicalizedResource */
+    resource = @"/";
+    if (requestMessage.bucketName) {
+        resource = [NSString stringWithFormat:@"/%@/", requestMessage.bucketName];
+    }
+    if (requestMessage.objectKey) {
+        resource = [resource oss_stringByAppendingPathComponentForURL:requestMessage.objectKey];
+    }
+    if (requestMessage.params) {
+        NSMutableArray * querys = [[NSMutableArray alloc] init];
+        NSArray * sortedKey = [[requestMessage.params allKeys] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
+            return [obj1 compare:obj2];
+        }];
+        for (NSString * key in sortedKey) {
+            NSString * value = [requestMessage.params objectForKey:key];
+
+            if (![OSSSubResourceARRAY containsObject:key]) { // notice it's based on content compare
+                continue;
+            }
+
+            if ([value isEqualToString:@""]) {
+                [querys addObject:[NSString stringWithFormat:@"%@", key]];
+            } else {
+                [querys addObject:[NSString stringWithFormat:@"%@=%@", key, value]];
+            }
+        }
+        if ([querys count]) {
+            resource = [resource stringByAppendingString:[NSString stringWithFormat:@"?%@",[querys componentsJoinedByString:@"&"]]];
+        }
+    }
+
+    /* now, join every part of content and sign */
+    NSString * stringToSign = [NSString stringWithFormat:@"%@\n%@\n%@\n%@\n%@%@", method, contentMd5, contentType, date, xossHeader, resource];
+    OSSLogDebug(@"string to sign: %@", stringToSign);
+    if ([self.credentialProvider isKindOfClass:[OSSFederationCredentialProvider class]]
+        || [self.credentialProvider isKindOfClass:[OSSStsTokenCredentialProvider class]])
+    {
+        NSString * signature = [OSSUtil sign:stringToSign withToken:federationToken];
+        [requestMessage.headerParams oss_setObject:signature forKey:@"Authorization"];
+    }else if ([self.credentialProvider isKindOfClass:[OSSCustomSignerCredentialProvider class]])
+    {
+        OSSCustomSignerCredentialProvider *provider = (OSSCustomSignerCredentialProvider *)self.credentialProvider;
+        
+        NSError *customSignError;
+        NSString * signature = [provider sign:stringToSign error:&customSignError];
+        if (customSignError) {
+            OSSLogError(@"OSSCustomSignerError: %@",customSignError);
+        }
+        [requestMessage.headerParams oss_setObject:signature forKey:@"Authorization"];
+    }else
+    {
+        NSString * signature = [self.credentialProvider sign:stringToSign error:&error];
+        if (error) {
+            return [OSSTask taskWithError:error];
+        }
+        [requestMessage.headerParams oss_setObject:signature forKey:@"Authorization"];
+    }
+    return [OSSTask taskWithResult:nil];
+}
+
+@end
+
+@implementation OSSUASettingInterceptor
+
+- (instancetype)initWithClientConfiguration:(OSSClientConfiguration *)clientConfiguration{
+    if (self = [super init]) {
+        self.clientConfiguration = clientConfiguration;
+    }
+    return self;
+}
+
+- (OSSTask *)interceptRequestMessage:(OSSAllRequestNeededMessage *)request {
+    NSString * userAgent = [self getUserAgent:self.clientConfiguration.userAgentMark];
+    [request.headerParams oss_setObject:userAgent forKey:@"User-Agent"];
+    return [OSSTask taskWithResult:nil];
+}
+
+
+- (NSString *)getUserAgent:(NSString *)customUserAgent {
+    static NSString * userAgent = nil;
+    static dispatch_once_t once;
+    NSString * tempUserAgent = nil;
+    dispatch_once(&once, ^{
+        NSString *localeIdentifier = [[NSLocale currentLocale] localeIdentifier];
+#if TARGET_OS_IOS
+        NSString *systemName = [[[UIDevice currentDevice] systemName] stringByReplacingOccurrencesOfString:@" " withString:@"-"];
+        NSString *systemVersion = [[UIDevice currentDevice] systemVersion];
+        userAgent = [NSString stringWithFormat:@"%@/%@(/%@/%@/%@)", OSSUAPrefix, OSSSDKVersion, systemName, systemVersion, localeIdentifier];
+#elif TARGET_OS_OSX
+        userAgent = [NSString stringWithFormat:@"%@/%@(/%@/%@/%@)", OSSUAPrefix, OSSSDKVersion, @"OSX", [NSProcessInfo processInfo].operatingSystemVersionString, localeIdentifier];
+#endif
+    });
+    if(customUserAgent){
+        if(userAgent){
+            tempUserAgent = [[userAgent stringByAppendingString:@"/"] stringByAppendingString:customUserAgent];
+        }else{
+            tempUserAgent = customUserAgent;
+        }
+    }else{
+        tempUserAgent = userAgent;
+    }
+    return tempUserAgent;
+}
+
+@end
+
+@implementation OSSTimeSkewedFixingInterceptor
+
+- (OSSTask *)interceptRequestMessage:(OSSAllRequestNeededMessage *)request {
+    request.date = [[NSDate oss_clockSkewFixedDate] oss_asStringValue];
+    return [OSSTask taskWithResult:nil];
+}
+
+@end
+
+@implementation OSSRange
+
+- (instancetype)initWithStart:(int64_t)start withEnd:(int64_t)end {
+    if (self = [super init]) {
+        self.startPosition = start;
+        self.endPosition = end;
+    }
+    return self;
+}
+
+- (NSString *)toHeaderString {
+
+    NSString * rangeString = nil;
+
+    if (self.startPosition < 0 && self.endPosition < 0) {
+        rangeString = [NSString stringWithFormat:@"bytes=%lld-%lld", self.startPosition, self.endPosition];
+    } else if (self.startPosition < 0) {
+        rangeString = [NSString stringWithFormat:@"bytes=-%lld", self.endPosition];
+    } else if (self.endPosition < 0) {
+        rangeString = [NSString stringWithFormat:@"bytes=%lld-", self.startPosition];
+    } else {
+        rangeString = [NSString stringWithFormat:@"bytes=%lld-%lld", self.startPosition, self.endPosition];
+    }
+
+    return rangeString;
+}
+
+@end
+
+#pragma mark request and result objects
+
+@implementation OSSGetServiceRequest
+
+- (NSDictionary *)requestParams {
+    NSMutableDictionary * params = [NSMutableDictionary dictionary];
+    [params oss_setObject:self.prefix forKey:@"prefix"];
+    [params oss_setObject:self.marker forKey:@"marker"];
+    if (self.maxKeys > 0) {
+        [params oss_setObject:[@(self.maxKeys) stringValue] forKey:@"max-keys"];
+    }
+    return [params copy];
+}
+
+@end
+
+@implementation OSSGetServiceResult
+@end
+
+@implementation OSSCreateBucketRequest
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        _storageClass = OSSBucketStorageClassStandard;
+    }
+    return self;
+}
+
+- (NSString *)storageClassAsString {
+    NSString *storageClassString = nil;
+    switch (_storageClass) {
+        case OSSBucketStorageClassStandard:
+            storageClassString = @"Standard";
+            break;
+        case OSSBucketStorageClassIA:
+            storageClassString = @"IA";
+            break;
+        case OSSBucketStorageClassArchive:
+            storageClassString = @"Archive";
+            break;
+        default:
+            storageClassString = @"Unknown";
+            break;
+    }
+    return storageClassString;
+}
+
+@end
+
+@implementation OSSCreateBucketResult
+@end
+
+@implementation OSSDeleteBucketRequest
+@end
+
+@implementation OSSDeleteBucketResult
+@end
+
+@implementation OSSGetBucketRequest
+
+- (NSDictionary *)requestParams {
+    NSMutableDictionary * params = [NSMutableDictionary dictionary];
+    [params oss_setObject:self.delimiter forKey:@"delimiter"];
+    [params oss_setObject:self.prefix forKey:@"prefix"];
+    [params oss_setObject:self.marker forKey:@"marker"];
+    if (self.maxKeys > 0) {
+        [params oss_setObject:[@(self.maxKeys) stringValue] forKey:@"max-keys"];
+    }
+    return [params copy];
+}
+
+@end
+
+@implementation OSSListMultipartUploadsRequest
+- (NSDictionary *)requestParams {
+    NSMutableDictionary * params = [NSMutableDictionary dictionary];
+    [params oss_setObject:self.delimiter forKey:@"delimiter"];
+    [params oss_setObject:self.prefix forKey:@"prefix"];
+    [params oss_setObject:self.keyMarker forKey:@"key-marker"];
+    [params oss_setObject:self.uploadIdMarker forKey:@"upload-id-marker"];
+    [params oss_setObject:self.encodingType forKey:@"encoding-type"];
+    
+    if (self.maxUploads > 0) {
+        [params oss_setObject:[@(self.maxUploads) stringValue] forKey:@"max-uploads"];
+    }
+    
+    return [params copy];
+}
+@end
+
+@implementation OSSListMultipartUploadsResult
+@end
+
+@implementation OSSGetBucketResult
+@end
+
+@implementation OSSGetBucketACLRequest
+
+- (NSDictionary *)requestParams {
+    return @{@"acl": @""};
+}
+
+@end
+
+@implementation OSSGetBucketACLResult
+@end
+
+@implementation OSSHeadObjectRequest
+@end
+
+@implementation OSSHeadObjectResult
+@end
+
+@implementation OSSGetObjectRequest
+@end
+
+@implementation OSSGetObjectResult
+@end
+
+@implementation OSSPutObjectACLRequest
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        _acl = @"default";
+    }
+    return self;
+}
+
+@end
+
+@implementation OSSPutObjectACLResult
+@end
+
+@implementation OSSPutObjectRequest
+
+- (instancetype)init {
+    if (self = [super init]) {
+        self.objectMeta = [NSDictionary new];
+    }
+    return self;
+}
+
+@end
+
+@implementation OSSPutObjectResult
+@end
+
+@implementation OSSAppendObjectRequest
+
+- (instancetype)init {
+    if (self = [super init]) {
+        self.objectMeta = [NSDictionary new];
+    }
+    return self;
+}
+
+@end
+
+@implementation OSSAppendObjectResult
+@end
+
+@implementation OSSDeleteObjectRequest
+@end
+
+@implementation OSSDeleteObjectResult
+@end
+
+@implementation OSSCopyObjectRequest
+
+- (instancetype)init {
+    if (self = [super init]) {
+        self.objectMeta = [NSDictionary new];
+    }
+    return self;
+}
+
+@end
+
+@implementation OSSCopyObjectResult
+@end
+
+@implementation OSSInitMultipartUploadRequest
+
+- (instancetype)init {
+    if (self = [super init]) {
+        self.objectMeta = [NSDictionary new];
+    }
+    return self;
+}
+
+@end
+
+@implementation OSSInitMultipartUploadResult
+@end
+
+@implementation OSSUploadPartRequest
+@end
+
+@implementation OSSUploadPartResult
+@end
+
+@implementation OSSPartInfo
+
++ (instancetype)partInfoWithPartNum:(int32_t)partNum
+                               eTag:(NSString *)eTag
+                               size:(int64_t)size {
+    return [self partInfoWithPartNum:partNum
+                                eTag:eTag
+                                size:size
+                               crc64:0];
+}
+
++ (instancetype)partInfoWithPartNum:(int32_t)partNum eTag:(NSString *)eTag size:(int64_t)size crc64:(uint64_t)crc64
+{
+    OSSPartInfo *parInfo = [OSSPartInfo new];
+    parInfo.partNum = partNum;
+    parInfo.eTag = eTag;
+    parInfo.size = size;
+    parInfo.crc64 = crc64;
+    return parInfo;
+}
+
+- (nonnull NSDictionary *)entityToDictionary
+{
+    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+    [dict setValue:@(_partNum) forKey:@"partNum"];
+    if (_eTag)
+    {
+        [dict setValue:_eTag forKey:@"eTag"];
+    }
+    [dict setValue:@(_size) forKey:@"size"];
+    [dict setValue:@(_crc64) forKey:@"crc64"];
+    return [dict copy];
+}
+
+- (NSString *)description
+{
+    return [NSString stringWithFormat:@"OSSPartInfo<%p>:{partNum: %d,eTag: %@,partSize: %lld,crc64: %llu}",self,self.partNum,self.eTag,self.size,self.crc64];
+}
+
+#pragma marks - Protocol Methods
+- (id)copyWithZone:(nullable NSZone *)zone
+{
+    OSSPartInfo *instance = [[[self class] allocWithZone:zone] init];
+    instance.partNum = self.partNum;
+    instance.eTag = self.eTag;
+    instance.size = self.size;
+    instance.crc64 = self.crc64;
+    return instance;
+}
+
+@end
+
+@implementation OSSCompleteMultipartUploadRequest
+@end
+
+@implementation OSSCompleteMultipartUploadResult
+@end
+
+@implementation OSSAbortMultipartUploadRequest
+@end
+
+@implementation OSSAbortMultipartUploadResult
+@end
+
+@implementation OSSListPartsRequest
+@end
+
+@implementation OSSListPartsResult
+@end
+
+@implementation OSSMultipartUploadRequest
+
+- (instancetype)init {
+    if (self = [super init]) {
+        self.partSize = 256 * 1024;
+    }
+    return self;
+}
+
+- (void)cancel {
+    [super cancel];
+}
+
+@end
+
+@implementation OSSResumableUploadRequest
+
+- (instancetype)init {
+    if (self = [super init]) {
+        self.deleteUploadIdOnCancelling = YES;
+        self.partSize = 256 * 1024;
+    }
+    return self;
+}
+
+- (void)cancel {
+    [super cancel];
+    if(_runningChildrenRequest){
+        [_runningChildrenRequest cancel];
+    }
+}
+
+@end
+
+@implementation OSSResumableUploadResult
+@end
+
+@implementation OSSCallBackRequest
+@end
+
+@implementation OSSCallBackResult
+@end
+
+@implementation OSSImagePersistRequest
+@end
+
+@implementation OSSImagePersistResult
+@end

+ 45 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSNetworking.h

@@ -0,0 +1,45 @@
+//
+//  OSSNetworking.h
+//  oss_ios_sdk
+//
+//  Created by zhouzhuo on 8/16/15.
+//  Copyright (c) 2015 aliyun.com. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "OSSModel.h"
+
+@class OSSSyncMutableDictionary;
+@class OSSNetworkingRequestDelegate;
+@class OSSExecutor;
+
+
+
+/**
+ Network parameters
+ */
+@interface OSSNetworkingConfiguration : NSObject
+@property (nonatomic, assign) uint32_t maxRetryCount;
+@property (nonatomic, assign) uint32_t maxConcurrentRequestCount;
+@property (nonatomic, assign) BOOL enableBackgroundTransmitService;
+@property (nonatomic, strong) NSString * backgroundSessionIdentifier;
+@property (nonatomic, assign) NSTimeInterval timeoutIntervalForRequest;
+@property (nonatomic, assign) NSTimeInterval timeoutIntervalForResource;
+@property (nonatomic, strong) NSString * proxyHost;
+@property (nonatomic, strong) NSNumber * proxyPort;
+@end
+
+
+/**
+ The network interface which OSSClient uses for network read and write operations.
+ */
+@interface OSSNetworking : NSObject <NSURLSessionDelegate, NSURLSessionDataDelegate>
+@property (nonatomic, strong) NSURLSession * session;
+@property (nonatomic, assign) BOOL isUsingBackgroundSession;
+@property (nonatomic, strong) OSSSyncMutableDictionary * sessionDelagateManager;
+@property (nonatomic, strong) OSSNetworkingConfiguration * configuration;
+@property (nonatomic, strong) OSSExecutor * taskExecutor;
+
+- (instancetype)initWithConfiguration:(OSSNetworkingConfiguration *)configuration;
+- (OSSTask *)sendRequest:(OSSNetworkingRequestDelegate *)request;
+@end

+ 0 - 0
Pods/AliyunOSSiOS/AliyunOSSSDK/OSSNetworking.m


Some files were not shown because too many files changed in this diff