Commit 819e22a4474b4ff3cde001d1f3fa4b830c9abad7

Authored by 颜玄
1 parent 203fb214

除去接口的基本功能完成

Showing 44 changed files with 2327 additions and 1841 deletions
LiveVideoCloud/LiveVideoCloud.xcodeproj/project.pbxproj
@@ -7,6 +7,66 @@ @@ -7,6 +7,66 @@
7 objects = { 7 objects = {
8 8
9 /* Begin PBXBuildFile section */ 9 /* Begin PBXBuildFile section */
  10 + 4B45CE761EB86A590079AFB7 /* BeingAnchorController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE451EB86A590079AFB7 /* BeingAnchorController.m */; };
  11 + 4B45CE771EB86A590079AFB7 /* IDViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE471EB86A590079AFB7 /* IDViewController.m */; };
  12 + 4B45CE781EB86A590079AFB7 /* JCMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE491EB86A590079AFB7 /* JCMineViewController.m */; };
  13 + 4B45CE791EB86A590079AFB7 /* MineAboutUsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE4B1EB86A590079AFB7 /* MineAboutUsController.m */; };
  14 + 4B45CE7A1EB86A590079AFB7 /* MineLiveController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE4D1EB86A590079AFB7 /* MineLiveController.m */; };
  15 + 4B45CE7B1EB86A590079AFB7 /* MinePersonalDataController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE4F1EB86A590079AFB7 /* MinePersonalDataController.m */; };
  16 + 4B45CE7C1EB86A590079AFB7 /* MineSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE511EB86A590079AFB7 /* MineSettingViewController.m */; };
  17 + 4B45CE7D1EB86A590079AFB7 /* ModifyInfomationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE531EB86A590079AFB7 /* ModifyInfomationController.m */; };
  18 + 4B45CE7E1EB86A590079AFB7 /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE581EB86A590079AFB7 /* LoginViewController.m */; };
  19 + 4B45CE7F1EB86A590079AFB7 /* RegisterCommonController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE5A1EB86A590079AFB7 /* RegisterCommonController.m */; };
  20 + 4B45CE801EB86A590079AFB7 /* idAndPwdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE5D1EB86A590079AFB7 /* idAndPwdView.m */; };
  21 + 4B45CE811EB86A590079AFB7 /* RegistBasicInformationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE5F1EB86A590079AFB7 /* RegistBasicInformationView.m */; };
  22 + 4B45CE821EB86A590079AFB7 /* ZXMineCommonModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE621EB86A590079AFB7 /* ZXMineCommonModel.m */; };
  23 + 4B45CE831EB86A590079AFB7 /* ZXMineModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE641EB86A590079AFB7 /* ZXMineModel.m */; };
  24 + 4B45CE841EB86A590079AFB7 /* ModifyCommonView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE671EB86A590079AFB7 /* ModifyCommonView.m */; };
  25 + 4B45CE851EB86A590079AFB7 /* ZXClearCachesCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE691EB86A590079AFB7 /* ZXClearCachesCell.m */; };
  26 + 4B45CE861EB86A590079AFB7 /* ZXLoginShowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6B1EB86A590079AFB7 /* ZXLoginShowView.m */; };
  27 + 4B45CE871EB86A590079AFB7 /* ZXMineCommonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6D1EB86A590079AFB7 /* ZXMineCommonCell.m */; };
  28 + 4B45CE881EB86A590079AFB7 /* ZXMineShowCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE6F1EB86A590079AFB7 /* ZXMineShowCell.m */; };
  29 + 4B45CE891EB86A590079AFB7 /* ZXPersonalImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE711EB86A590079AFB7 /* ZXPersonalImageCell.m */; };
  30 + 4B45CE8A1EB86A590079AFB7 /* ZXPersonCommonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE731EB86A590079AFB7 /* ZXPersonCommonCell.m */; };
  31 + 4B45CE8B1EB86A590079AFB7 /* ZXTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE751EB86A590079AFB7 /* ZXTextField.m */; };
  32 + 4B45CE971EB86A760079AFB7 /* UIButton+createButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE8E1EB86A760079AFB7 /* UIButton+createButton.m */; };
  33 + 4B45CE981EB86A760079AFB7 /* UILabel+createLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE901EB86A760079AFB7 /* UILabel+createLabel.m */; };
  34 + 4B45CE991EB86A760079AFB7 /* UITextField+createTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE921EB86A760079AFB7 /* UITextField+createTextField.m */; };
  35 + 4B45CE9A1EB86A760079AFB7 /* ZXLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE941EB86A760079AFB7 /* ZXLabel.m */; };
  36 + 4B45CE9B1EB86A760079AFB7 /* ZXUIKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE961EB86A760079AFB7 /* ZXUIKit.m */; };
  37 + 4B45CEA51EB86B9F0079AFB7 /* CNLiveThirdLoginManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CE9E1EB86B9E0079AFB7 /* CNLiveThirdLoginManager.m */; };
  38 + 4B45CEA61EB86B9F0079AFB7 /* NSNumber+ScaleHeight.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CEA01EB86B9E0079AFB7 /* NSNumber+ScaleHeight.m */; };
  39 + 4B45CEA71EB86B9F0079AFB7 /* NSObject+UserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CEA21EB86B9F0079AFB7 /* NSObject+UserModel.m */; };
  40 + 4B45CEA81EB86B9F0079AFB7 /* UserTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CEA41EB86B9F0079AFB7 /* UserTools.m */; };
  41 + 4B45CEAB1EB86BFA0079AFB7 /* NSString+ZXExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CEAA1EB86BFA0079AFB7 /* NSString+ZXExtension.m */; };
  42 + 4B45CEAE1EB873630079AFB7 /* UserInformationModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45CEAD1EB873630079AFB7 /* UserInformationModel.m */; };
  43 + 4BD855CD1EBAC4B70082061D /* CNLiveKeychainWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855CC1EBAC4B70082061D /* CNLiveKeychainWrapper.m */; };
  44 + 4BD855D11EBAC7220082061D /* DESUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855D01EBAC7220082061D /* DESUtility.m */; };
  45 + 4BD855D31EBAC8B20082061D /* CNLiveUserSystemSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD855D21EBAC8B20082061D /* CNLiveUserSystemSDK.framework */; };
  46 + 4BD855FA1EBACD530082061D /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855D61EBACD530082061D /* AFHTTPRequestOperation.m */; };
  47 + 4BD855FB1EBACD530082061D /* AFHTTPRequestOperationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855D81EBACD530082061D /* AFHTTPRequestOperationManager.m */; };
  48 + 4BD855FC1EBACD530082061D /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855DA1EBACD530082061D /* AFHTTPSessionManager.m */; };
  49 + 4BD855FD1EBACD530082061D /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855DD1EBACD530082061D /* AFNetworkReachabilityManager.m */; };
  50 + 4BD855FE1EBACD530082061D /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855DF1EBACD530082061D /* AFSecurityPolicy.m */; };
  51 + 4BD855FF1EBACD530082061D /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855E11EBACD530082061D /* AFURLConnectionOperation.m */; };
  52 + 4BD856001EBACD530082061D /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855E31EBACD530082061D /* AFURLRequestSerialization.m */; };
  53 + 4BD856011EBACD530082061D /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855E51EBACD530082061D /* AFURLResponseSerialization.m */; };
  54 + 4BD856021EBACD530082061D /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855E71EBACD530082061D /* AFURLSessionManager.m */; };
  55 + 4BD856031EBACD530082061D /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855EA1EBACD530082061D /* AFNetworkActivityIndicatorManager.m */; };
  56 + 4BD856041EBACD530082061D /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855EC1EBACD530082061D /* UIActivityIndicatorView+AFNetworking.m */; };
  57 + 4BD856051EBACD530082061D /* UIAlertView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855EE1EBACD530082061D /* UIAlertView+AFNetworking.m */; };
  58 + 4BD856061EBACD530082061D /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855F01EBACD530082061D /* UIButton+AFNetworking.m */; };
  59 + 4BD856071EBACD530082061D /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855F21EBACD530082061D /* UIImageView+AFNetworking.m */; };
  60 + 4BD856081EBACD530082061D /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855F51EBACD530082061D /* UIProgressView+AFNetworking.m */; };
  61 + 4BD856091EBACD530082061D /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855F71EBACD530082061D /* UIRefreshControl+AFNetworking.m */; };
  62 + 4BD8560A1EBACD530082061D /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD855F91EBACD530082061D /* UIWebView+AFNetworking.m */; };
  63 + 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD8560C1EBACEF80082061D /* CNLiveWebView.m */; };
  64 + 4BD856121EBAD2640082061D /* ProgramModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856111EBAD2640082061D /* ProgramModel.m */; };
  65 + 4BD856151EBAD31A0082061D /* NSString+UrlEncode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856141EBAD31A0082061D /* NSString+UrlEncode.m */; };
  66 + 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD856171EBAD35C0082061D /* NSDictionary+Safety.m */; };
  67 + 4BD856191EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD855D21EBAC8B20082061D /* CNLiveUserSystemSDK.framework */; };
  68 + 4BD8561A1EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4BD855D21EBAC8B20082061D /* CNLiveUserSystemSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
  69 + 4BD8561D1EBAD6490082061D /* ZXConst.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD8561C1EBAD6490082061D /* ZXConst.m */; };
10 810B64E01E779AE900133E15 /* LVCPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64DF1E779AE900133E15 /* LVCPlayer.m */; }; 70 810B64E01E779AE900133E15 /* LVCPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64DF1E779AE900133E15 /* LVCPlayer.m */; };
11 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64E21E779AFE00133E15 /* LVCLivePlayerController.m */; }; 71 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64E21E779AFE00133E15 /* LVCLivePlayerController.m */; };
12 810B64FE1E779B1F00133E15 /* MASCompositeConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64E61E779B1F00133E15 /* MASCompositeConstraint.m */; }; 72 810B64FE1E779B1F00133E15 /* MASCompositeConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 810B64E61E779B1F00133E15 /* MASCompositeConstraint.m */; };
@@ -60,21 +120,6 @@ @@ -60,21 +120,6 @@
60 D2029BCE1E6EADD70027CD92 /* ZXNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BC71E6EADD70027CD92 /* ZXNavigationController.m */; }; 120 D2029BCE1E6EADD70027CD92 /* ZXNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BC71E6EADD70027CD92 /* ZXNavigationController.m */; };
61 D2029BCF1E6EADD70027CD92 /* ZXTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BC91E6EADD70027CD92 /* ZXTabBarController.m */; }; 121 D2029BCF1E6EADD70027CD92 /* ZXTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BC91E6EADD70027CD92 /* ZXTabBarController.m */; };
62 D2029C861E6EADE10027CD92 /* Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BD31E6EADE10027CD92 /* Tools.m */; }; 122 D2029C861E6EADE10027CD92 /* Tools.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BD31E6EADE10027CD92 /* Tools.m */; };
63 - D2029C871E6EADE10027CD92 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BD71E6EADE10027CD92 /* AFHTTPSessionManager.m */; };  
64 - D2029C881E6EADE10027CD92 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BDA1E6EADE10027CD92 /* AFNetworkReachabilityManager.m */; };  
65 - D2029C891E6EADE10027CD92 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BDC1E6EADE10027CD92 /* AFSecurityPolicy.m */; };  
66 - D2029C8A1E6EADE10027CD92 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BDE1E6EADE10027CD92 /* AFURLRequestSerialization.m */; };  
67 - D2029C8B1E6EADE10027CD92 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BE01E6EADE10027CD92 /* AFURLResponseSerialization.m */; };  
68 - D2029C8C1E6EADE10027CD92 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BE21E6EADE10027CD92 /* AFURLSessionManager.m */; };  
69 - D2029C8D1E6EADE10027CD92 /* AFAutoPurgingImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BE51E6EADE10027CD92 /* AFAutoPurgingImageCache.m */; };  
70 - D2029C8E1E6EADE10027CD92 /* AFImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BE71E6EADE10027CD92 /* AFImageDownloader.m */; };  
71 - D2029C8F1E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BE91E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.m */; };  
72 - D2029C901E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BEB1E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.m */; };  
73 - D2029C911E6EADE10027CD92 /* UIButton+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BED1E6EADE10027CD92 /* UIButton+AFNetworking.m */; };  
74 - D2029C921E6EADE10027CD92 /* UIImageView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BF01E6EADE10027CD92 /* UIImageView+AFNetworking.m */; };  
75 - D2029C931E6EADE10027CD92 /* UIProgressView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BF31E6EADE10027CD92 /* UIProgressView+AFNetworking.m */; };  
76 - D2029C941E6EADE10027CD92 /* UIRefreshControl+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BF51E6EADE10027CD92 /* UIRefreshControl+AFNetworking.m */; };  
77 - D2029C951E6EADE10027CD92 /* UIWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BF71E6EADE10027CD92 /* UIWebView+AFNetworking.m */; };  
78 D2029C961E6EADE10027CD92 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BFA1E6EADE10027CD92 /* MBProgressHUD.m */; }; 123 D2029C961E6EADE10027CD92 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BFA1E6EADE10027CD92 /* MBProgressHUD.m */; };
79 D2029C971E6EADE10027CD92 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = D2029BFC1E6EADE10027CD92 /* Info.plist */; }; 124 D2029C971E6EADE10027CD92 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = D2029BFC1E6EADE10027CD92 /* Info.plist */; };
80 D2029C981E6EADE10027CD92 /* MJExtensionConst.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BFF1E6EADE10027CD92 /* MJExtensionConst.m */; }; 125 D2029C981E6EADE10027CD92 /* MJExtensionConst.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029BFF1E6EADE10027CD92 /* MJExtensionConst.m */; };
@@ -141,7 +186,6 @@ @@ -141,7 +186,6 @@
141 D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CE71E6EAE2E0027CD92 /* UILabel+ContentSize.m */; }; 186 D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CE71E6EAE2E0027CD92 /* UILabel+ContentSize.m */; };
142 D2029D051E6EAE2E0027CD92 /* UILabel+labelFitSize.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CE91E6EAE2E0027CD92 /* UILabel+labelFitSize.m */; }; 187 D2029D051E6EAE2E0027CD92 /* UILabel+labelFitSize.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CE91E6EAE2E0027CD92 /* UILabel+labelFitSize.m */; };
143 D2029D061E6EAE2E0027CD92 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CEB1E6EAE2E0027CD92 /* UIView+Extension.m */; }; 188 D2029D061E6EAE2E0027CD92 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CEB1E6EAE2E0027CD92 /* UIView+Extension.m */; };
144 - D2029D071E6EAE2E0027CD92 /* ZXConst.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CEE1E6EAE2E0027CD92 /* ZXConst.m */; };  
145 D2029D081E6EAE2E0027CD92 /* ZXDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CF11E6EAE2E0027CD92 /* ZXDeviceInfo.m */; }; 189 D2029D081E6EAE2E0027CD92 /* ZXDeviceInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CF11E6EAE2E0027CD92 /* ZXDeviceInfo.m */; };
146 D2029D091E6EAE2E0027CD92 /* Foundation+Log.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */; }; 190 D2029D091E6EAE2E0027CD92 /* Foundation+Log.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */; };
147 D2029D0A1E6EAE2E0027CD92 /* ZXServerUrl.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CFE1E6EAE2E0027CD92 /* ZXServerUrl.m */; }; 191 D2029D0A1E6EAE2E0027CD92 /* ZXServerUrl.m in Sources */ = {isa = PBXBuildFile; fileRef = D2029CFE1E6EAE2E0027CD92 /* ZXServerUrl.m */; };
@@ -190,7 +234,6 @@ @@ -190,7 +234,6 @@
190 D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D9B1E6EBF1B003A77C8 /* LVCLiveViewController.m */; }; 234 D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888D9B1E6EBF1B003A77C8 /* LVCLiveViewController.m */; };
191 D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; }; 235 D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; };
192 D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB31E6EC154003A77C8 /* HomeViewController.m */; }; 236 D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB31E6EC154003A77C8 /* HomeViewController.m */; };
193 - D2888DB71E6EC1B8003A77C8 /* LVCMyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB61E6EC1B8003A77C8 /* LVCMyViewController.m */; };  
194 D28F5FFF1E8BC7EF00914142 /* LVCUGCLiveListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */; }; 237 D28F5FFF1E8BC7EF00914142 /* LVCUGCLiveListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */; };
195 D2994BA61E8F48DE00E8D2CC /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */; }; 238 D2994BA61E8F48DE00E8D2CC /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */; };
196 D2994BA71E8F48DE00E8D2CC /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA51E8F48DE00E8D2CC /* CNLiveMsgTools.framework */; }; 239 D2994BA71E8F48DE00E8D2CC /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2994BA51E8F48DE00E8D2CC /* CNLiveMsgTools.framework */; };
@@ -236,6 +279,7 @@ @@ -236,6 +279,7 @@
236 dstPath = ""; 279 dstPath = "";
237 dstSubfolderSpec = 10; 280 dstSubfolderSpec = 10;
238 files = ( 281 files = (
  282 + 4BD8561A1EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Embed Frameworks */,
239 811BB6851E8106AF005C6291 /* CNLivePlayerSDK.framework in Embed Frameworks */, 283 811BB6851E8106AF005C6291 /* CNLivePlayerSDK.framework in Embed Frameworks */,
240 D2994BA91E8F490400E8D2CC /* CNLiveChatManager.framework in Embed Frameworks */, 284 D2994BA91E8F490400E8D2CC /* CNLiveChatManager.framework in Embed Frameworks */,
241 D2994BAB1E8F490700E8D2CC /* CNLiveMsgTools.framework in Embed Frameworks */, 285 D2994BAB1E8F490700E8D2CC /* CNLiveMsgTools.framework in Embed Frameworks */,
@@ -246,6 +290,125 @@ @@ -246,6 +290,125 @@
246 /* End PBXCopyFilesBuildPhase section */ 290 /* End PBXCopyFilesBuildPhase section */
247 291
248 /* Begin PBXFileReference section */ 292 /* Begin PBXFileReference section */
  293 + 4B45CE441EB86A590079AFB7 /* BeingAnchorController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeingAnchorController.h; sourceTree = "<group>"; };
  294 + 4B45CE451EB86A590079AFB7 /* BeingAnchorController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BeingAnchorController.m; sourceTree = "<group>"; };
  295 + 4B45CE461EB86A590079AFB7 /* IDViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDViewController.h; sourceTree = "<group>"; };
  296 + 4B45CE471EB86A590079AFB7 /* IDViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IDViewController.m; sourceTree = "<group>"; };
  297 + 4B45CE481EB86A590079AFB7 /* JCMineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JCMineViewController.h; sourceTree = "<group>"; };
  298 + 4B45CE491EB86A590079AFB7 /* JCMineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JCMineViewController.m; sourceTree = "<group>"; };
  299 + 4B45CE4A1EB86A590079AFB7 /* MineAboutUsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineAboutUsController.h; sourceTree = "<group>"; };
  300 + 4B45CE4B1EB86A590079AFB7 /* MineAboutUsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineAboutUsController.m; sourceTree = "<group>"; };
  301 + 4B45CE4C1EB86A590079AFB7 /* MineLiveController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineLiveController.h; sourceTree = "<group>"; };
  302 + 4B45CE4D1EB86A590079AFB7 /* MineLiveController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineLiveController.m; sourceTree = "<group>"; };
  303 + 4B45CE4E1EB86A590079AFB7 /* MinePersonalDataController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MinePersonalDataController.h; sourceTree = "<group>"; };
  304 + 4B45CE4F1EB86A590079AFB7 /* MinePersonalDataController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MinePersonalDataController.m; sourceTree = "<group>"; };
  305 + 4B45CE501EB86A590079AFB7 /* MineSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineSettingViewController.h; sourceTree = "<group>"; };
  306 + 4B45CE511EB86A590079AFB7 /* MineSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineSettingViewController.m; sourceTree = "<group>"; };
  307 + 4B45CE521EB86A590079AFB7 /* ModifyInfomationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifyInfomationController.h; sourceTree = "<group>"; };
  308 + 4B45CE531EB86A590079AFB7 /* ModifyInfomationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModifyInfomationController.m; sourceTree = "<group>"; };
  309 + 4B45CE571EB86A590079AFB7 /* LoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginViewController.h; sourceTree = "<group>"; };
  310 + 4B45CE581EB86A590079AFB7 /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
  311 + 4B45CE591EB86A590079AFB7 /* RegisterCommonController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterCommonController.h; sourceTree = "<group>"; };
  312 + 4B45CE5A1EB86A590079AFB7 /* RegisterCommonController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegisterCommonController.m; sourceTree = "<group>"; };
  313 + 4B45CE5C1EB86A590079AFB7 /* idAndPwdView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = idAndPwdView.h; sourceTree = "<group>"; };
  314 + 4B45CE5D1EB86A590079AFB7 /* idAndPwdView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = idAndPwdView.m; sourceTree = "<group>"; };
  315 + 4B45CE5E1EB86A590079AFB7 /* RegistBasicInformationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegistBasicInformationView.h; sourceTree = "<group>"; };
  316 + 4B45CE5F1EB86A590079AFB7 /* RegistBasicInformationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegistBasicInformationView.m; sourceTree = "<group>"; };
  317 + 4B45CE611EB86A590079AFB7 /* ZXMineCommonModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXMineCommonModel.h; sourceTree = "<group>"; };
  318 + 4B45CE621EB86A590079AFB7 /* ZXMineCommonModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXMineCommonModel.m; sourceTree = "<group>"; };
  319 + 4B45CE631EB86A590079AFB7 /* ZXMineModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXMineModel.h; sourceTree = "<group>"; };
  320 + 4B45CE641EB86A590079AFB7 /* ZXMineModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXMineModel.m; sourceTree = "<group>"; };
  321 + 4B45CE661EB86A590079AFB7 /* ModifyCommonView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifyCommonView.h; sourceTree = "<group>"; };
  322 + 4B45CE671EB86A590079AFB7 /* ModifyCommonView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ModifyCommonView.m; sourceTree = "<group>"; };
  323 + 4B45CE681EB86A590079AFB7 /* ZXClearCachesCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXClearCachesCell.h; sourceTree = "<group>"; };
  324 + 4B45CE691EB86A590079AFB7 /* ZXClearCachesCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXClearCachesCell.m; sourceTree = "<group>"; };
  325 + 4B45CE6A1EB86A590079AFB7 /* ZXLoginShowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXLoginShowView.h; sourceTree = "<group>"; };
  326 + 4B45CE6B1EB86A590079AFB7 /* ZXLoginShowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXLoginShowView.m; sourceTree = "<group>"; };
  327 + 4B45CE6C1EB86A590079AFB7 /* ZXMineCommonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXMineCommonCell.h; sourceTree = "<group>"; };
  328 + 4B45CE6D1EB86A590079AFB7 /* ZXMineCommonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXMineCommonCell.m; sourceTree = "<group>"; };
  329 + 4B45CE6E1EB86A590079AFB7 /* ZXMineShowCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXMineShowCell.h; sourceTree = "<group>"; };
  330 + 4B45CE6F1EB86A590079AFB7 /* ZXMineShowCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXMineShowCell.m; sourceTree = "<group>"; };
  331 + 4B45CE701EB86A590079AFB7 /* ZXPersonalImageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXPersonalImageCell.h; sourceTree = "<group>"; };
  332 + 4B45CE711EB86A590079AFB7 /* ZXPersonalImageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXPersonalImageCell.m; sourceTree = "<group>"; };
  333 + 4B45CE721EB86A590079AFB7 /* ZXPersonCommonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXPersonCommonCell.h; sourceTree = "<group>"; };
  334 + 4B45CE731EB86A590079AFB7 /* ZXPersonCommonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXPersonCommonCell.m; sourceTree = "<group>"; };
  335 + 4B45CE741EB86A590079AFB7 /* ZXTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXTextField.h; sourceTree = "<group>"; };
  336 + 4B45CE751EB86A590079AFB7 /* ZXTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXTextField.m; sourceTree = "<group>"; };
  337 + 4B45CE8D1EB86A760079AFB7 /* UIButton+createButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+createButton.h"; sourceTree = "<group>"; };
  338 + 4B45CE8E1EB86A760079AFB7 /* UIButton+createButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+createButton.m"; sourceTree = "<group>"; };
  339 + 4B45CE8F1EB86A760079AFB7 /* UILabel+createLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+createLabel.h"; sourceTree = "<group>"; };
  340 + 4B45CE901EB86A760079AFB7 /* UILabel+createLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+createLabel.m"; sourceTree = "<group>"; };
  341 + 4B45CE911EB86A760079AFB7 /* UITextField+createTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITextField+createTextField.h"; sourceTree = "<group>"; };
  342 + 4B45CE921EB86A760079AFB7 /* UITextField+createTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITextField+createTextField.m"; sourceTree = "<group>"; };
  343 + 4B45CE931EB86A760079AFB7 /* ZXLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXLabel.h; sourceTree = "<group>"; };
  344 + 4B45CE941EB86A760079AFB7 /* ZXLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXLabel.m; sourceTree = "<group>"; };
  345 + 4B45CE951EB86A760079AFB7 /* ZXUIKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXUIKit.h; sourceTree = "<group>"; };
  346 + 4B45CE961EB86A760079AFB7 /* ZXUIKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXUIKit.m; sourceTree = "<group>"; };
  347 + 4B45CE9D1EB86B9E0079AFB7 /* CNLiveThirdLoginManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveThirdLoginManager.h; sourceTree = "<group>"; };
  348 + 4B45CE9E1EB86B9E0079AFB7 /* CNLiveThirdLoginManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveThirdLoginManager.m; sourceTree = "<group>"; };
  349 + 4B45CE9F1EB86B9E0079AFB7 /* NSNumber+ScaleHeight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNumber+ScaleHeight.h"; sourceTree = "<group>"; };
  350 + 4B45CEA01EB86B9E0079AFB7 /* NSNumber+ScaleHeight.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNumber+ScaleHeight.m"; sourceTree = "<group>"; };
  351 + 4B45CEA11EB86B9E0079AFB7 /* NSObject+UserModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+UserModel.h"; sourceTree = "<group>"; };
  352 + 4B45CEA21EB86B9F0079AFB7 /* NSObject+UserModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+UserModel.m"; sourceTree = "<group>"; };
  353 + 4B45CEA31EB86B9F0079AFB7 /* UserTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTools.h; sourceTree = "<group>"; };
  354 + 4B45CEA41EB86B9F0079AFB7 /* UserTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserTools.m; sourceTree = "<group>"; };
  355 + 4B45CEA91EB86BFA0079AFB7 /* NSString+ZXExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ZXExtension.h"; sourceTree = "<group>"; };
  356 + 4B45CEAA1EB86BFA0079AFB7 /* NSString+ZXExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ZXExtension.m"; sourceTree = "<group>"; };
  357 + 4B45CEAC1EB873630079AFB7 /* UserInformationModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInformationModel.h; sourceTree = "<group>"; };
  358 + 4B45CEAD1EB873630079AFB7 /* UserInformationModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserInformationModel.m; sourceTree = "<group>"; };
  359 + 4BD855CB1EBAC4B70082061D /* CNLiveKeychainWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveKeychainWrapper.h; sourceTree = "<group>"; };
  360 + 4BD855CC1EBAC4B70082061D /* CNLiveKeychainWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveKeychainWrapper.m; sourceTree = "<group>"; };
  361 + 4BD855CE1EBAC57A0082061D /* Common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Common.h; sourceTree = "<group>"; };
  362 + 4BD855CF1EBAC7220082061D /* DESUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DESUtility.h; sourceTree = "<group>"; };
  363 + 4BD855D01EBAC7220082061D /* DESUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DESUtility.m; sourceTree = "<group>"; };
  364 + 4BD855D21EBAC8B20082061D /* CNLiveUserSystemSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveUserSystemSDK.framework; sourceTree = "<group>"; };
  365 + 4BD855D51EBACD530082061D /* AFHTTPRequestOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperation.h; sourceTree = "<group>"; };
  366 + 4BD855D61EBACD530082061D /* AFHTTPRequestOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPRequestOperation.m; sourceTree = "<group>"; };
  367 + 4BD855D71EBACD530082061D /* AFHTTPRequestOperationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPRequestOperationManager.h; sourceTree = "<group>"; };
  368 + 4BD855D81EBACD530082061D /* AFHTTPRequestOperationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPRequestOperationManager.m; sourceTree = "<group>"; };
  369 + 4BD855D91EBACD530082061D /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPSessionManager.h; sourceTree = "<group>"; };
  370 + 4BD855DA1EBACD530082061D /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPSessionManager.m; sourceTree = "<group>"; };
  371 + 4BD855DB1EBACD530082061D /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworking.h; sourceTree = "<group>"; };
  372 + 4BD855DC1EBACD530082061D /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkReachabilityManager.h; sourceTree = "<group>"; };
  373 + 4BD855DD1EBACD530082061D /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkReachabilityManager.m; sourceTree = "<group>"; };
  374 + 4BD855DE1EBACD530082061D /* AFSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFSecurityPolicy.h; sourceTree = "<group>"; };
  375 + 4BD855DF1EBACD530082061D /* AFSecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFSecurityPolicy.m; sourceTree = "<group>"; };
  376 + 4BD855E01EBACD530082061D /* AFURLConnectionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLConnectionOperation.h; sourceTree = "<group>"; };
  377 + 4BD855E11EBACD530082061D /* AFURLConnectionOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLConnectionOperation.m; sourceTree = "<group>"; };
  378 + 4BD855E21EBACD530082061D /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLRequestSerialization.h; sourceTree = "<group>"; };
  379 + 4BD855E31EBACD530082061D /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLRequestSerialization.m; sourceTree = "<group>"; };
  380 + 4BD855E41EBACD530082061D /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLResponseSerialization.h; sourceTree = "<group>"; };
  381 + 4BD855E51EBACD530082061D /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLResponseSerialization.m; sourceTree = "<group>"; };
  382 + 4BD855E61EBACD530082061D /* AFURLSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLSessionManager.h; sourceTree = "<group>"; };
  383 + 4BD855E71EBACD530082061D /* AFURLSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLSessionManager.m; sourceTree = "<group>"; };
  384 + 4BD855E91EBACD530082061D /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkActivityIndicatorManager.h; sourceTree = "<group>"; };
  385 + 4BD855EA1EBACD530082061D /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkActivityIndicatorManager.m; sourceTree = "<group>"; };
  386 + 4BD855EB1EBACD530082061D /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIActivityIndicatorView+AFNetworking.h"; sourceTree = "<group>"; };
  387 + 4BD855EC1EBACD530082061D /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIActivityIndicatorView+AFNetworking.m"; sourceTree = "<group>"; };
  388 + 4BD855ED1EBACD530082061D /* UIAlertView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIAlertView+AFNetworking.h"; sourceTree = "<group>"; };
  389 + 4BD855EE1EBACD530082061D /* UIAlertView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+AFNetworking.m"; sourceTree = "<group>"; };
  390 + 4BD855EF1EBACD530082061D /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+AFNetworking.h"; sourceTree = "<group>"; };
  391 + 4BD855F01EBACD530082061D /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+AFNetworking.m"; sourceTree = "<group>"; };
  392 + 4BD855F11EBACD530082061D /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+AFNetworking.h"; sourceTree = "<group>"; };
  393 + 4BD855F21EBACD530082061D /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+AFNetworking.m"; sourceTree = "<group>"; };
  394 + 4BD855F31EBACD530082061D /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIKit+AFNetworking.h"; sourceTree = "<group>"; };
  395 + 4BD855F41EBACD530082061D /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIProgressView+AFNetworking.h"; sourceTree = "<group>"; };
  396 + 4BD855F51EBACD530082061D /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIProgressView+AFNetworking.m"; sourceTree = "<group>"; };
  397 + 4BD855F61EBACD530082061D /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIRefreshControl+AFNetworking.h"; sourceTree = "<group>"; };
  398 + 4BD855F71EBACD530082061D /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIRefreshControl+AFNetworking.m"; sourceTree = "<group>"; };
  399 + 4BD855F81EBACD530082061D /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWebView+AFNetworking.h"; sourceTree = "<group>"; };
  400 + 4BD855F91EBACD530082061D /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+AFNetworking.m"; sourceTree = "<group>"; };
  401 + 4BD8560B1EBACEF80082061D /* CNLiveWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CNLiveWebView.h; path = ../CNLiveWebView.h; sourceTree = "<group>"; };
  402 + 4BD8560C1EBACEF80082061D /* CNLiveWebView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CNLiveWebView.m; path = ../CNLiveWebView.m; sourceTree = "<group>"; };
  403 + 4BD8560E1EBACEF80082061D /* CNLiveMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNLiveMacro.h; sourceTree = "<group>"; };
  404 + 4BD856101EBAD2640082061D /* ProgramModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgramModel.h; sourceTree = "<group>"; };
  405 + 4BD856111EBAD2640082061D /* ProgramModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProgramModel.m; sourceTree = "<group>"; };
  406 + 4BD856131EBAD31A0082061D /* NSString+UrlEncode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+UrlEncode.h"; sourceTree = "<group>"; };
  407 + 4BD856141EBAD31A0082061D /* NSString+UrlEncode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+UrlEncode.m"; sourceTree = "<group>"; };
  408 + 4BD856161EBAD35C0082061D /* NSDictionary+Safety.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Safety.h"; sourceTree = "<group>"; };
  409 + 4BD856171EBAD35C0082061D /* NSDictionary+Safety.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Safety.m"; sourceTree = "<group>"; };
  410 + 4BD8561B1EBAD6490082061D /* ZXConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZXConst.h; path = Macros/ZXConst.h; sourceTree = "<group>"; };
  411 + 4BD8561C1EBAD6490082061D /* ZXConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ZXConst.m; path = Macros/ZXConst.m; sourceTree = "<group>"; };
249 810B64DE1E779AE900133E15 /* LVCPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPlayer.h; sourceTree = "<group>"; }; 412 810B64DE1E779AE900133E15 /* LVCPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCPlayer.h; sourceTree = "<group>"; };
250 810B64DF1E779AE900133E15 /* LVCPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPlayer.m; sourceTree = "<group>"; }; 413 810B64DF1E779AE900133E15 /* LVCPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCPlayer.m; sourceTree = "<group>"; };
251 810B64E11E779AFE00133E15 /* LVCLivePlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLivePlayerController.h; sourceTree = "<group>"; }; 414 810B64E11E779AFE00133E15 /* LVCLivePlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLivePlayerController.h; sourceTree = "<group>"; };
@@ -356,39 +519,6 @@ @@ -356,39 +519,6 @@
356 D2029BC91E6EADD70027CD92 /* ZXTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXTabBarController.m; sourceTree = "<group>"; }; 519 D2029BC91E6EADD70027CD92 /* ZXTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXTabBarController.m; sourceTree = "<group>"; };
357 D2029BD21E6EADE10027CD92 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tools.h; sourceTree = "<group>"; }; 520 D2029BD21E6EADE10027CD92 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tools.h; sourceTree = "<group>"; };
358 D2029BD31E6EADE10027CD92 /* Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tools.m; sourceTree = "<group>"; }; 521 D2029BD31E6EADE10027CD92 /* Tools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tools.m; sourceTree = "<group>"; };
359 - D2029BD61E6EADE10027CD92 /* AFHTTPSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFHTTPSessionManager.h; sourceTree = "<group>"; };  
360 - D2029BD71E6EADE10027CD92 /* AFHTTPSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFHTTPSessionManager.m; sourceTree = "<group>"; };  
361 - D2029BD81E6EADE10027CD92 /* AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworking.h; sourceTree = "<group>"; };  
362 - D2029BD91E6EADE10027CD92 /* AFNetworkReachabilityManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkReachabilityManager.h; sourceTree = "<group>"; };  
363 - D2029BDA1E6EADE10027CD92 /* AFNetworkReachabilityManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkReachabilityManager.m; sourceTree = "<group>"; };  
364 - D2029BDB1E6EADE10027CD92 /* AFSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFSecurityPolicy.h; sourceTree = "<group>"; };  
365 - D2029BDC1E6EADE10027CD92 /* AFSecurityPolicy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFSecurityPolicy.m; sourceTree = "<group>"; };  
366 - D2029BDD1E6EADE10027CD92 /* AFURLRequestSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLRequestSerialization.h; sourceTree = "<group>"; };  
367 - D2029BDE1E6EADE10027CD92 /* AFURLRequestSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLRequestSerialization.m; sourceTree = "<group>"; };  
368 - D2029BDF1E6EADE10027CD92 /* AFURLResponseSerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLResponseSerialization.h; sourceTree = "<group>"; };  
369 - D2029BE01E6EADE10027CD92 /* AFURLResponseSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLResponseSerialization.m; sourceTree = "<group>"; };  
370 - D2029BE11E6EADE10027CD92 /* AFURLSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFURLSessionManager.h; sourceTree = "<group>"; };  
371 - D2029BE21E6EADE10027CD92 /* AFURLSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFURLSessionManager.m; sourceTree = "<group>"; };  
372 - D2029BE41E6EADE10027CD92 /* AFAutoPurgingImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFAutoPurgingImageCache.h; sourceTree = "<group>"; };  
373 - D2029BE51E6EADE10027CD92 /* AFAutoPurgingImageCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFAutoPurgingImageCache.m; sourceTree = "<group>"; };  
374 - D2029BE61E6EADE10027CD92 /* AFImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFImageDownloader.h; sourceTree = "<group>"; };  
375 - D2029BE71E6EADE10027CD92 /* AFImageDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageDownloader.m; sourceTree = "<group>"; };  
376 - D2029BE81E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AFNetworkActivityIndicatorManager.h; sourceTree = "<group>"; };  
377 - D2029BE91E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFNetworkActivityIndicatorManager.m; sourceTree = "<group>"; };  
378 - D2029BEA1E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIActivityIndicatorView+AFNetworking.h"; sourceTree = "<group>"; };  
379 - D2029BEB1E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIActivityIndicatorView+AFNetworking.m"; sourceTree = "<group>"; };  
380 - D2029BEC1E6EADE10027CD92 /* UIButton+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+AFNetworking.h"; sourceTree = "<group>"; };  
381 - D2029BED1E6EADE10027CD92 /* UIButton+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+AFNetworking.m"; sourceTree = "<group>"; };  
382 - D2029BEE1E6EADE10027CD92 /* UIImage+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+AFNetworking.h"; sourceTree = "<group>"; };  
383 - D2029BEF1E6EADE10027CD92 /* UIImageView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+AFNetworking.h"; sourceTree = "<group>"; };  
384 - D2029BF01E6EADE10027CD92 /* UIImageView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+AFNetworking.m"; sourceTree = "<group>"; };  
385 - D2029BF11E6EADE10027CD92 /* UIKit+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIKit+AFNetworking.h"; sourceTree = "<group>"; };  
386 - D2029BF21E6EADE10027CD92 /* UIProgressView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIProgressView+AFNetworking.h"; sourceTree = "<group>"; };  
387 - D2029BF31E6EADE10027CD92 /* UIProgressView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIProgressView+AFNetworking.m"; sourceTree = "<group>"; };  
388 - D2029BF41E6EADE10027CD92 /* UIRefreshControl+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIRefreshControl+AFNetworking.h"; sourceTree = "<group>"; };  
389 - D2029BF51E6EADE10027CD92 /* UIRefreshControl+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIRefreshControl+AFNetworking.m"; sourceTree = "<group>"; };  
390 - D2029BF61E6EADE10027CD92 /* UIWebView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWebView+AFNetworking.h"; sourceTree = "<group>"; };  
391 - D2029BF71E6EADE10027CD92 /* UIWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+AFNetworking.m"; sourceTree = "<group>"; };  
392 D2029BF91E6EADE10027CD92 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = "<group>"; }; 522 D2029BF91E6EADE10027CD92 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = "<group>"; };
393 D2029BFA1E6EADE10027CD92 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = "<group>"; }; 523 D2029BFA1E6EADE10027CD92 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = "<group>"; };
394 D2029BFC1E6EADE10027CD92 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 524 D2029BFC1E6EADE10027CD92 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@@ -525,8 +655,6 @@ @@ -525,8 +655,6 @@
525 D2029CE91E6EAE2E0027CD92 /* UILabel+labelFitSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+labelFitSize.m"; sourceTree = "<group>"; }; 655 D2029CE91E6EAE2E0027CD92 /* UILabel+labelFitSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+labelFitSize.m"; sourceTree = "<group>"; };
526 D2029CEA1E6EAE2E0027CD92 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; }; 656 D2029CEA1E6EAE2E0027CD92 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
527 D2029CEB1E6EAE2E0027CD92 /* UIView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = "<group>"; }; 657 D2029CEB1E6EAE2E0027CD92 /* UIView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = "<group>"; };
528 - D2029CED1E6EAE2E0027CD92 /* ZXConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXConst.h; sourceTree = "<group>"; };  
529 - D2029CEE1E6EAE2E0027CD92 /* ZXConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXConst.m; sourceTree = "<group>"; };  
530 D2029CF01E6EAE2E0027CD92 /* ZXDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXDeviceInfo.h; sourceTree = "<group>"; }; 658 D2029CF01E6EAE2E0027CD92 /* ZXDeviceInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXDeviceInfo.h; sourceTree = "<group>"; };
531 D2029CF11E6EAE2E0027CD92 /* ZXDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXDeviceInfo.m; sourceTree = "<group>"; }; 659 D2029CF11E6EAE2E0027CD92 /* ZXDeviceInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXDeviceInfo.m; sourceTree = "<group>"; };
532 D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Foundation+Log.m"; sourceTree = "<group>"; }; 660 D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Foundation+Log.m"; sourceTree = "<group>"; };
@@ -626,8 +754,6 @@ @@ -626,8 +754,6 @@
626 D2888DB01E6EC05F003A77C8 /* TempViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TempViewController.m; sourceTree = "<group>"; }; 754 D2888DB01E6EC05F003A77C8 /* TempViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TempViewController.m; sourceTree = "<group>"; };
627 D2888DB21E6EC154003A77C8 /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = "<group>"; }; 755 D2888DB21E6EC154003A77C8 /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = "<group>"; };
628 D2888DB31E6EC154003A77C8 /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; }; 756 D2888DB31E6EC154003A77C8 /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; };
629 - D2888DB51E6EC1B8003A77C8 /* LVCMyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMyViewController.h; sourceTree = "<group>"; };  
630 - D2888DB61E6EC1B8003A77C8 /* LVCMyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMyViewController.m; sourceTree = "<group>"; };  
631 D28F5FFD1E8BC7EF00914142 /* LVCUGCLiveListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCUGCLiveListView.h; path = ../Controller/LVCUGCLiveListView.h; sourceTree = "<group>"; }; 757 D28F5FFD1E8BC7EF00914142 /* LVCUGCLiveListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCUGCLiveListView.h; path = ../Controller/LVCUGCLiveListView.h; sourceTree = "<group>"; };
632 D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCUGCLiveListView.m; path = ../Controller/LVCUGCLiveListView.m; sourceTree = "<group>"; }; 758 D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCUGCLiveListView.m; path = ../Controller/LVCUGCLiveListView.m; sourceTree = "<group>"; };
633 D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveChatManager.framework; sourceTree = "<group>"; }; 759 D2994BA41E8F48DE00E8D2CC /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveChatManager.framework; sourceTree = "<group>"; };
@@ -662,10 +788,12 @@ @@ -662,10 +788,12 @@
662 isa = PBXFrameworksBuildPhase; 788 isa = PBXFrameworksBuildPhase;
663 buildActionMask = 2147483647; 789 buildActionMask = 2147483647;
664 files = ( 790 files = (
  791 + 4BD855D31EBAC8B20082061D /* CNLiveUserSystemSDK.framework in Frameworks */,
665 D25BF8A31E80C4FC007FB138 /* Accelerate.framework in Frameworks */, 792 D25BF8A31E80C4FC007FB138 /* Accelerate.framework in Frameworks */,
666 D2994BA71E8F48DE00E8D2CC /* CNLiveMsgTools.framework in Frameworks */, 793 D2994BA71E8F48DE00E8D2CC /* CNLiveMsgTools.framework in Frameworks */,
667 D2575C7D1E76A4F300E3A8FC /* NHGiftAnimtionSDK.a in Frameworks */, 794 D2575C7D1E76A4F300E3A8FC /* NHGiftAnimtionSDK.a in Frameworks */,
668 D2994BAA1E8F490700E8D2CC /* CNLiveMsgTools.framework in Frameworks */, 795 D2994BAA1E8F490700E8D2CC /* CNLiveMsgTools.framework in Frameworks */,
  796 + 4BD856191EBAD4E30082061D /* CNLiveUserSystemSDK.framework in Frameworks */,
669 811BB6831E8106A2005C6291 /* CNLivePlayerSDK.framework in Frameworks */, 797 811BB6831E8106A2005C6291 /* CNLivePlayerSDK.framework in Frameworks */,
670 D2994BA61E8F48DE00E8D2CC /* CNLiveChatManager.framework in Frameworks */, 798 D2994BA61E8F48DE00E8D2CC /* CNLiveChatManager.framework in Frameworks */,
671 D2994BA81E8F490400E8D2CC /* CNLiveChatManager.framework in Frameworks */, 799 D2994BA81E8F490400E8D2CC /* CNLiveChatManager.framework in Frameworks */,
@@ -689,6 +817,208 @@ @@ -689,6 +817,208 @@
689 /* End PBXFrameworksBuildPhase section */ 817 /* End PBXFrameworksBuildPhase section */
690 818
691 /* Begin PBXGroup section */ 819 /* Begin PBXGroup section */
  820 + 4B45CE421EB86A590079AFB7 /* Mine */ = {
  821 + isa = PBXGroup;
  822 + children = (
  823 + 4B45CE431EB86A590079AFB7 /* Controllers */,
  824 + 4B45CE541EB86A590079AFB7 /* IAP */,
  825 + 4B45CE551EB86A590079AFB7 /* Login */,
  826 + 4B45CE601EB86A590079AFB7 /* Model */,
  827 + 4B45CE651EB86A590079AFB7 /* Views */,
  828 + );
  829 + path = Mine;
  830 + sourceTree = "<group>";
  831 + };
  832 + 4B45CE431EB86A590079AFB7 /* Controllers */ = {
  833 + isa = PBXGroup;
  834 + children = (
  835 + 4B45CE441EB86A590079AFB7 /* BeingAnchorController.h */,
  836 + 4B45CE451EB86A590079AFB7 /* BeingAnchorController.m */,
  837 + 4B45CE461EB86A590079AFB7 /* IDViewController.h */,
  838 + 4B45CE471EB86A590079AFB7 /* IDViewController.m */,
  839 + 4B45CE481EB86A590079AFB7 /* JCMineViewController.h */,
  840 + 4B45CE491EB86A590079AFB7 /* JCMineViewController.m */,
  841 + 4B45CE4A1EB86A590079AFB7 /* MineAboutUsController.h */,
  842 + 4B45CE4B1EB86A590079AFB7 /* MineAboutUsController.m */,
  843 + 4B45CE4C1EB86A590079AFB7 /* MineLiveController.h */,
  844 + 4B45CE4D1EB86A590079AFB7 /* MineLiveController.m */,
  845 + 4B45CE4E1EB86A590079AFB7 /* MinePersonalDataController.h */,
  846 + 4B45CE4F1EB86A590079AFB7 /* MinePersonalDataController.m */,
  847 + 4B45CE501EB86A590079AFB7 /* MineSettingViewController.h */,
  848 + 4B45CE511EB86A590079AFB7 /* MineSettingViewController.m */,
  849 + 4B45CE521EB86A590079AFB7 /* ModifyInfomationController.h */,
  850 + 4B45CE531EB86A590079AFB7 /* ModifyInfomationController.m */,
  851 + );
  852 + path = Controllers;
  853 + sourceTree = "<group>";
  854 + };
  855 + 4B45CE541EB86A590079AFB7 /* IAP */ = {
  856 + isa = PBXGroup;
  857 + children = (
  858 + );
  859 + path = IAP;
  860 + sourceTree = "<group>";
  861 + };
  862 + 4B45CE551EB86A590079AFB7 /* Login */ = {
  863 + isa = PBXGroup;
  864 + children = (
  865 + 4B45CE561EB86A590079AFB7 /* Controller */,
  866 + 4B45CE5B1EB86A590079AFB7 /* View */,
  867 + );
  868 + path = Login;
  869 + sourceTree = "<group>";
  870 + };
  871 + 4B45CE561EB86A590079AFB7 /* Controller */ = {
  872 + isa = PBXGroup;
  873 + children = (
  874 + 4B45CE571EB86A590079AFB7 /* LoginViewController.h */,
  875 + 4B45CE581EB86A590079AFB7 /* LoginViewController.m */,
  876 + 4B45CE591EB86A590079AFB7 /* RegisterCommonController.h */,
  877 + 4B45CE5A1EB86A590079AFB7 /* RegisterCommonController.m */,
  878 + );
  879 + path = Controller;
  880 + sourceTree = "<group>";
  881 + };
  882 + 4B45CE5B1EB86A590079AFB7 /* View */ = {
  883 + isa = PBXGroup;
  884 + children = (
  885 + 4B45CE5C1EB86A590079AFB7 /* idAndPwdView.h */,
  886 + 4B45CE5D1EB86A590079AFB7 /* idAndPwdView.m */,
  887 + 4B45CE5E1EB86A590079AFB7 /* RegistBasicInformationView.h */,
  888 + 4B45CE5F1EB86A590079AFB7 /* RegistBasicInformationView.m */,
  889 + );
  890 + path = View;
  891 + sourceTree = "<group>";
  892 + };
  893 + 4B45CE601EB86A590079AFB7 /* Model */ = {
  894 + isa = PBXGroup;
  895 + children = (
  896 + 4BD856101EBAD2640082061D /* ProgramModel.h */,
  897 + 4BD856111EBAD2640082061D /* ProgramModel.m */,
  898 + 4B45CE611EB86A590079AFB7 /* ZXMineCommonModel.h */,
  899 + 4B45CE621EB86A590079AFB7 /* ZXMineCommonModel.m */,
  900 + 4B45CE631EB86A590079AFB7 /* ZXMineModel.h */,
  901 + 4B45CE641EB86A590079AFB7 /* ZXMineModel.m */,
  902 + );
  903 + path = Model;
  904 + sourceTree = "<group>";
  905 + };
  906 + 4B45CE651EB86A590079AFB7 /* Views */ = {
  907 + isa = PBXGroup;
  908 + children = (
  909 + 4B45CE661EB86A590079AFB7 /* ModifyCommonView.h */,
  910 + 4B45CE671EB86A590079AFB7 /* ModifyCommonView.m */,
  911 + 4B45CE681EB86A590079AFB7 /* ZXClearCachesCell.h */,
  912 + 4B45CE691EB86A590079AFB7 /* ZXClearCachesCell.m */,
  913 + 4B45CE6A1EB86A590079AFB7 /* ZXLoginShowView.h */,
  914 + 4B45CE6B1EB86A590079AFB7 /* ZXLoginShowView.m */,
  915 + 4B45CE6C1EB86A590079AFB7 /* ZXMineCommonCell.h */,
  916 + 4B45CE6D1EB86A590079AFB7 /* ZXMineCommonCell.m */,
  917 + 4B45CE6E1EB86A590079AFB7 /* ZXMineShowCell.h */,
  918 + 4B45CE6F1EB86A590079AFB7 /* ZXMineShowCell.m */,
  919 + 4B45CE701EB86A590079AFB7 /* ZXPersonalImageCell.h */,
  920 + 4B45CE711EB86A590079AFB7 /* ZXPersonalImageCell.m */,
  921 + 4B45CE721EB86A590079AFB7 /* ZXPersonCommonCell.h */,
  922 + 4B45CE731EB86A590079AFB7 /* ZXPersonCommonCell.m */,
  923 + 4B45CE741EB86A590079AFB7 /* ZXTextField.h */,
  924 + 4B45CE751EB86A590079AFB7 /* ZXTextField.m */,
  925 + );
  926 + path = Views;
  927 + sourceTree = "<group>";
  928 + };
  929 + 4B45CE8C1EB86A760079AFB7 /* UIKit */ = {
  930 + isa = PBXGroup;
  931 + children = (
  932 + 4B45CE8D1EB86A760079AFB7 /* UIButton+createButton.h */,
  933 + 4B45CE8E1EB86A760079AFB7 /* UIButton+createButton.m */,
  934 + 4B45CE8F1EB86A760079AFB7 /* UILabel+createLabel.h */,
  935 + 4B45CE901EB86A760079AFB7 /* UILabel+createLabel.m */,
  936 + 4B45CE911EB86A760079AFB7 /* UITextField+createTextField.h */,
  937 + 4B45CE921EB86A760079AFB7 /* UITextField+createTextField.m */,
  938 + 4B45CE931EB86A760079AFB7 /* ZXLabel.h */,
  939 + 4B45CE941EB86A760079AFB7 /* ZXLabel.m */,
  940 + 4B45CE951EB86A760079AFB7 /* ZXUIKit.h */,
  941 + 4B45CE961EB86A760079AFB7 /* ZXUIKit.m */,
  942 + );
  943 + path = UIKit;
  944 + sourceTree = "<group>";
  945 + };
  946 + 4B45CE9C1EB86B9E0079AFB7 /* UserTools */ = {
  947 + isa = PBXGroup;
  948 + children = (
  949 + 4B45CE9D1EB86B9E0079AFB7 /* CNLiveThirdLoginManager.h */,
  950 + 4B45CE9E1EB86B9E0079AFB7 /* CNLiveThirdLoginManager.m */,
  951 + 4B45CE9F1EB86B9E0079AFB7 /* NSNumber+ScaleHeight.h */,
  952 + 4B45CEA01EB86B9E0079AFB7 /* NSNumber+ScaleHeight.m */,
  953 + 4B45CEA11EB86B9E0079AFB7 /* NSObject+UserModel.h */,
  954 + 4B45CEA21EB86B9F0079AFB7 /* NSObject+UserModel.m */,
  955 + 4B45CEA31EB86B9F0079AFB7 /* UserTools.h */,
  956 + 4B45CEA41EB86B9F0079AFB7 /* UserTools.m */,
  957 + );
  958 + path = UserTools;
  959 + sourceTree = "<group>";
  960 + };
  961 + 4BD855D41EBACD530082061D /* AFNetworking */ = {
  962 + isa = PBXGroup;
  963 + children = (
  964 + 4BD855D51EBACD530082061D /* AFHTTPRequestOperation.h */,
  965 + 4BD855D61EBACD530082061D /* AFHTTPRequestOperation.m */,
  966 + 4BD855D71EBACD530082061D /* AFHTTPRequestOperationManager.h */,
  967 + 4BD855D81EBACD530082061D /* AFHTTPRequestOperationManager.m */,
  968 + 4BD855D91EBACD530082061D /* AFHTTPSessionManager.h */,
  969 + 4BD855DA1EBACD530082061D /* AFHTTPSessionManager.m */,
  970 + 4BD855DB1EBACD530082061D /* AFNetworking.h */,
  971 + 4BD855DC1EBACD530082061D /* AFNetworkReachabilityManager.h */,
  972 + 4BD855DD1EBACD530082061D /* AFNetworkReachabilityManager.m */,
  973 + 4BD855DE1EBACD530082061D /* AFSecurityPolicy.h */,
  974 + 4BD855DF1EBACD530082061D /* AFSecurityPolicy.m */,
  975 + 4BD855E01EBACD530082061D /* AFURLConnectionOperation.h */,
  976 + 4BD855E11EBACD530082061D /* AFURLConnectionOperation.m */,
  977 + 4BD855E21EBACD530082061D /* AFURLRequestSerialization.h */,
  978 + 4BD855E31EBACD530082061D /* AFURLRequestSerialization.m */,
  979 + 4BD855E41EBACD530082061D /* AFURLResponseSerialization.h */,
  980 + 4BD855E51EBACD530082061D /* AFURLResponseSerialization.m */,
  981 + 4BD855E61EBACD530082061D /* AFURLSessionManager.h */,
  982 + 4BD855E71EBACD530082061D /* AFURLSessionManager.m */,
  983 + 4BD855E81EBACD530082061D /* UIKit+AFNetworking */,
  984 + );
  985 + path = AFNetworking;
  986 + sourceTree = "<group>";
  987 + };
  988 + 4BD855E81EBACD530082061D /* UIKit+AFNetworking */ = {
  989 + isa = PBXGroup;
  990 + children = (
  991 + 4BD855E91EBACD530082061D /* AFNetworkActivityIndicatorManager.h */,
  992 + 4BD855EA1EBACD530082061D /* AFNetworkActivityIndicatorManager.m */,
  993 + 4BD855EB1EBACD530082061D /* UIActivityIndicatorView+AFNetworking.h */,
  994 + 4BD855EC1EBACD530082061D /* UIActivityIndicatorView+AFNetworking.m */,
  995 + 4BD855ED1EBACD530082061D /* UIAlertView+AFNetworking.h */,
  996 + 4BD855EE1EBACD530082061D /* UIAlertView+AFNetworking.m */,
  997 + 4BD855EF1EBACD530082061D /* UIButton+AFNetworking.h */,
  998 + 4BD855F01EBACD530082061D /* UIButton+AFNetworking.m */,
  999 + 4BD855F11EBACD530082061D /* UIImageView+AFNetworking.h */,
  1000 + 4BD855F21EBACD530082061D /* UIImageView+AFNetworking.m */,
  1001 + 4BD855F31EBACD530082061D /* UIKit+AFNetworking.h */,
  1002 + 4BD855F41EBACD530082061D /* UIProgressView+AFNetworking.h */,
  1003 + 4BD855F51EBACD530082061D /* UIProgressView+AFNetworking.m */,
  1004 + 4BD855F61EBACD530082061D /* UIRefreshControl+AFNetworking.h */,
  1005 + 4BD855F71EBACD530082061D /* UIRefreshControl+AFNetworking.m */,
  1006 + 4BD855F81EBACD530082061D /* UIWebView+AFNetworking.h */,
  1007 + 4BD855F91EBACD530082061D /* UIWebView+AFNetworking.m */,
  1008 + );
  1009 + path = "UIKit+AFNetworking";
  1010 + sourceTree = "<group>";
  1011 + };
  1012 + 4BD8560D1EBACEF80082061D /* webView */ = {
  1013 + isa = PBXGroup;
  1014 + children = (
  1015 + 4BD8560B1EBACEF80082061D /* CNLiveWebView.h */,
  1016 + 4BD8560C1EBACEF80082061D /* CNLiveWebView.m */,
  1017 + 4BD8560E1EBACEF80082061D /* CNLiveMacro.h */,
  1018 + );
  1019 + path = webView;
  1020 + sourceTree = "<group>";
  1021 + };
692 810B64E41E779B1F00133E15 /* Masonry */ = { 1022 810B64E41E779B1F00133E15 /* Masonry */ = {
693 isa = PBXGroup; 1023 isa = PBXGroup;
694 children = ( 1024 children = (
@@ -930,11 +1260,11 @@ @@ -930,11 +1260,11 @@
930 D2029BD41E6EADE10027CD92 /* SDK */ = { 1260 D2029BD41E6EADE10027CD92 /* SDK */ = {
931 isa = PBXGroup; 1261 isa = PBXGroup;
932 children = ( 1262 children = (
  1263 + 4BD855D41EBACD530082061D /* AFNetworking */,
933 81F1C8391E8BBDE40085C2B8 /* V8HorizontalPickerView */, 1264 81F1C8391E8BBDE40085C2B8 /* V8HorizontalPickerView */,
934 81F1C8351E8BBDDA0085C2B8 /* MHPagingScrollView */, 1265 81F1C8351E8BBDDA0085C2B8 /* MHPagingScrollView */,
935 81FB5B391E7A6FFC00F98E1D /* SevenSwitch */, 1266 81FB5B391E7A6FFC00F98E1D /* SevenSwitch */,
936 810B64E41E779B1F00133E15 /* Masonry */, 1267 810B64E41E779B1F00133E15 /* Masonry */,
937 - D2029BD51E6EADE10027CD92 /* AFNetworking */,  
938 D2029BF81E6EADE10027CD92 /* MBProgressHUD */, 1268 D2029BF81E6EADE10027CD92 /* MBProgressHUD */,
939 D2029BFB1E6EADE10027CD92 /* MJExtension */, 1269 D2029BFB1E6EADE10027CD92 /* MJExtension */,
940 D2029C121E6EADE10027CD92 /* MJRefresh */, 1270 D2029C121E6EADE10027CD92 /* MJRefresh */,
@@ -946,54 +1276,6 @@ @@ -946,54 +1276,6 @@
946 path = SDK; 1276 path = SDK;
947 sourceTree = "<group>"; 1277 sourceTree = "<group>";
948 }; 1278 };
949 - D2029BD51E6EADE10027CD92 /* AFNetworking */ = {  
950 - isa = PBXGroup;  
951 - children = (  
952 - D2029BD61E6EADE10027CD92 /* AFHTTPSessionManager.h */,  
953 - D2029BD71E6EADE10027CD92 /* AFHTTPSessionManager.m */,  
954 - D2029BD81E6EADE10027CD92 /* AFNetworking.h */,  
955 - D2029BD91E6EADE10027CD92 /* AFNetworkReachabilityManager.h */,  
956 - D2029BDA1E6EADE10027CD92 /* AFNetworkReachabilityManager.m */,  
957 - D2029BDB1E6EADE10027CD92 /* AFSecurityPolicy.h */,  
958 - D2029BDC1E6EADE10027CD92 /* AFSecurityPolicy.m */,  
959 - D2029BDD1E6EADE10027CD92 /* AFURLRequestSerialization.h */,  
960 - D2029BDE1E6EADE10027CD92 /* AFURLRequestSerialization.m */,  
961 - D2029BDF1E6EADE10027CD92 /* AFURLResponseSerialization.h */,  
962 - D2029BE01E6EADE10027CD92 /* AFURLResponseSerialization.m */,  
963 - D2029BE11E6EADE10027CD92 /* AFURLSessionManager.h */,  
964 - D2029BE21E6EADE10027CD92 /* AFURLSessionManager.m */,  
965 - D2029BE31E6EADE10027CD92 /* UIKit+AFNetworking */,  
966 - );  
967 - path = AFNetworking;  
968 - sourceTree = "<group>";  
969 - };  
970 - D2029BE31E6EADE10027CD92 /* UIKit+AFNetworking */ = {  
971 - isa = PBXGroup;  
972 - children = (  
973 - D2029BE41E6EADE10027CD92 /* AFAutoPurgingImageCache.h */,  
974 - D2029BE51E6EADE10027CD92 /* AFAutoPurgingImageCache.m */,  
975 - D2029BE61E6EADE10027CD92 /* AFImageDownloader.h */,  
976 - D2029BE71E6EADE10027CD92 /* AFImageDownloader.m */,  
977 - D2029BE81E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.h */,  
978 - D2029BE91E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.m */,  
979 - D2029BEA1E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.h */,  
980 - D2029BEB1E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.m */,  
981 - D2029BEC1E6EADE10027CD92 /* UIButton+AFNetworking.h */,  
982 - D2029BED1E6EADE10027CD92 /* UIButton+AFNetworking.m */,  
983 - D2029BEE1E6EADE10027CD92 /* UIImage+AFNetworking.h */,  
984 - D2029BEF1E6EADE10027CD92 /* UIImageView+AFNetworking.h */,  
985 - D2029BF01E6EADE10027CD92 /* UIImageView+AFNetworking.m */,  
986 - D2029BF11E6EADE10027CD92 /* UIKit+AFNetworking.h */,  
987 - D2029BF21E6EADE10027CD92 /* UIProgressView+AFNetworking.h */,  
988 - D2029BF31E6EADE10027CD92 /* UIProgressView+AFNetworking.m */,  
989 - D2029BF41E6EADE10027CD92 /* UIRefreshControl+AFNetworking.h */,  
990 - D2029BF51E6EADE10027CD92 /* UIRefreshControl+AFNetworking.m */,  
991 - D2029BF61E6EADE10027CD92 /* UIWebView+AFNetworking.h */,  
992 - D2029BF71E6EADE10027CD92 /* UIWebView+AFNetworking.m */,  
993 - );  
994 - path = "UIKit+AFNetworking";  
995 - sourceTree = "<group>";  
996 - };  
997 D2029BF81E6EADE10027CD92 /* MBProgressHUD */ = { 1279 D2029BF81E6EADE10027CD92 /* MBProgressHUD */ = {
998 isa = PBXGroup; 1280 isa = PBXGroup;
999 children = ( 1281 children = (
@@ -1212,9 +1494,9 @@ @@ -1212,9 +1494,9 @@
1212 D2029C741E6EADE10027CD92 /* Sections */ = { 1494 D2029C741E6EADE10027CD92 /* Sections */ = {
1213 isa = PBXGroup; 1495 isa = PBXGroup;
1214 children = ( 1496 children = (
  1497 + 4B45CE421EB86A590079AFB7 /* Mine */,
1215 D2888DA71E6EC014003A77C8 /* homeSections */, 1498 D2888DA71E6EC014003A77C8 /* homeSections */,
1216 D2888D951E6EBAA7003A77C8 /* LiveSections */, 1499 D2888D951E6EBAA7003A77C8 /* LiveSections */,
1217 - D2888DAB1E6EC014003A77C8 /* mySections */,  
1218 D2575C431E76846900E3A8FC /* InteractionSections */, 1500 D2575C431E76846900E3A8FC /* InteractionSections */,
1219 D2029C751E6EADE10027CD92 /* ZXSections(例子) */, 1501 D2029C751E6EADE10027CD92 /* ZXSections(例子) */,
1220 ); 1502 );
@@ -1293,10 +1575,15 @@ @@ -1293,10 +1575,15 @@
1293 D2029CDC1E6EAE2E0027CD92 /* UtilKits */ = { 1575 D2029CDC1E6EAE2E0027CD92 /* UtilKits */ = {
1294 isa = PBXGroup; 1576 isa = PBXGroup;
1295 children = ( 1577 children = (
  1578 + 4BD8560D1EBACEF80082061D /* webView */,
  1579 + 4BD855CE1EBAC57A0082061D /* Common.h */,
  1580 + 4B45CEAC1EB873630079AFB7 /* UserInformationModel.h */,
  1581 + 4B45CEAD1EB873630079AFB7 /* UserInformationModel.m */,
  1582 + 4B45CE9C1EB86B9E0079AFB7 /* UserTools */,
  1583 + 4B45CE8C1EB86A760079AFB7 /* UIKit */,
1296 D2029CFF1E6EAE2E0027CD92 /* UtilKits.h */, 1584 D2029CFF1E6EAE2E0027CD92 /* UtilKits.h */,
1297 D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */, 1585 D2029CF21E6EAE2E0027CD92 /* Foundation+Log.m */,
1298 D2029CDD1E6EAE2E0027CD92 /* Category */, 1586 D2029CDD1E6EAE2E0027CD92 /* Category */,
1299 - D2029CEC1E6EAE2E0027CD92 /* Const */,  
1300 D2029CEF1E6EAE2E0027CD92 /* DeviceInfo */, 1587 D2029CEF1E6EAE2E0027CD92 /* DeviceInfo */,
1301 D2029CF31E6EAE2E0027CD92 /* Macro */, 1588 D2029CF31E6EAE2E0027CD92 /* Macro */,
1302 D2029CFC1E6EAE2E0027CD92 /* ServerUrl */, 1589 D2029CFC1E6EAE2E0027CD92 /* ServerUrl */,
@@ -1307,6 +1594,16 @@ @@ -1307,6 +1594,16 @@
1307 D2029CDD1E6EAE2E0027CD92 /* Category */ = { 1594 D2029CDD1E6EAE2E0027CD92 /* Category */ = {
1308 isa = PBXGroup; 1595 isa = PBXGroup;
1309 children = ( 1596 children = (
  1597 + 4BD856161EBAD35C0082061D /* NSDictionary+Safety.h */,
  1598 + 4BD856171EBAD35C0082061D /* NSDictionary+Safety.m */,
  1599 + 4BD856131EBAD31A0082061D /* NSString+UrlEncode.h */,
  1600 + 4BD856141EBAD31A0082061D /* NSString+UrlEncode.m */,
  1601 + 4BD855CF1EBAC7220082061D /* DESUtility.h */,
  1602 + 4BD855D01EBAC7220082061D /* DESUtility.m */,
  1603 + 4BD855CB1EBAC4B70082061D /* CNLiveKeychainWrapper.h */,
  1604 + 4BD855CC1EBAC4B70082061D /* CNLiveKeychainWrapper.m */,
  1605 + 4B45CEA91EB86BFA0079AFB7 /* NSString+ZXExtension.h */,
  1606 + 4B45CEAA1EB86BFA0079AFB7 /* NSString+ZXExtension.m */,
1310 81F1C83E1E8BC5CC0085C2B8 /* NSArray+Safety.h */, 1607 81F1C83E1E8BC5CC0085C2B8 /* NSArray+Safety.h */,
1311 81F1C83F1E8BC5CC0085C2B8 /* NSArray+Safety.m */, 1608 81F1C83F1E8BC5CC0085C2B8 /* NSArray+Safety.m */,
1312 81A483061E88B6140097A80A /* UIView+ViewController.h */, 1609 81A483061E88B6140097A80A /* UIView+ViewController.h */,
@@ -1335,15 +1632,6 @@ @@ -1335,15 +1632,6 @@
1335 path = Category; 1632 path = Category;
1336 sourceTree = "<group>"; 1633 sourceTree = "<group>";
1337 }; 1634 };
1338 - D2029CEC1E6EAE2E0027CD92 /* Const */ = {  
1339 - isa = PBXGroup;  
1340 - children = (  
1341 - D2029CED1E6EAE2E0027CD92 /* ZXConst.h */,  
1342 - D2029CEE1E6EAE2E0027CD92 /* ZXConst.m */,  
1343 - );  
1344 - path = Const;  
1345 - sourceTree = "<group>";  
1346 - };  
1347 D2029CEF1E6EAE2E0027CD92 /* DeviceInfo */ = { 1635 D2029CEF1E6EAE2E0027CD92 /* DeviceInfo */ = {
1348 isa = PBXGroup; 1636 isa = PBXGroup;
1349 children = ( 1637 children = (
@@ -1357,6 +1645,8 @@ @@ -1357,6 +1645,8 @@
1357 isa = PBXGroup; 1645 isa = PBXGroup;
1358 children = ( 1646 children = (
1359 D2029CF41E6EAE2E0027CD92 /* Macros */, 1647 D2029CF41E6EAE2E0027CD92 /* Macros */,
  1648 + 4BD8561B1EBAD6490082061D /* ZXConst.h */,
  1649 + 4BD8561C1EBAD6490082061D /* ZXConst.m */,
1360 D2029CFB1E6EAE2E0027CD92 /* Macros.h */, 1650 D2029CFB1E6EAE2E0027CD92 /* Macros.h */,
1361 ); 1651 );
1362 path = Macro; 1652 path = Macro;
@@ -1632,6 +1922,7 @@ @@ -1632,6 +1922,7 @@
1632 D25BF8A11E80C4FC007FB138 /* Frameworks */ = { 1922 D25BF8A11E80C4FC007FB138 /* Frameworks */ = {
1633 isa = PBXGroup; 1923 isa = PBXGroup;
1634 children = ( 1924 children = (
  1925 + 4BD855D21EBAC8B20082061D /* CNLiveUserSystemSDK.framework */,
1635 D25BF8A21E80C4FC007FB138 /* Accelerate.framework */, 1926 D25BF8A21E80C4FC007FB138 /* Accelerate.framework */,
1636 ); 1927 );
1637 name = Frameworks; 1928 name = Frameworks;
@@ -1731,39 +2022,6 @@ @@ -1731,39 +2022,6 @@
1731 path = View; 2022 path = View;
1732 sourceTree = "<group>"; 2023 sourceTree = "<group>";
1733 }; 2024 };
1734 - D2888DAB1E6EC014003A77C8 /* mySections */ = {  
1735 - isa = PBXGroup;  
1736 - children = (  
1737 - D2888DAC1E6EC014003A77C8 /* Controller */,  
1738 - D2888DAD1E6EC014003A77C8 /* Model */,  
1739 - D2888DAE1E6EC014003A77C8 /* View */,  
1740 - );  
1741 - path = mySections;  
1742 - sourceTree = "<group>";  
1743 - };  
1744 - D2888DAC1E6EC014003A77C8 /* Controller */ = {  
1745 - isa = PBXGroup;  
1746 - children = (  
1747 - D2888DB51E6EC1B8003A77C8 /* LVCMyViewController.h */,  
1748 - D2888DB61E6EC1B8003A77C8 /* LVCMyViewController.m */,  
1749 - );  
1750 - path = Controller;  
1751 - sourceTree = "<group>";  
1752 - };  
1753 - D2888DAD1E6EC014003A77C8 /* Model */ = {  
1754 - isa = PBXGroup;  
1755 - children = (  
1756 - );  
1757 - path = Model;  
1758 - sourceTree = "<group>";  
1759 - };  
1760 - D2888DAE1E6EC014003A77C8 /* View */ = {  
1761 - isa = PBXGroup;  
1762 - children = (  
1763 - );  
1764 - path = View;  
1765 - sourceTree = "<group>";  
1766 - };  
1767 D2B7B24E1E8247B500ED084E /* ChatBarrageManager */ = { 2025 D2B7B24E1E8247B500ED084E /* ChatBarrageManager */ = {
1768 isa = PBXGroup; 2026 isa = PBXGroup;
1769 children = ( 2027 children = (
@@ -1848,7 +2106,6 @@ @@ -1848,7 +2106,6 @@
1848 TargetAttributes = { 2106 TargetAttributes = {
1849 D2029B801E6EAAA50027CD92 = { 2107 D2029B801E6EAAA50027CD92 = {
1850 CreatedOnToolsVersion = 8.2.1; 2108 CreatedOnToolsVersion = 8.2.1;
1851 - DevelopmentTeam = 94X49GG3ZW;  
1852 ProvisioningStyle = Automatic; 2109 ProvisioningStyle = Automatic;
1853 }; 2110 };
1854 D2029B991E6EAAA50027CD92 = { 2111 D2029B991E6EAAA50027CD92 = {
@@ -1927,12 +2184,14 @@ @@ -1927,12 +2184,14 @@
1927 files = ( 2184 files = (
1928 D2029CC31E6EADE10027CD92 /* UIImageView+HighlightedWebCache.m in Sources */, 2185 D2029CC31E6EADE10027CD92 /* UIImageView+HighlightedWebCache.m in Sources */,
1929 D22830FF1E77C69E00627701 /* GiftListView.m in Sources */, 2186 D22830FF1E77C69E00627701 /* GiftListView.m in Sources */,
  2187 + 4B45CE8A1EB86A590079AFB7 /* ZXPersonCommonCell.m in Sources */,
1930 81F1C83D1E8BBDE40085C2B8 /* V8HorizontalPickerView.m in Sources */, 2188 81F1C83D1E8BBDE40085C2B8 /* V8HorizontalPickerView.m in Sources */,
1931 D2029CC01E6EADE10027CD92 /* UIImage+GIF.m in Sources */, 2189 D2029CC01E6EADE10027CD92 /* UIImage+GIF.m in Sources */,
  2190 + 4B45CE851EB86A590079AFB7 /* ZXClearCachesCell.m in Sources */,
1932 D25BF8831E7F775F007FB138 /* LVCUGCPlayerLoadingView.m in Sources */, 2191 D25BF8831E7F775F007FB138 /* LVCUGCPlayerLoadingView.m in Sources */,
1933 81A4831A1E88E19C0097A80A /* LVCMoreProgramViewController.m in Sources */, 2192 81A4831A1E88E19C0097A80A /* LVCMoreProgramViewController.m in Sources */,
  2193 + 4B45CE9B1EB86A760079AFB7 /* ZXUIKit.m in Sources */,
1934 D2029BCF1E6EADD70027CD92 /* ZXTabBarController.m in Sources */, 2194 D2029BCF1E6EADD70027CD92 /* ZXTabBarController.m in Sources */,
1935 - D2029D071E6EAE2E0027CD92 /* ZXConst.m in Sources */,  
1936 D2029CB81E6EADE10027CD92 /* SDImageCache.m in Sources */, 2195 D2029CB81E6EADE10027CD92 /* SDImageCache.m in Sources */,
1937 D2029CBB1E6EADE10027CD92 /* SDWebImageDownloader.m in Sources */, 2196 D2029CBB1E6EADE10027CD92 /* SDWebImageDownloader.m in Sources */,
1938 D2029CA71E6EADE10027CD92 /* MJRefreshAutoGifFooter.m in Sources */, 2197 D2029CA71E6EADE10027CD92 /* MJRefreshAutoGifFooter.m in Sources */,
@@ -1941,37 +2200,43 @@ @@ -1941,37 +2200,43 @@
1941 D245715F1E83B09900AA85D6 /* userInfoModel.m in Sources */, 2200 D245715F1E83B09900AA85D6 /* userInfoModel.m in Sources */,
1942 D2029C861E6EADE10027CD92 /* Tools.m in Sources */, 2201 D2029C861E6EADE10027CD92 /* Tools.m in Sources */,
1943 D25BF8931E7FBAEA007FB138 /* LVCUGCBackgroundView.m in Sources */, 2202 D25BF8931E7FBAEA007FB138 /* LVCUGCBackgroundView.m in Sources */,
  2203 + 4B45CE861EB86A590079AFB7 /* ZXLoginShowView.m in Sources */,
1944 D2029CA01E6EADE10027CD92 /* NSObject+MJProperty.m in Sources */, 2204 D2029CA01E6EADE10027CD92 /* NSObject+MJProperty.m in Sources */,
  2205 + 4BD855FE1EBACD530082061D /* AFSecurityPolicy.m in Sources */,
1945 D2029CB51E6EADE10027CD92 /* SDiOSVersion.m in Sources */, 2206 D2029CB51E6EADE10027CD92 /* SDiOSVersion.m in Sources */,
  2207 + 4B45CE981EB86A760079AFB7 /* UILabel+createLabel.m in Sources */,
1946 D2029C9C1E6EADE10027CD92 /* MJPropertyType.m in Sources */, 2208 D2029C9C1E6EADE10027CD92 /* MJPropertyType.m in Sources */,
1947 81A4830E1E88B8300097A80A /* LVCChannelsModel.m in Sources */, 2209 81A4830E1E88B8300097A80A /* LVCChannelsModel.m in Sources */,
1948 D22831091E77D8D500627701 /* GiftModel.m in Sources */, 2210 D22831091E77D8D500627701 /* GiftModel.m in Sources */,
1949 D2029CCD1E6EADE10027CD92 /* SearchModel.m in Sources */, 2211 D2029CCD1E6EADE10027CD92 /* SearchModel.m in Sources */,
  2212 + 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */,
1950 810B65051E779B1F00133E15 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */, 2213 810B65051E779B1F00133E15 /* NSLayoutConstraint+MASDebugAdditions.m in Sources */,
1951 D2029CCB1E6EADE10027CD92 /* SVRadialGradientLayer.m in Sources */, 2214 D2029CCB1E6EADE10027CD92 /* SVRadialGradientLayer.m in Sources */,
1952 8130911E1E84C0F0005F0BFF /* LVCMessage.m in Sources */, 2215 8130911E1E84C0F0005F0BFF /* LVCMessage.m in Sources */,
1953 D23696841E7FC6A900E4BF71 /* chatListCell.m in Sources */, 2216 D23696841E7FC6A900E4BF71 /* chatListCell.m in Sources */,
  2217 + 4B45CE7B1EB86A590079AFB7 /* MinePersonalDataController.m in Sources */,
1954 D2029CAF1E6EADE10027CD92 /* MJRefreshStateHeader.m in Sources */, 2218 D2029CAF1E6EADE10027CD92 /* MJRefreshStateHeader.m in Sources */,
  2219 + 4BD856091EBACD530082061D /* UIRefreshControl+AFNetworking.m in Sources */,
1955 81F1C8401E8BC5CC0085C2B8 /* NSArray+Safety.m in Sources */, 2220 81F1C8401E8BC5CC0085C2B8 /* NSArray+Safety.m in Sources */,
1956 D2A089EE1E8A336A0071412C /* LiveLIstService.m in Sources */, 2221 D2A089EE1E8A336A0071412C /* LiveLIstService.m in Sources */,
1957 - D2029C941E6EADE10027CD92 /* UIRefreshControl+AFNetworking.m in Sources */,  
1958 - D2029C911E6EADE10027CD92 /* UIButton+AFNetworking.m in Sources */,  
1959 - D2029C931E6EADE10027CD92 /* UIProgressView+AFNetworking.m in Sources */,  
1960 D2A089E81E89FA720071412C /* LVCUGCLivePlayerCell.m in Sources */, 2222 D2A089E81E89FA720071412C /* LVCUGCLivePlayerCell.m in Sources */,
1961 - D2029C8D1E6EADE10027CD92 /* AFAutoPurgingImageCache.m in Sources */,  
1962 81A483111E88B8630097A80A /* LVCChannelDetailsModel.m in Sources */, 2223 81A483111E88B8630097A80A /* LVCChannelDetailsModel.m in Sources */,
1963 D2029D011E6EAE2E0027CD92 /* UIColor+HexString.m in Sources */, 2224 D2029D011E6EAE2E0027CD92 /* UIColor+HexString.m in Sources */,
  2225 + 4B45CE7D1EB86A590079AFB7 /* ModifyInfomationController.m in Sources */,
1964 D2029CA41E6EADE10027CD92 /* MJRefreshComponent.m in Sources */, 2226 D2029CA41E6EADE10027CD92 /* MJRefreshComponent.m in Sources */,
1965 D2575C7A1E76A4F300E3A8FC /* NHCarViews.m in Sources */, 2227 D2575C7A1E76A4F300E3A8FC /* NHCarViews.m in Sources */,
1966 D2029CBC1E6EADE10027CD92 /* SDWebImageDownloaderOperation.m in Sources */, 2228 D2029CBC1E6EADE10027CD92 /* SDWebImageDownloaderOperation.m in Sources */,
1967 D2029CA51E6EADE10027CD92 /* MJRefreshFooter.m in Sources */, 2229 D2029CA51E6EADE10027CD92 /* MJRefreshFooter.m in Sources */,
1968 D22830FC1E77C2D900627701 /* BottomToolView.m in Sources */, 2230 D22830FC1E77C2D900627701 /* BottomToolView.m in Sources */,
  2231 + 4BD856021EBACD530082061D /* AFURLSessionManager.m in Sources */,
  2232 + 4BD855FD1EBACD530082061D /* AFNetworkReachabilityManager.m in Sources */,
1969 810B65061E779B1F00133E15 /* View+MASAdditions.m in Sources */, 2233 810B65061E779B1F00133E15 /* View+MASAdditions.m in Sources */,
1970 D2029D161E6EB00D0027CD92 /* AppDelegate.m in Sources */, 2234 D2029D161E6EB00D0027CD92 /* AppDelegate.m in Sources */,
  2235 + 4B45CEA51EB86B9F0079AFB7 /* CNLiveThirdLoginManager.m in Sources */,
  2236 + 4BD8561D1EBAD6490082061D /* ZXConst.m in Sources */,
1971 D2029CB71E6EADE10027CD92 /* NSData+ImageContentType.m in Sources */, 2237 D2029CB71E6EADE10027CD92 /* NSData+ImageContentType.m in Sources */,
1972 D29E81ED1E88DC5B008C9906 /* PriChatCell.m in Sources */, 2238 D29E81ED1E88DC5B008C9906 /* PriChatCell.m in Sources */,
1973 D2029CD01E6EADE10027CD92 /* SearchPresenter.m in Sources */, 2239 D2029CD01E6EADE10027CD92 /* SearchPresenter.m in Sources */,
1974 - D2888DB71E6EC1B8003A77C8 /* LVCMyViewController.m in Sources */,  
1975 D2029CBE1E6EADE10027CD92 /* SDWebImagePrefetcher.m in Sources */, 2240 D2029CBE1E6EADE10027CD92 /* SDWebImagePrefetcher.m in Sources */,
1976 8128E2891E8A6A3600B40E75 /* CNBarrageView.m in Sources */, 2241 8128E2891E8A6A3600B40E75 /* CNBarrageView.m in Sources */,
1977 D2A803081E80BD6F009D6F1C /* TopToolView.m in Sources */, 2242 D2A803081E80BD6F009D6F1C /* TopToolView.m in Sources */,
@@ -1979,37 +2244,52 @@ @@ -1979,37 +2244,52 @@
1979 810B65011E779B1F00133E15 /* MASLayoutConstraint.m in Sources */, 2244 810B65011E779B1F00133E15 /* MASLayoutConstraint.m in Sources */,
1980 D2029CCE1E6EADE10027CD92 /* SearchRecomListModel.m in Sources */, 2245 D2029CCE1E6EADE10027CD92 /* SearchRecomListModel.m in Sources */,
1981 D2029CA11E6EADE10027CD92 /* NSString+MJExtension.m in Sources */, 2246 D2029CA11E6EADE10027CD92 /* NSString+MJExtension.m in Sources */,
  2247 + 4B45CE7A1EB86A590079AFB7 /* MineLiveController.m in Sources */,
1982 D2029BCB1E6EADD70027CD92 /* BaseTableViewCell.m in Sources */, 2248 D2029BCB1E6EADD70027CD92 /* BaseTableViewCell.m in Sources */,
1983 81F1C8381E8BBDDA0085C2B8 /* MHPagingScrollView.m in Sources */, 2249 81F1C8381E8BBDDA0085C2B8 /* MHPagingScrollView.m in Sources */,
1984 D2029CAA1E6EADE10027CD92 /* MJRefreshBackGifFooter.m in Sources */, 2250 D2029CAA1E6EADE10027CD92 /* MJRefreshBackGifFooter.m in Sources */,
  2251 + 4BD855FB1EBACD530082061D /* AFHTTPRequestOperationManager.m in Sources */,
1985 D217A24B1E7B76C7003B44CB /* PresentViewCell.m in Sources */, 2252 D217A24B1E7B76C7003B44CB /* PresentViewCell.m in Sources */,
1986 D2029C9B1E6EADE10027CD92 /* MJPropertyKey.m in Sources */, 2253 D2029C9B1E6EADE10027CD92 /* MJPropertyKey.m in Sources */,
  2254 + 4B45CE821EB86A590079AFB7 /* ZXMineCommonModel.m in Sources */,
1987 D2029CBF1E6EADE10027CD92 /* UIButton+WebCache.m in Sources */, 2255 D2029CBF1E6EADE10027CD92 /* UIButton+WebCache.m in Sources */,
1988 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */, 2256 810B64E31E779AFE00133E15 /* LVCLivePlayerController.m in Sources */,
1989 D2575C7E1E76A4F300E3A8FC /* NHPlaneViews.m in Sources */, 2257 D2575C7E1E76A4F300E3A8FC /* NHPlaneViews.m in Sources */,
  2258 + 4B45CE761EB86A590079AFB7 /* BeingAnchorController.m in Sources */,
1990 D2029CC51E6EADE10027CD92 /* UIView+WebCacheOperation.m in Sources */, 2259 D2029CC51E6EADE10027CD92 /* UIView+WebCacheOperation.m in Sources */,
1991 D2029CAB1E6EADE10027CD92 /* MJRefreshBackNormalFooter.m in Sources */, 2260 D2029CAB1E6EADE10027CD92 /* MJRefreshBackNormalFooter.m in Sources */,
1992 - D2029C8F1E6EADE10027CD92 /* AFNetworkActivityIndicatorManager.m in Sources */, 2261 + 4B45CEA61EB86B9F0079AFB7 /* NSNumber+ScaleHeight.m in Sources */,
1993 810B65031E779B1F00133E15 /* MASViewConstraint.m in Sources */, 2262 810B65031E779B1F00133E15 /* MASViewConstraint.m in Sources */,
1994 D2029BCE1E6EADD70027CD92 /* ZXNavigationController.m in Sources */, 2263 D2029BCE1E6EADD70027CD92 /* ZXNavigationController.m in Sources */,
1995 81A482F51E88ACC80097A80A /* LVCTelevisionView.m in Sources */, 2264 81A482F51E88ACC80097A80A /* LVCTelevisionView.m in Sources */,
1996 D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */, 2265 D2029CA21E6EADE10027CD92 /* MJRefreshAutoFooter.m in Sources */,
1997 D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */, 2266 D2029CC71E6EADE10027CD92 /* SVIndefiniteAnimatedView.m in Sources */,
1998 D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */, 2267 D2029CA31E6EADE10027CD92 /* MJRefreshBackFooter.m in Sources */,
  2268 + 4B45CE7E1EB86A590079AFB7 /* LoginViewController.m in Sources */,
1999 D255300C1E793F8200DF38A5 /* NHFighterView+animDelegagte.m in Sources */, 2269 D255300C1E793F8200DF38A5 /* NHFighterView+animDelegagte.m in Sources */,
2000 81A4831D1E88E1EB0097A80A /* LVCMoreSortTableViewCell.m in Sources */, 2270 81A4831D1E88E1EB0097A80A /* LVCMoreSortTableViewCell.m in Sources */,
  2271 + 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */,
  2272 + 4BD856011EBACD530082061D /* AFURLResponseSerialization.m in Sources */,
2001 D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */, 2273 D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */,
2002 D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */, 2274 D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */,
2003 D2029CC41E6EADE10027CD92 /* UIImageView+WebCache.m in Sources */, 2275 D2029CC41E6EADE10027CD92 /* UIImageView+WebCache.m in Sources */,
  2276 + 4B45CE801EB86A590079AFB7 /* idAndPwdView.m in Sources */,
2004 D236967E1E7F9E4100E4BF71 /* GiftPayButton.m in Sources */, 2277 D236967E1E7F9E4100E4BF71 /* GiftPayButton.m in Sources */,
  2278 + 4BD8560A1EBACD530082061D /* UIWebView+AFNetworking.m in Sources */,
  2279 + 4B45CE831EB86A590079AFB7 /* ZXMineModel.m in Sources */,
  2280 + 4B45CE791EB86A590079AFB7 /* MineAboutUsController.m in Sources */,
2005 81A483081E88B6140097A80A /* UIView+ViewController.m in Sources */, 2281 81A483081E88B6140097A80A /* UIView+ViewController.m in Sources */,
2006 D2A089EB1E8A09CB0071412C /* LVCUGCLivePlayerModel.m in Sources */, 2282 D2A089EB1E8A09CB0071412C /* LVCUGCLivePlayerModel.m in Sources */,
2007 D2029CC81E6EADE10027CD92 /* SVProgressAnimatedView.m in Sources */, 2283 D2029CC81E6EADE10027CD92 /* SVProgressAnimatedView.m in Sources */,
  2284 + 4B45CE891EB86A590079AFB7 /* ZXPersonalImageCell.m in Sources */,
2008 D2029C961E6EADE10027CD92 /* MBProgressHUD.m in Sources */, 2285 D2029C961E6EADE10027CD92 /* MBProgressHUD.m in Sources */,
2009 810B65071E779B1F00133E15 /* ViewController+MASAdditions.m in Sources */, 2286 810B65071E779B1F00133E15 /* ViewController+MASAdditions.m in Sources */,
2010 D2029C9A1E6EADE10027CD92 /* MJProperty.m in Sources */, 2287 D2029C9A1E6EADE10027CD92 /* MJProperty.m in Sources */,
  2288 + 4BD856031EBACD530082061D /* AFNetworkActivityIndicatorManager.m in Sources */,
  2289 + 4BD855CD1EBAC4B70082061D /* CNLiveKeychainWrapper.m in Sources */,
2011 D2029CB91E6EADE10027CD92 /* SDWebImageCompat.m in Sources */, 2290 D2029CB91E6EADE10027CD92 /* SDWebImageCompat.m in Sources */,
2012 D2029CB61E6EADE10027CD92 /* MKAnnotationView+WebCache.m in Sources */, 2291 D2029CB61E6EADE10027CD92 /* MKAnnotationView+WebCache.m in Sources */,
  2292 + 4BD856121EBAD2640082061D /* ProgramModel.m in Sources */,
2013 D2B2ED801E88FC5200F7538A /* LVCUGCLiveEndView.m in Sources */, 2293 D2B2ED801E88FC5200F7538A /* LVCUGCLiveEndView.m in Sources */,
2014 810B64FE1E779B1F00133E15 /* MASCompositeConstraint.m in Sources */, 2294 810B64FE1E779B1F00133E15 /* MASCompositeConstraint.m in Sources */,
2015 8128E2881E8A6A3600B40E75 /* CNBarrageManager.m in Sources */, 2295 8128E2881E8A6A3600B40E75 /* CNBarrageManager.m in Sources */,
@@ -2017,24 +2297,26 @@ @@ -2017,24 +2297,26 @@
2017 D2575C671E76A25400E3A8FC /* LVCInteractionController.m in Sources */, 2297 D2575C671E76A25400E3A8FC /* LVCInteractionController.m in Sources */,
2018 D2029CAE1E6EADE10027CD92 /* MJRefreshNormalHeader.m in Sources */, 2298 D2029CAE1E6EADE10027CD92 /* MJRefreshNormalHeader.m in Sources */,
2019 D23696921E7FC83800E4BF71 /* chatMsgModel.m in Sources */, 2299 D23696921E7FC83800E4BF71 /* chatMsgModel.m in Sources */,
2020 - D2029C901E6EADE10027CD92 /* UIActivityIndicatorView+AFNetworking.m in Sources */, 2300 + 4BD856071EBACD530082061D /* UIImageView+AFNetworking.m in Sources */,
2021 D2029CC61E6EADE10027CD92 /* SSKeychain.m in Sources */, 2301 D2029CC61E6EADE10027CD92 /* SSKeychain.m in Sources */,
  2302 + 4B45CE871EB86A590079AFB7 /* ZXMineCommonCell.m in Sources */,
2022 811BB68E1E8116C8005C6291 /* NSString+StringSize.m in Sources */, 2303 811BB68E1E8116C8005C6291 /* NSString+StringSize.m in Sources */,
2023 - D2029C8B1E6EADE10027CD92 /* AFURLResponseSerialization.m in Sources */,  
2024 - D2029C921E6EADE10027CD92 /* UIImageView+AFNetworking.m in Sources */, 2304 + 4BD856051EBACD530082061D /* UIAlertView+AFNetworking.m in Sources */,
2025 D224B1971E826ED800CC61D0 /* ChatBarrageAnimAction.m in Sources */, 2305 D224B1971E826ED800CC61D0 /* ChatBarrageAnimAction.m in Sources */,
2026 D2029C9E1E6EADE10027CD92 /* NSObject+MJCoding.m in Sources */, 2306 D2029C9E1E6EADE10027CD92 /* NSObject+MJCoding.m in Sources */,
2027 81A483021E88B0130097A80A /* LVCChatRoomModel.m in Sources */, 2307 81A483021E88B0130097A80A /* LVCChatRoomModel.m in Sources */,
2028 D2029C991E6EADE10027CD92 /* MJFoundation.m in Sources */, 2308 D2029C991E6EADE10027CD92 /* MJFoundation.m in Sources */,
  2309 + 4B45CE8B1EB86A590079AFB7 /* ZXTextField.m in Sources */,
2029 D2575C461E76857100E3A8FC /* LVCAnimationManager.m in Sources */, 2310 D2575C461E76857100E3A8FC /* LVCAnimationManager.m in Sources */,
2030 - D2029C8A1E6EADE10027CD92 /* AFURLRequestSerialization.m in Sources */,  
2031 D2A089F11E8A41120071412C /* LVCUGCLiveListModel.m in Sources */, 2311 D2A089F11E8A41120071412C /* LVCUGCLiveListModel.m in Sources */,
2032 D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */, 2312 D2029D041E6EAE2E0027CD92 /* UILabel+ContentSize.m in Sources */,
  2313 + 4B45CE7C1EB86A590079AFB7 /* MineSettingViewController.m in Sources */,
  2314 + 4BD855D11EBAC7220082061D /* DESUtility.m in Sources */,
2033 D25530031E79115100DF38A5 /* AnimQueueManager.m in Sources */, 2315 D25530031E79115100DF38A5 /* AnimQueueManager.m in Sources */,
2034 - D2029C871E6EADE10027CD92 /* AFHTTPSessionManager.m in Sources */,  
2035 81A482F81E88AFA20097A80A /* LVCFirstHeaderReusableView.m in Sources */, 2316 81A482F81E88AFA20097A80A /* LVCFirstHeaderReusableView.m in Sources */,
2036 D2029B861E6EAAA50027CD92 /* main.m in Sources */, 2317 D2029B861E6EAAA50027CD92 /* main.m in Sources */,
2037 - D2029C8C1E6EADE10027CD92 /* AFURLSessionManager.m in Sources */, 2318 + 4B45CEA71EB86B9F0079AFB7 /* NSObject+UserModel.m in Sources */,
  2319 + 4BD856061EBACD530082061D /* UIButton+AFNetworking.m in Sources */,
2038 D2029C9F1E6EADE10027CD92 /* NSObject+MJKeyValue.m in Sources */, 2320 D2029C9F1E6EADE10027CD92 /* NSObject+MJKeyValue.m in Sources */,
2039 D25BF8A01E80C4BD007FB138 /* UIImage+LVCVagueImage.m in Sources */, 2321 D25BF8A01E80C4BD007FB138 /* UIImage+LVCVagueImage.m in Sources */,
2040 D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */, 2322 D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */,
@@ -2045,11 +2327,14 @@ @@ -2045,11 +2327,14 @@
2045 D2029CAD1E6EADE10027CD92 /* MJRefreshGifHeader.m in Sources */, 2327 D2029CAD1E6EADE10027CD92 /* MJRefreshGifHeader.m in Sources */,
2046 81A483141E88BA420097A80A /* LVCLiveListCollectionViewCell.m in Sources */, 2328 81A483141E88BA420097A80A /* LVCLiveListCollectionViewCell.m in Sources */,
2047 D2029CB31E6EADE10027CD92 /* UIScrollView+MJRefresh.m in Sources */, 2329 D2029CB31E6EADE10027CD92 /* UIScrollView+MJRefresh.m in Sources */,
  2330 + 4BD856151EBAD31A0082061D /* NSString+UrlEncode.m in Sources */,
  2331 + 4B45CE7F1EB86A590079AFB7 /* RegisterCommonController.m in Sources */,
  2332 + 4BD855FA1EBACD530082061D /* AFHTTPRequestOperation.m in Sources */,
2048 D2029D051E6EAE2E0027CD92 /* UILabel+labelFitSize.m in Sources */, 2333 D2029D051E6EAE2E0027CD92 /* UILabel+labelFitSize.m in Sources */,
2049 D2029CB21E6EADE10027CD92 /* UIScrollView+MJExtension.m in Sources */, 2334 D2029CB21E6EADE10027CD92 /* UIScrollView+MJExtension.m in Sources */,
2050 D29D88481E88C53300543A03 /* LVCUGCLivePrepareView.m in Sources */, 2335 D29D88481E88C53300543A03 /* LVCUGCLivePrepareView.m in Sources */,
2051 D2029D091E6EAE2E0027CD92 /* Foundation+Log.m in Sources */, 2336 D2029D091E6EAE2E0027CD92 /* Foundation+Log.m in Sources */,
2052 - D2029C8E1E6EADE10027CD92 /* AFImageDownloader.m in Sources */, 2337 + 4B45CEAB1EB86BFA0079AFB7 /* NSString+ZXExtension.m in Sources */,
2053 81A483201E88F4BF0097A80A /* LVCProgramModel.m in Sources */, 2338 81A483201E88F4BF0097A80A /* LVCProgramModel.m in Sources */,
2054 D2029BCA1E6EADD70027CD92 /* BaseModel.m in Sources */, 2339 D2029BCA1E6EADD70027CD92 /* BaseModel.m in Sources */,
2055 D25BF87B1E7B8A82007FB138 /* SliderView.m in Sources */, 2340 D25BF87B1E7B8A82007FB138 /* SliderView.m in Sources */,
@@ -2057,28 +2342,38 @@ @@ -2057,28 +2342,38 @@
2057 81A4830B1E88B7EE0097A80A /* LVCOtherHeaderReusableView.m in Sources */, 2342 81A4830B1E88B7EE0097A80A /* LVCOtherHeaderReusableView.m in Sources */,
2058 D25BF8801E7BD266007FB138 /* LVCUGCLivePlayerController.m in Sources */, 2343 D25BF8801E7BD266007FB138 /* LVCUGCLivePlayerController.m in Sources */,
2059 D2029D031E6EAE2E0027CD92 /* UIImage+ZXExtension.m in Sources */, 2344 D2029D031E6EAE2E0027CD92 /* UIImage+ZXExtension.m in Sources */,
  2345 + 4BD855FC1EBACD530082061D /* AFHTTPSessionManager.m in Sources */,
  2346 + 4B45CE841EB86A590079AFB7 /* ModifyCommonView.m in Sources */,
  2347 + 4BD856081EBACD530082061D /* UIProgressView+AFNetworking.m in Sources */,
2060 D24571581E8393EB00AA85D6 /* UIImageView+ZXExtension.m in Sources */, 2348 D24571581E8393EB00AA85D6 /* UIImageView+ZXExtension.m in Sources */,
2061 D2029D0A1E6EAE2E0027CD92 /* ZXServerUrl.m in Sources */, 2349 D2029D0A1E6EAE2E0027CD92 /* ZXServerUrl.m in Sources */,
2062 D2029CCA1E6EADE10027CD92 /* SVProgressHUD.m in Sources */, 2350 D2029CCA1E6EADE10027CD92 /* SVProgressHUD.m in Sources */,
2063 81A483051E88B32C0097A80A /* LVCHeaderRollCollectionViewCell.m in Sources */, 2351 81A483051E88B32C0097A80A /* LVCHeaderRollCollectionViewCell.m in Sources */,
2064 D2029CA81E6EADE10027CD92 /* MJRefreshAutoNormalFooter.m in Sources */, 2352 D2029CA81E6EADE10027CD92 /* MJRefreshAutoNormalFooter.m in Sources */,
2065 - D2029C891E6EADE10027CD92 /* AFSecurityPolicy.m in Sources */, 2353 + 4B45CE991EB86A760079AFB7 /* UITextField+createTextField.m in Sources */,
  2354 + 4B45CEA81EB86B9F0079AFB7 /* UserTools.m in Sources */,
2066 D217A24A1E7B76C7003B44CB /* PresentView.m in Sources */, 2355 D217A24A1E7B76C7003B44CB /* PresentView.m in Sources */,
2067 D22830F11E778C0F00627701 /* LiveBaseView.m in Sources */, 2356 D22830F11E778C0F00627701 /* LiveBaseView.m in Sources */,
  2357 + 4B45CEAE1EB873630079AFB7 /* UserInformationModel.m in Sources */,
2068 D2029CBA1E6EADE10027CD92 /* SDWebImageDecoder.m in Sources */, 2358 D2029CBA1E6EADE10027CD92 /* SDWebImageDecoder.m in Sources */,
2069 8112D4311E7927A5002E00F6 /* LVCPlayerLoadingView.m in Sources */, 2359 8112D4311E7927A5002E00F6 /* LVCPlayerLoadingView.m in Sources */,
  2360 + 4B45CE9A1EB86A760079AFB7 /* ZXLabel.m in Sources */,
2070 D2029D081E6EAE2E0027CD92 /* ZXDeviceInfo.m in Sources */, 2361 D2029D081E6EAE2E0027CD92 /* ZXDeviceInfo.m in Sources */,
2071 D24571631E83C40B00AA85D6 /* PrivateView.m in Sources */, 2362 D24571631E83C40B00AA85D6 /* PrivateView.m in Sources */,
2072 D2029CC21E6EADE10027CD92 /* UIImage+WebP.m in Sources */, 2363 D2029CC21E6EADE10027CD92 /* UIImage+WebP.m in Sources */,
  2364 + 4BD856001EBACD530082061D /* AFURLRequestSerialization.m in Sources */,
2073 D2029BCD1E6EADD70027CD92 /* BaseViewController.m in Sources */, 2365 D2029BCD1E6EADD70027CD92 /* BaseViewController.m in Sources */,
2074 810B64E01E779AE900133E15 /* LVCPlayer.m in Sources */, 2366 810B64E01E779AE900133E15 /* LVCPlayer.m in Sources */,
  2367 + 4B45CE811EB86A590079AFB7 /* RegistBasicInformationView.m in Sources */,
2075 810B64FF1E779B1F00133E15 /* MASConstraint.m in Sources */, 2368 810B64FF1E779B1F00133E15 /* MASConstraint.m in Sources */,
2076 D25BF87A1E7B8A82007FB138 /* FilterFunctionView.m in Sources */, 2369 D25BF87A1E7B8A82007FB138 /* FilterFunctionView.m in Sources */,
2077 D207BEA11E84C1EC006A0CE8 /* AnimationBaseView.m in Sources */, 2370 D207BEA11E84C1EC006A0CE8 /* AnimationBaseView.m in Sources */,
  2371 + 4B45CE971EB86A760079AFB7 /* UIButton+createButton.m in Sources */,
2078 D2029D001E6EAE2E0027CD92 /* NSNumber+ScaleHeight.m in Sources */, 2372 D2029D001E6EAE2E0027CD92 /* NSNumber+ScaleHeight.m in Sources */,
  2373 + 4BD856041EBACD530082061D /* UIActivityIndicatorView+AFNetworking.m in Sources */,
  2374 + 4B45CE781EB86A590079AFB7 /* JCMineViewController.m in Sources */,
2079 81CE9E1B1E8CF567000F8F6B /* LVCRequestFailedView.m in Sources */, 2375 81CE9E1B1E8CF567000F8F6B /* LVCRequestFailedView.m in Sources */,
2080 D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */, 2376 D2888D9E1E6EBF1B003A77C8 /* LVCLiveViewController.m in Sources */,
2081 - D2029C951E6EADE10027CD92 /* UIWebView+AFNetworking.m in Sources */,  
2082 810B650A1E77B39D00133E15 /* LVCFullScreenPlayerController.m in Sources */, 2377 810B650A1E77B39D00133E15 /* LVCFullScreenPlayerController.m in Sources */,
2083 D217A24E1E7B77C7003B44CB /* ComboCell.m in Sources */, 2378 D217A24E1E7B77C7003B44CB /* ComboCell.m in Sources */,
2084 D2029CBD1E6EADE10027CD92 /* SDWebImageManager.m in Sources */, 2379 D2029CBD1E6EADE10027CD92 /* SDWebImageManager.m in Sources */,
@@ -2092,16 +2387,18 @@ @@ -2092,16 +2387,18 @@
2092 D2029C9D1E6EADE10027CD92 /* NSObject+MJClass.m in Sources */, 2387 D2029C9D1E6EADE10027CD92 /* NSObject+MJClass.m in Sources */,
2093 D2029CCF1E6EADE10027CD92 /* SearchHttp.m in Sources */, 2388 D2029CCF1E6EADE10027CD92 /* SearchHttp.m in Sources */,
2094 810B65001E779B1F00133E15 /* MASConstraintMaker.m in Sources */, 2389 810B65001E779B1F00133E15 /* MASConstraintMaker.m in Sources */,
2095 - D2029C881E6EADE10027CD92 /* AFNetworkReachabilityManager.m in Sources */,  
2096 D245715C1E83A62B00AA85D6 /* BounceView.m in Sources */, 2390 D245715C1E83A62B00AA85D6 /* BounceView.m in Sources */,
2097 D2029D021E6EAE2E0027CD92 /* UIImage+ScaleImageSize.m in Sources */, 2391 D2029D021E6EAE2E0027CD92 /* UIImage+ScaleImageSize.m in Sources */,
2098 D2029BCC1E6EADD70027CD92 /* BaseView.m in Sources */, 2392 D2029BCC1E6EADD70027CD92 /* BaseView.m in Sources */,
2099 D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */, 2393 D2888D941E6EB8B4003A77C8 /* LVCTabBar.m in Sources */,
  2394 + 4B45CE771EB86A590079AFB7 /* IDViewController.m in Sources */,
  2395 + 4BD855FF1EBACD530082061D /* AFURLConnectionOperation.m in Sources */,
2100 D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */, 2396 D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */,
2101 D2B7B2541E824B2D00ED084E /* ChatBarrageView.m in Sources */, 2397 D2B7B2541E824B2D00ED084E /* ChatBarrageView.m in Sources */,
2102 D25530061E7911A800DF38A5 /* GiftAnimationAction.m in Sources */, 2398 D25530061E7911A800DF38A5 /* GiftAnimationAction.m in Sources */,
2103 81A483171E88BED00097A80A /* LVCTVLiveViewController.m in Sources */, 2399 81A483171E88BED00097A80A /* LVCTVLiveViewController.m in Sources */,
2104 81A1B9A91E8277410079FF5F /* LVCInputView.m in Sources */, 2400 81A1B9A91E8277410079FF5F /* LVCInputView.m in Sources */,
  2401 + 4B45CE881EB86A590079AFB7 /* ZXMineShowCell.m in Sources */,
2105 D2029CD41E6EADE70027CD92 /* HttpService.m in Sources */, 2402 D2029CD41E6EADE70027CD92 /* HttpService.m in Sources */,
2106 ); 2403 );
2107 runOnlyForDeploymentPostprocessing = 0; 2404 runOnlyForDeploymentPostprocessing = 0;
@@ -2245,10 +2542,11 @@ @@ -2245,10 +2542,11 @@
2245 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 2542 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
2246 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 2543 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
2247 CLANG_ENABLE_OBJC_WEAK = YES; 2544 CLANG_ENABLE_OBJC_WEAK = YES;
2248 - DEVELOPMENT_TEAM = 94X49GG3ZW; 2545 + DEVELOPMENT_TEAM = "";
2249 FRAMEWORK_SEARCH_PATHS = ( 2546 FRAMEWORK_SEARCH_PATHS = (
2250 "$(inherited)", 2547 "$(inherited)",
2251 "$(PROJECT_DIR)/LiveVideoCloud/Classes/CNLiveSDK", 2548 "$(PROJECT_DIR)/LiveVideoCloud/Classes/CNLiveSDK",
  2549 + "$(PROJECT_DIR)",
2252 ); 2550 );
2253 GCC_PREFIX_HEADER = "$(SRCROOT)/LiveVideoCloud/PrefixHeader.pch"; 2551 GCC_PREFIX_HEADER = "$(SRCROOT)/LiveVideoCloud/PrefixHeader.pch";
2254 INFOPLIST_FILE = LiveVideoCloud/Info.plist; 2552 INFOPLIST_FILE = LiveVideoCloud/Info.plist;
@@ -2259,7 +2557,7 @@ @@ -2259,7 +2557,7 @@
2259 "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource", 2557 "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource",
2260 ); 2558 );
2261 OTHER_LDFLAGS = ""; 2559 OTHER_LDFLAGS = "";
2262 - PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shixunyun; 2560 + PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shipinzhongguo;
2263 PRODUCT_NAME = "$(TARGET_NAME)"; 2561 PRODUCT_NAME = "$(TARGET_NAME)";
2264 }; 2562 };
2265 name = Debug; 2563 name = Debug;
@@ -2270,10 +2568,11 @@ @@ -2270,10 +2568,11 @@
2270 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 2568 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
2271 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 2569 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
2272 CLANG_ENABLE_OBJC_WEAK = YES; 2570 CLANG_ENABLE_OBJC_WEAK = YES;
2273 - DEVELOPMENT_TEAM = 94X49GG3ZW; 2571 + DEVELOPMENT_TEAM = "";
2274 FRAMEWORK_SEARCH_PATHS = ( 2572 FRAMEWORK_SEARCH_PATHS = (
2275 "$(inherited)", 2573 "$(inherited)",
2276 "$(PROJECT_DIR)/LiveVideoCloud/Classes/CNLiveSDK", 2574 "$(PROJECT_DIR)/LiveVideoCloud/Classes/CNLiveSDK",
  2575 + "$(PROJECT_DIR)",
2277 ); 2576 );
2278 GCC_PREFIX_HEADER = "$(SRCROOT)/LiveVideoCloud/PrefixHeader.pch"; 2577 GCC_PREFIX_HEADER = "$(SRCROOT)/LiveVideoCloud/PrefixHeader.pch";
2279 INFOPLIST_FILE = LiveVideoCloud/Info.plist; 2578 INFOPLIST_FILE = LiveVideoCloud/Info.plist;
@@ -2284,7 +2583,7 @@ @@ -2284,7 +2583,7 @@
2284 "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource", 2583 "$(PROJECT_DIR)/LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftResource",
2285 ); 2584 );
2286 OTHER_LDFLAGS = ""; 2585 OTHER_LDFLAGS = "";
2287 - PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shixunyun; 2586 + PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shipinzhongguo;
2288 PRODUCT_NAME = "$(TARGET_NAME)"; 2587 PRODUCT_NAME = "$(TARGET_NAME)";
2289 }; 2588 };
2290 name = Release; 2589 name = Release;
LiveVideoCloud/LiveVideoCloud/AppCustoms/Base/BaseViewController.m
@@ -57,14 +57,18 @@ @@ -57,14 +57,18 @@
57 [_btnLeft setFrame:CGRectMake(0, 0, 30, 30)]; 57 [_btnLeft setFrame:CGRectMake(0, 0, 30, 30)];
58 [_btnLeft addTarget:self action:@selector(onBackAction) forControlEvents:UIControlEventTouchUpInside]; 58 [_btnLeft addTarget:self action:@selector(onBackAction) forControlEvents:UIControlEventTouchUpInside];
59 59
60 - [_btnLeft setBackgroundImage:[UIImage imageNamed:@"返回按钮"] forState:UIControlStateNormal];  
61 - [_btnLeft setBackgroundImage:[UIImage imageNamed:@"返回按钮_p"] forState:UIControlStateHighlighted]; 60 + [_btnLeft setBackgroundImage:[UIImage imageNamed:@"fanhui_default"] forState:UIControlStateNormal];
  61 + [_btnLeft setBackgroundImage:[UIImage imageNamed:@"fanhui_focused"] forState:UIControlStateHighlighted];
62 _btnLeft.highlighted = NO; 62 _btnLeft.highlighted = NO;
63 UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:_btnLeft]; 63 UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithCustomView:_btnLeft];
64 64
65 UIBarButtonItem * negativeSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; 65 UIBarButtonItem * negativeSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
66 negativeSpacer.width = -8;//默认leftItemX == 18,要求距左边10 66 negativeSpacer.width = -8;//默认leftItemX == 18,要求距左边10
67 [self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:negativeSpacer,backItem, nil]]; 67 [self.navigationItem setLeftBarButtonItems:[NSArray arrayWithObjects:negativeSpacer,backItem, nil]];
  68 +
  69 + if (self.navigationController.viewControllers[0] == self) {
  70 + _btnLeft.hidden = YES;
  71 + }
68 } 72 }
69 73
70 /** 74 /**
LiveVideoCloud/LiveVideoCloud/AppCustoms/Main/ZXNavigationController.m
@@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
23 self.interactivePopGestureRecognizer.enabled = YES; 23 self.interactivePopGestureRecognizer.enabled = YES;
24 24
25 [[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]]; 25 [[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]];
  26 +
26 } 27 }
27 28
28 /** 29 /**
LiveVideoCloud/LiveVideoCloud/AppCustoms/Main/ZXTabBarController.m
@@ -13,6 +13,8 @@ @@ -13,6 +13,8 @@
13 #import "LVCMyViewController.h" 13 #import "LVCMyViewController.h"
14 #import "LVCTabBar.h" 14 #import "LVCTabBar.h"
15 15
  16 +#import "JCMineViewController.h"
  17 +
16 @interface ZXTabBarController ()<LVCTabBarDelegate> 18 @interface ZXTabBarController ()<LVCTabBarDelegate>
17 19
18 @end 20 @end
@@ -49,7 +51,8 @@ @@ -49,7 +51,8 @@
49 - (void)createUI 51 - (void)createUI
50 { 52 {
51 [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[HomeViewController alloc]init]] title:@"" image:@"home page" selectedImage:@"home page-click on"]; 53 [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[HomeViewController alloc]init]] title:@"" image:@"home page" selectedImage:@"home page-click on"];
52 - [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[LVCMyViewController alloc]init]] title:@"" image:@"my" selectedImage:@"my-click on"]; 54 +// [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[LVCMyViewController alloc]init]] title:@"" image:@"my" selectedImage:@"my-click on"];
  55 + [self setupOneChildViewController:[[ZXNavigationController alloc]initWithRootViewController:[[JCMineViewController alloc]init]] title:@"" image:@"my" selectedImage:@"my-click on"];
53 } 56 }
54 57
55 - (void)setupOneChildViewController:(UIViewController *)vc title:(NSString *)title image:(NSString *)image selectedImage:(NSString *)selectedImage 58 - (void)setupOneChildViewController:(UIViewController *)vc title:(NSString *)title image:(NSString *)image selectedImage:(NSString *)selectedImage
LiveVideoCloud/LiveVideoCloud/AppDelegate/AppDelegate.m
@@ -26,10 +26,12 @@ @@ -26,10 +26,12 @@
26 self.window.rootViewController = [[ZXTabBarController alloc] init]; 26 self.window.rootViewController = [[ZXTabBarController alloc] init];
27 27
28 //初始化直播SDK 28 //初始化直播SDK
29 - [[CNLiveWebcastManager manager] initWithAppId:AppId appKey:AppKey]; 29 + [[CNLiveWebcastManager manager] initWithAppId:UserAppId appKey:UserAppKey];
30 30
31 //初始化聊天SDK并连接服务器 31 //初始化聊天SDK并连接服务器
32 - [[CNLiveChatManager sharedCNLiveChatManager] initWithAppKey:AppKey appId:AppId]; 32 + [[CNLiveChatManager sharedCNLiveChatManager] initWithAppKey:UserAppKey appId:UserAppId];
  33 +
  34 + [CNLiveUserSystemCenter setAppId:UserAppId appKey:UserAppKey appSecret:UserAppSceret];
33 35
34 /* 36 /*
35 [[CNLiveChatManager sharedCNLiveChatManager] connectServerSuccess:^{ 37 [[CNLiveChatManager sharedCNLiveChatManager] connectServerSuccess:^{
LiveVideoCloud/LiveVideoCloud/Classes/Helpers/Tools.h
@@ -7,10 +7,20 @@ @@ -7,10 +7,20 @@
7 // 7 //
8 8
9 #import <Foundation/Foundation.h> 9 #import <Foundation/Foundation.h>
  10 +#import "MBProgressHUD.h"
10 11
11 @class userInfoModel; 12 @class userInfoModel;
12 13
13 @interface Tools : NSObject 14 @interface Tools : NSObject
  15 +typedef enum {
  16 +
  17 + SeparatorColorWhite = 0, //背景为白色
  18 + SeparatorColorBlack = 1, //背景为黑色
  19 + SeparatorColorBlackTranslucent = 2, //背景为黑色半透明
  20 + SeparatorColorGray = 3,
  21 + SeparatorTableViewCell = 4
  22 +
  23 +} SeparatorColorType; //分割线颜色
14 24
15 25
16 typedef NS_ENUM(NSInteger, ShowMessageType) {//消息背景类型 26 typedef NS_ENUM(NSInteger, ShowMessageType) {//消息背景类型
@@ -18,6 +28,11 @@ typedef NS_ENUM(NSInteger, ShowMessageType) {//消息背景类型 @@ -18,6 +28,11 @@ typedef NS_ENUM(NSInteger, ShowMessageType) {//消息背景类型
18 ShowMessageTypeBlack ,//半透明背景 28 ShowMessageTypeBlack ,//半透明背景
19 }; 29 };
20 30
  31 +
  32 ++ (nullable MBProgressHUD *)showHUDInView:(nullable UIView *)view withString:(nullable NSString *)string autoHide:(BOOL)hide;
  33 +
  34 ++ (nullable MBProgressHUD *)showActivityHudInView:(nullable UIView *)view withString:(nullable NSString *)string;
  35 +
21 /** 36 /**
22 弹出页 37 弹出页
23 38
@@ -33,5 +48,26 @@ typedef NS_ENUM(NSInteger, ShowMessageType) {//消息背景类型 @@ -33,5 +48,26 @@ typedef NS_ENUM(NSInteger, ShowMessageType) {//消息背景类型
33 48
34 + (NSDictionary *_Nullable)dictionaryWithJsonString:(NSString *_Nullable)jsonString; 49 + (NSDictionary *_Nullable)dictionaryWithJsonString:(NSString *_Nullable)jsonString;
35 50
  51 ++ (nullable UIImage *)getImageFromColor:(nullable UIColor *)color;
  52 +
  53 +
  54 ++ (BOOL)isArray:(nullable NSArray *)array;
  55 +
  56 ++ (BOOL)isDictionary:(nullable NSDictionary *)dic;
  57 +
  58 ++ (BOOL)isEmptyString:(nullable NSString *)string;
  59 +
  60 ++ (BOOL)isValidMobileNum:(nullable NSString *)number;
  61 +
  62 ++ (nullable NSString *)timestamp;
  63 +
  64 ++ (nullable UIView *)addLineToView:(nullable UIView *)view separatorColorType:(SeparatorColorType)type lineFrame:(CGRect)frame;
  65 +
  66 +#pragma mark 正则表达式验证手机号
  67 ++ (BOOL)isMobileNumber:( NSString * _Nullable )mobileNum;
  68 +
  69 +
  70 ++ (nullable NSString *)stringByDictionary:(nullable NSDictionary *)dic;
36 71
  72 ++ (NSString *_Nonnull)uuid;
37 @end 73 @end
LiveVideoCloud/LiveVideoCloud/Classes/Helpers/Tools.m
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 #import "Tools.h" 9 #import "Tools.h"
10 #import "BounceView.h" 10 #import "BounceView.h"
11 #import "userInfoModel.h" 11 #import "userInfoModel.h"
  12 +#import "CNLiveKeychainWrapper.h"
12 13
13 @interface Tools () 14 @interface Tools ()
14 15
@@ -17,6 +18,31 @@ @@ -17,6 +18,31 @@
17 18
18 @implementation Tools 19 @implementation Tools
19 20
  21 +
  22 +
  23 ++ (nullable MBProgressHUD *)showHUDInView:(nullable UIView *)view withString:(nullable NSString *)string autoHide:(BOOL)hide
  24 +{
  25 + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
  26 + hud.mode = MBProgressHUDModeText;
  27 + hud.detailsLabelText = string;
  28 + hud.detailsLabelFont = [UIFont systemFontOfSize:13];
  29 + hud.margin = 10.f;
  30 + hud.removeFromSuperViewOnHide = YES;
  31 + if (hide) {
  32 + [hud hide:NO afterDelay:2.5];
  33 + }
  34 + return hud;
  35 +}
  36 +
  37 +
  38 ++ (nullable MBProgressHUD *)showActivityHudInView:(nullable UIView *)view withString:(nullable NSString *)string
  39 +{
  40 + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
  41 + hud.labelText = string;
  42 + hud.removeFromSuperViewOnHide = YES;
  43 + return hud;
  44 +}
  45 +
20 /** 46 /**
21 弹出页 47 弹出页
22 48
@@ -145,5 +171,145 @@ @@ -145,5 +171,145 @@
145 return dic; 171 return dic;
146 } 172 }
147 173
  174 ++ (nullable UIImage *)getImageFromColor:(nullable UIColor *)color
  175 +{
  176 + CGRect rect = CGRectMake(0, 0, 1, 1);
  177 + UIGraphicsBeginImageContext(rect.size);
  178 + CGContextRef context = UIGraphicsGetCurrentContext();
  179 + CGContextSetFillColorWithColor(context, [color CGColor]);
  180 + CGContextFillRect(context, rect);
  181 + UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
  182 + UIGraphicsEndImageContext();
  183 + return img;
  184 +}
  185 +
  186 +
  187 ++ (BOOL)isArray:(NSArray *)array
  188 +{
  189 + if (array && [array isKindOfClass:[NSArray class]] && [array count]>0) {
  190 + return YES;
  191 + }
  192 +
  193 + return NO;
  194 +}
  195 +
  196 ++ (BOOL)isDictionary:(NSDictionary *)dic
  197 +{
  198 + if (dic && [dic isKindOfClass:[NSDictionary class]] && [dic count]>0) {
  199 + return YES;
  200 + }
  201 +
  202 + return NO;
  203 +}
  204 +
  205 ++ (BOOL)isEmptyString:(NSString *)string
  206 +{
  207 + if (!string || ![string isKindOfClass:[NSString class]] || string.length == 0 || [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length == 0) {
  208 + return YES;
  209 + }
  210 + return NO;
  211 +}
  212 +
  213 ++ (BOOL)isValidMobileNum:(nullable NSString *)number {
  214 +
  215 + NSString *validMobileNum = @"^1(3[0-9]|4[5-7]|5[0-35-9]|7[0-9]|8[0-9])+[0-9]{8}";
  216 + NSPredicate *regexTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", validMobileNum];
  217 + return [regexTest evaluateWithObject:number];
  218 +}
  219 +
  220 ++ (NSString *)timestamp {
  221 +
  222 + NSString *stamp = @"";
  223 +
  224 + stamp = [NSString stringWithFormat:@"%.3f", [[NSDate date] timeIntervalSince1970]];
  225 + stamp = [stamp stringByReplacingOccurrencesOfString:@"." withString:@""];
  226 +
  227 + return stamp;
  228 +}
  229 +
  230 ++ (nullable UIView *)addLineToView:(nullable UIView *)view separatorColorType:(SeparatorColorType)type lineFrame:(CGRect)frame
  231 +{
  232 + UIView *line = [[UIView alloc] initWithFrame:frame];
  233 + switch (type) {
  234 + case SeparatorColorWhite:
  235 + line.backgroundColor = [UIColor colorWithHexString:@"#eeeeee"];
  236 + break;
  237 + case SeparatorColorBlack:
  238 +
  239 + break;
  240 + case SeparatorColorBlackTranslucent:
  241 +
  242 + break;
  243 + case SeparatorColorGray:
  244 + line.backgroundColor = [UIColor colorWithHexString:@"#dcdcdc"];
  245 + break;
  246 + case SeparatorTableViewCell:
  247 + line.backgroundColor = [UIColor colorWithHexString:@"#cfcfd0"];
  248 + break;
  249 +
  250 + default:
  251 + break;
  252 + }
  253 + [view addSubview:line];
  254 + return line;
  255 +}
  256 +
  257 +#pragma mark 正则表达式验证手机号
  258 ++ (BOOL)isMobileNumber:(NSString *)mobileNum
  259 +{
  260 + // NSString * MOBILE = @"^0?(13[0-9]|15[012356789]|18[02356789]|14[57])[0-9]{8}$";
  261 + NSString * MOBILE = @"^((1[3,5,8][0-9])|(14[5,7])|(17[0,6,7,8]))[0-9]{8}$";
  262 + NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", MOBILE];
  263 +
  264 + if ([regextestmobile evaluateWithObject:mobileNum])
  265 + {
  266 + return YES;
  267 + }
  268 + else
  269 + {
  270 + return NO;
  271 + }
  272 +
  273 +}
  274 +
  275 ++ (UIView *)addLineToView:(UIView *)view separatorColorHex:(NSString *)hex lineFrame:(CGRect)frame
  276 +{
  277 + UIView *line = [[UIView alloc] initWithFrame:frame];
  278 + line.backgroundColor = [UIColor colorWithHexString:hex];
  279 + [view addSubview:line];
  280 + return line;
  281 +}
  282 +
  283 +
  284 ++ (nullable NSString *)stringByDictionary:(nullable NSDictionary *)dic
  285 +{
  286 + if (![Tools isDictionary:dic]) {
  287 + return nil;
  288 + }
  289 + NSMutableString *string = [[NSMutableString alloc] init];
  290 + for (NSString *key in dic) {
  291 + [string appendFormat:@"%@=%@&", key, [dic objectForKey:key]];
  292 + }
  293 +
  294 + [string deleteCharactersInRange:NSMakeRange(string.length-1, 1)];
  295 + return string;
  296 +}
  297 +
  298 ++ (NSString *)uuid {
  299 +
  300 + NSString *uuid = [CNLiveKeychainWrapper load:@"idfv_stat"];
  301 +
  302 + if (!uuid) {
  303 +
  304 + NSString *idfv = [[[[UIDevice currentDevice] identifierForVendor] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""];
  305 +
  306 + [CNLiveKeychainWrapper save:@"idfv_stat" data:idfv];
  307 +
  308 + return idfv;
  309 + }
  310 +
  311 +
  312 + return uuid;
  313 +}
148 314
149 @end 315 @end
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFHTTPSessionManager.h
1 // AFHTTPSessionManager.h 1 // AFHTTPSessionManager.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -20,12 +20,10 @@ @@ -20,12 +20,10 @@
20 // THE SOFTWARE. 20 // THE SOFTWARE.
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 -#if !TARGET_OS_WATCH  
24 #import <SystemConfiguration/SystemConfiguration.h> 23 #import <SystemConfiguration/SystemConfiguration.h>
25 -#endif  
26 -#import <TargetConditionals.h> 24 +#import <Availability.h>
27 25
28 -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV 26 +#if __IPHONE_OS_VERSION_MIN_REQUIRED
29 #import <MobileCoreServices/MobileCoreServices.h> 27 #import <MobileCoreServices/MobileCoreServices.h>
30 #else 28 #else
31 #import <CoreServices/CoreServices.h> 29 #import <CoreServices/CoreServices.h>
@@ -33,6 +31,14 @@ @@ -33,6 +31,14 @@
33 31
34 #import "AFURLSessionManager.h" 32 #import "AFURLSessionManager.h"
35 33
  34 +#ifndef NS_DESIGNATED_INITIALIZER
  35 +#if __has_attribute(objc_designated_initializer)
  36 +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  37 +#else
  38 +#define NS_DESIGNATED_INITIALIZER
  39 +#endif
  40 +#endif
  41 +
36 /** 42 /**
37 `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. 43 `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.
38 44
@@ -44,7 +50,7 @@ @@ -44,7 +50,7 @@
44 50
45 ## Methods to Override 51 ## Methods to Override
46 52
47 - To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`. 53 + 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:`.
48 54
49 ## Serialization 55 ## Serialization
50 56
@@ -71,14 +77,14 @@ @@ -71,14 +77,14 @@
71 @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. 77 @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.
72 */ 78 */
73 79
74 -NS_ASSUME_NONNULL_BEGIN 80 +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
75 81
76 @interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying> 82 @interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying>
77 83
78 /** 84 /**
79 - The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods. 85 + The URL used to monitor reachability, and construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods.
80 */ 86 */
81 -@property (readonly, nonatomic, strong, nullable) NSURL *baseURL; 87 +@property (readonly, nonatomic, strong) NSURL *baseURL;
82 88
83 /** 89 /**
84 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. 90 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.
@@ -94,15 +100,6 @@ NS_ASSUME_NONNULL_BEGIN @@ -94,15 +100,6 @@ NS_ASSUME_NONNULL_BEGIN
94 */ 100 */
95 @property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer; 101 @property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
96 102
97 -///-------------------------------  
98 -/// @name Managing Security Policy  
99 -///-------------------------------  
100 -  
101 -/**  
102 - The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. A security policy configured with `AFSSLPinningModePublicKey` or `AFSSLPinningModeCertificate` can only be applied on a session manager initialized with a secure base URL (i.e. https). Applying a security policy with pinning enabled on an insecure session manager throws an `Invalid Security Policy` exception.  
103 - */  
104 -@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;  
105 -  
106 ///--------------------- 103 ///---------------------
107 /// @name Initialization 104 /// @name Initialization
108 ///--------------------- 105 ///---------------------
@@ -119,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -119,7 +116,7 @@ NS_ASSUME_NONNULL_BEGIN
119 116
120 @return The newly-initialized HTTP client 117 @return The newly-initialized HTTP client
121 */ 118 */
122 -- (instancetype)initWithBaseURL:(nullable NSURL *)url; 119 +- (instancetype)initWithBaseURL:(NSURL *)url;
123 120
124 /** 121 /**
125 Initializes an `AFHTTPSessionManager` object with the specified base URL. 122 Initializes an `AFHTTPSessionManager` object with the specified base URL.
@@ -131,8 +128,8 @@ NS_ASSUME_NONNULL_BEGIN @@ -131,8 +128,8 @@ NS_ASSUME_NONNULL_BEGIN
131 128
132 @return The newly-initialized HTTP client 129 @return The newly-initialized HTTP client
133 */ 130 */
134 -- (instancetype)initWithBaseURL:(nullable NSURL *)url  
135 - sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; 131 +- (instancetype)initWithBaseURL:(NSURL *)url
  132 + sessionConfiguration:(NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
136 133
137 ///--------------------------- 134 ///---------------------------
138 /// @name Making HTTP Requests 135 /// @name Making HTTP Requests
@@ -148,28 +145,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -148,28 +145,10 @@ NS_ASSUME_NONNULL_BEGIN
148 145
149 @see -dataTaskWithRequest:completionHandler: 146 @see -dataTaskWithRequest:completionHandler:
150 */ 147 */
151 -- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString  
152 - parameters:(nullable id)parameters  
153 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
154 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;  
155 -  
156 -  
157 -/**  
158 - Creates and runs an `NSURLSessionDataTask` with a `GET` request.  
159 -  
160 - @param URLString The URL string used to create the request URL.  
161 - @param parameters The parameters to be encoded according to the client request serializer.  
162 - @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.  
163 - @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.  
164 - @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.  
165 -  
166 - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:  
167 - */  
168 -- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString  
169 - parameters:(nullable id)parameters  
170 - progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress  
171 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
172 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; 148 +- (NSURLSessionDataTask *)GET:(NSString *)URLString
  149 + parameters:(id)parameters
  150 + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
  151 + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
173 152
174 /** 153 /**
175 Creates and runs an `NSURLSessionDataTask` with a `HEAD` request. 154 Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
@@ -181,10 +160,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -181,10 +160,10 @@ NS_ASSUME_NONNULL_BEGIN
181 160
182 @see -dataTaskWithRequest:completionHandler: 161 @see -dataTaskWithRequest:completionHandler:
183 */ 162 */
184 -- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString  
185 - parameters:(nullable id)parameters  
186 - success:(nullable void (^)(NSURLSessionDataTask *task))success  
187 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; 163 +- (NSURLSessionDataTask *)HEAD:(NSString *)URLString
  164 + parameters:(id)parameters
  165 + success:(void (^)(NSURLSessionDataTask *task))success
  166 + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
188 167
189 /** 168 /**
190 Creates and runs an `NSURLSessionDataTask` with a `POST` request. 169 Creates and runs an `NSURLSessionDataTask` with a `POST` request.
@@ -196,27 +175,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -196,27 +175,10 @@ NS_ASSUME_NONNULL_BEGIN
196 175
197 @see -dataTaskWithRequest:completionHandler: 176 @see -dataTaskWithRequest:completionHandler:
198 */ 177 */
199 -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString  
200 - parameters:(nullable id)parameters  
201 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
202 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;  
203 -  
204 -/**  
205 - Creates and runs an `NSURLSessionDataTask` with a `POST` request.  
206 -  
207 - @param URLString The URL string used to create the request URL.  
208 - @param parameters The parameters to be encoded according to the client request serializer.  
209 - @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.  
210 - @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.  
211 - @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.  
212 -  
213 - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:  
214 - */  
215 -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString  
216 - parameters:(nullable id)parameters  
217 - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress  
218 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
219 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; 178 +- (NSURLSessionDataTask *)POST:(NSString *)URLString
  179 + parameters:(id)parameters
  180 + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
  181 + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
220 182
221 /** 183 /**
222 Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. 184 Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
@@ -229,30 +191,11 @@ NS_ASSUME_NONNULL_BEGIN @@ -229,30 +191,11 @@ NS_ASSUME_NONNULL_BEGIN
229 191
230 @see -dataTaskWithRequest:completionHandler: 192 @see -dataTaskWithRequest:completionHandler:
231 */ 193 */
232 -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString  
233 - parameters:(nullable id)parameters  
234 - constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block  
235 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
236 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE;  
237 -  
238 -/**  
239 - Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.  
240 -  
241 - @param URLString The URL string used to create the request URL.  
242 - @param parameters The parameters to be encoded according to the client request serializer.  
243 - @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.  
244 - @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.  
245 - @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.  
246 - @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.  
247 -  
248 - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:  
249 - */  
250 -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString  
251 - parameters:(nullable id)parameters  
252 - constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block  
253 - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress  
254 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
255 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; 194 +- (NSURLSessionDataTask *)POST:(NSString *)URLString
  195 + parameters:(id)parameters
  196 + constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
  197 + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
  198 + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
256 199
257 /** 200 /**
258 Creates and runs an `NSURLSessionDataTask` with a `PUT` request. 201 Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
@@ -264,10 +207,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -264,10 +207,10 @@ NS_ASSUME_NONNULL_BEGIN
264 207
265 @see -dataTaskWithRequest:completionHandler: 208 @see -dataTaskWithRequest:completionHandler:
266 */ 209 */
267 -- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString  
268 - parameters:(nullable id)parameters  
269 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
270 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; 210 +- (NSURLSessionDataTask *)PUT:(NSString *)URLString
  211 + parameters:(id)parameters
  212 + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
  213 + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
271 214
272 /** 215 /**
273 Creates and runs an `NSURLSessionDataTask` with a `PATCH` request. 216 Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
@@ -279,10 +222,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -279,10 +222,10 @@ NS_ASSUME_NONNULL_BEGIN
279 222
280 @see -dataTaskWithRequest:completionHandler: 223 @see -dataTaskWithRequest:completionHandler:
281 */ 224 */
282 -- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString  
283 - parameters:(nullable id)parameters  
284 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
285 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; 225 +- (NSURLSessionDataTask *)PATCH:(NSString *)URLString
  226 + parameters:(id)parameters
  227 + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
  228 + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
286 229
287 /** 230 /**
288 Creates and runs an `NSURLSessionDataTask` with a `DELETE` request. 231 Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
@@ -294,11 +237,11 @@ NS_ASSUME_NONNULL_BEGIN @@ -294,11 +237,11 @@ NS_ASSUME_NONNULL_BEGIN
294 237
295 @see -dataTaskWithRequest:completionHandler: 238 @see -dataTaskWithRequest:completionHandler:
296 */ 239 */
297 -- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString  
298 - parameters:(nullable id)parameters  
299 - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success  
300 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; 240 +- (NSURLSessionDataTask *)DELETE:(NSString *)URLString
  241 + parameters:(id)parameters
  242 + success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
  243 + failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;
301 244
302 @end 245 @end
303 246
304 -NS_ASSUME_NONNULL_END 247 +#endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFHTTPSessionManager.m
1 // AFHTTPSessionManager.m 1 // AFHTTPSessionManager.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,23 +21,24 @@ @@ -21,23 +21,24 @@
21 21
22 #import "AFHTTPSessionManager.h" 22 #import "AFHTTPSessionManager.h"
23 23
  24 +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
  25 +
24 #import "AFURLRequestSerialization.h" 26 #import "AFURLRequestSerialization.h"
25 #import "AFURLResponseSerialization.h" 27 #import "AFURLResponseSerialization.h"
26 28
27 #import <Availability.h> 29 #import <Availability.h>
28 -#import <TargetConditionals.h>  
29 #import <Security/Security.h> 30 #import <Security/Security.h>
30 31
  32 +#ifdef _SYSTEMCONFIGURATION_H
31 #import <netinet/in.h> 33 #import <netinet/in.h>
32 #import <netinet6/in6.h> 34 #import <netinet6/in6.h>
33 #import <arpa/inet.h> 35 #import <arpa/inet.h>
34 #import <ifaddrs.h> 36 #import <ifaddrs.h>
35 #import <netdb.h> 37 #import <netdb.h>
  38 +#endif
36 39
37 -#if TARGET_OS_IOS || TARGET_OS_TV 40 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
38 #import <UIKit/UIKit.h> 41 #import <UIKit/UIKit.h>
39 -#elif TARGET_OS_WATCH  
40 -#import <WatchKit/WatchKit.h>  
41 #endif 42 #endif
42 43
43 @interface AFHTTPSessionManager () 44 @interface AFHTTPSessionManager ()
@@ -86,6 +87,9 @@ @@ -86,6 +87,9 @@
86 87
87 #pragma mark - 88 #pragma mark -
88 89
  90 +#ifdef _SYSTEMCONFIGURATION_H
  91 +#endif
  92 +
89 - (void)setRequestSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer { 93 - (void)setRequestSerializer:(AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
90 NSParameterAssert(requestSerializer); 94 NSParameterAssert(requestSerializer);
91 95
@@ -98,23 +102,6 @@ @@ -98,23 +102,6 @@
98 [super setResponseSerializer:responseSerializer]; 102 [super setResponseSerializer:responseSerializer];
99 } 103 }
100 104
101 -@dynamic securityPolicy;  
102 -  
103 -- (void)setSecurityPolicy:(AFSecurityPolicy *)securityPolicy {  
104 - if (securityPolicy.SSLPinningMode != AFSSLPinningModeNone && ![self.baseURL.scheme isEqualToString:@"https"]) {  
105 - NSString *pinningMode = @"Unknown Pinning Mode";  
106 - switch (securityPolicy.SSLPinningMode) {  
107 - case AFSSLPinningModeNone: pinningMode = @"AFSSLPinningModeNone"; break;  
108 - case AFSSLPinningModeCertificate: pinningMode = @"AFSSLPinningModeCertificate"; break;  
109 - case AFSSLPinningModePublicKey: pinningMode = @"AFSSLPinningModePublicKey"; break;  
110 - }  
111 - NSString *reason = [NSString stringWithFormat:@"A security policy configured with `%@` can only be applied on a manager with a secure base URL (i.e. https)", pinningMode];  
112 - @throw [NSException exceptionWithName:@"Invalid Security Policy" reason:reason userInfo:nil];  
113 - }  
114 -  
115 - [super setSecurityPolicy:securityPolicy];  
116 -}  
117 -  
118 #pragma mark - 105 #pragma mark -
119 106
120 - (NSURLSessionDataTask *)GET:(NSString *)URLString 107 - (NSURLSessionDataTask *)GET:(NSString *)URLString
@@ -122,24 +109,7 @@ @@ -122,24 +109,7 @@
122 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success 109 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
123 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure 110 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
124 { 111 {
125 -  
126 - return [self GET:URLString parameters:parameters progress:nil success:success failure:failure];  
127 -}  
128 -  
129 -- (NSURLSessionDataTask *)GET:(NSString *)URLString  
130 - parameters:(id)parameters  
131 - progress:(void (^)(NSProgress * _Nonnull))downloadProgress  
132 - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success  
133 - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure  
134 -{  
135 -  
136 - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET"  
137 - URLString:URLString  
138 - parameters:parameters  
139 - uploadProgress:nil  
140 - downloadProgress:downloadProgress  
141 - success:success  
142 - failure:failure]; 112 + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" URLString:URLString parameters:parameters success:success failure:failure];
143 113
144 [dataTask resume]; 114 [dataTask resume];
145 115
@@ -151,7 +121,7 @@ @@ -151,7 +121,7 @@
151 success:(void (^)(NSURLSessionDataTask *task))success 121 success:(void (^)(NSURLSessionDataTask *task))success
152 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure 122 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
153 { 123 {
154 - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) { 124 + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters success:^(NSURLSessionDataTask *task, __unused id responseObject) {
155 if (success) { 125 if (success) {
156 success(task); 126 success(task);
157 } 127 }
@@ -167,16 +137,7 @@ @@ -167,16 +137,7 @@
167 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success 137 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
168 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure 138 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
169 { 139 {
170 - return [self POST:URLString parameters:parameters progress:nil success:success failure:failure];  
171 -}  
172 -  
173 -- (NSURLSessionDataTask *)POST:(NSString *)URLString  
174 - parameters:(id)parameters  
175 - progress:(void (^)(NSProgress * _Nonnull))uploadProgress  
176 - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success  
177 - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure  
178 -{  
179 - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters uploadProgress:uploadProgress downloadProgress:nil success:success failure:failure]; 140 + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"POST" URLString:URLString parameters:parameters success:success failure:failure];
180 141
181 [dataTask resume]; 142 [dataTask resume];
182 143
@@ -184,18 +145,8 @@ @@ -184,18 +145,8 @@
184 } 145 }
185 146
186 - (NSURLSessionDataTask *)POST:(NSString *)URLString 147 - (NSURLSessionDataTask *)POST:(NSString *)URLString
187 - parameters:(nullable id)parameters  
188 - constructingBodyWithBlock:(nullable void (^)(id<AFMultipartFormData> _Nonnull))block  
189 - success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success  
190 - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure  
191 -{  
192 - return [self POST:URLString parameters:parameters constructingBodyWithBlock:block progress:nil success:success failure:failure];  
193 -}  
194 -  
195 -- (NSURLSessionDataTask *)POST:(NSString *)URLString  
196 parameters:(id)parameters 148 parameters:(id)parameters
197 constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block 149 constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
198 - progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress  
199 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success 150 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
200 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure 151 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
201 { 152 {
@@ -203,15 +154,18 @@ @@ -203,15 +154,18 @@
203 NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError]; 154 NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError];
204 if (serializationError) { 155 if (serializationError) {
205 if (failure) { 156 if (failure) {
  157 +#pragma clang diagnostic push
  158 +#pragma clang diagnostic ignored "-Wgnu"
206 dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ 159 dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
207 failure(nil, serializationError); 160 failure(nil, serializationError);
208 }); 161 });
  162 +#pragma clang diagnostic pop
209 } 163 }
210 164
211 return nil; 165 return nil;
212 } 166 }
213 167
214 - __block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:uploadProgress completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { 168 + __block NSURLSessionDataTask *task = [self uploadTaskWithStreamedRequest:request progress:nil completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
215 if (error) { 169 if (error) {
216 if (failure) { 170 if (failure) {
217 failure(task, error); 171 failure(task, error);
@@ -233,7 +187,7 @@ @@ -233,7 +187,7 @@
233 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success 187 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
234 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure 188 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
235 { 189 {
236 - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; 190 + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters success:success failure:failure];
237 191
238 [dataTask resume]; 192 [dataTask resume];
239 193
@@ -245,7 +199,7 @@ @@ -245,7 +199,7 @@
245 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success 199 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
246 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure 200 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
247 { 201 {
248 - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; 202 + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters success:success failure:failure];
249 203
250 [dataTask resume]; 204 [dataTask resume];
251 205
@@ -257,7 +211,7 @@ @@ -257,7 +211,7 @@
257 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success 211 success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
258 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure 212 failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure
259 { 213 {
260 - NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters uploadProgress:nil downloadProgress:nil success:success failure:failure]; 214 + NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters success:success failure:failure];
261 215
262 [dataTask resume]; 216 [dataTask resume];
263 217
@@ -267,8 +221,6 @@ @@ -267,8 +221,6 @@
267 - (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method 221 - (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method
268 URLString:(NSString *)URLString 222 URLString:(NSString *)URLString
269 parameters:(id)parameters 223 parameters:(id)parameters
270 - uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress  
271 - downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress  
272 success:(void (^)(NSURLSessionDataTask *, id))success 224 success:(void (^)(NSURLSessionDataTask *, id))success
273 failure:(void (^)(NSURLSessionDataTask *, NSError *))failure 225 failure:(void (^)(NSURLSessionDataTask *, NSError *))failure
274 { 226 {
@@ -276,19 +228,19 @@ @@ -276,19 +228,19 @@
276 NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError]; 228 NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError];
277 if (serializationError) { 229 if (serializationError) {
278 if (failure) { 230 if (failure) {
  231 +#pragma clang diagnostic push
  232 +#pragma clang diagnostic ignored "-Wgnu"
279 dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{ 233 dispatch_async(self.completionQueue ?: dispatch_get_main_queue(), ^{
280 failure(nil, serializationError); 234 failure(nil, serializationError);
281 }); 235 });
  236 +#pragma clang diagnostic pop
282 } 237 }
283 238
284 return nil; 239 return nil;
285 } 240 }
286 241
287 __block NSURLSessionDataTask *dataTask = nil; 242 __block NSURLSessionDataTask *dataTask = nil;
288 - dataTask = [self dataTaskWithRequest:request  
289 - uploadProgress:uploadProgress  
290 - downloadProgress:downloadProgress  
291 - completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) { 243 + dataTask = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
292 if (error) { 244 if (error) {
293 if (failure) { 245 if (failure) {
294 failure(dataTask, error); 246 failure(dataTask, error);
@@ -315,7 +267,7 @@ @@ -315,7 +267,7 @@
315 return YES; 267 return YES;
316 } 268 }
317 269
318 -- (instancetype)initWithCoder:(NSCoder *)decoder { 270 +- (id)initWithCoder:(NSCoder *)decoder {
319 NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))]; 271 NSURL *baseURL = [decoder decodeObjectOfClass:[NSURL class] forKey:NSStringFromSelector(@selector(baseURL))];
320 NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; 272 NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"];
321 if (!configuration) { 273 if (!configuration) {
@@ -336,10 +288,6 @@ @@ -336,10 +288,6 @@
336 288
337 self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))]; 289 self.requestSerializer = [decoder decodeObjectOfClass:[AFHTTPRequestSerializer class] forKey:NSStringFromSelector(@selector(requestSerializer))];
338 self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))]; 290 self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))];
339 - AFSecurityPolicy *decodedPolicy = [decoder decodeObjectOfClass:[AFSecurityPolicy class] forKey:NSStringFromSelector(@selector(securityPolicy))];  
340 - if (decodedPolicy) {  
341 - self.securityPolicy = decodedPolicy;  
342 - }  
343 291
344 return self; 292 return self;
345 } 293 }
@@ -355,18 +303,19 @@ @@ -355,18 +303,19 @@
355 } 303 }
356 [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))]; 304 [coder encodeObject:self.requestSerializer forKey:NSStringFromSelector(@selector(requestSerializer))];
357 [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))]; 305 [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))];
358 - [coder encodeObject:self.securityPolicy forKey:NSStringFromSelector(@selector(securityPolicy))];  
359 } 306 }
360 307
361 #pragma mark - NSCopying 308 #pragma mark - NSCopying
362 309
363 -- (instancetype)copyWithZone:(NSZone *)zone { 310 +- (id)copyWithZone:(NSZone *)zone {
364 AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration]; 311 AFHTTPSessionManager *HTTPClient = [[[self class] allocWithZone:zone] initWithBaseURL:self.baseURL sessionConfiguration:self.session.configuration];
365 312
366 HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone]; 313 HTTPClient.requestSerializer = [self.requestSerializer copyWithZone:zone];
367 HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone]; 314 HTTPClient.responseSerializer = [self.responseSerializer copyWithZone:zone];
368 - HTTPClient.securityPolicy = [self.securityPolicy copyWithZone:zone]; 315 +
369 return HTTPClient; 316 return HTTPClient;
370 } 317 }
371 318
372 @end 319 @end
  320 +
  321 +#endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFNetworkReachabilityManager.h
1 // AFNetworkReachabilityManager.h 1 // AFNetworkReachabilityManager.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -20,10 +20,16 @@ @@ -20,10 +20,16 @@
20 // THE SOFTWARE. 20 // THE SOFTWARE.
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 -  
24 -#if !TARGET_OS_WATCH  
25 #import <SystemConfiguration/SystemConfiguration.h> 23 #import <SystemConfiguration/SystemConfiguration.h>
26 24
  25 +#ifndef NS_DESIGNATED_INITIALIZER
  26 +#if __has_attribute(objc_designated_initializer)
  27 +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  28 +#else
  29 +#define NS_DESIGNATED_INITIALIZER
  30 +#endif
  31 +#endif
  32 +
27 typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) { 33 typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
28 AFNetworkReachabilityStatusUnknown = -1, 34 AFNetworkReachabilityStatusUnknown = -1,
29 AFNetworkReachabilityStatusNotReachable = 0, 35 AFNetworkReachabilityStatusNotReachable = 0,
@@ -31,14 +37,12 @@ typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) { @@ -31,14 +37,12 @@ typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
31 AFNetworkReachabilityStatusReachableViaWiFi = 2, 37 AFNetworkReachabilityStatusReachableViaWiFi = 2,
32 }; 38 };
33 39
34 -NS_ASSUME_NONNULL_BEGIN  
35 -  
36 /** 40 /**
37 `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. 41 `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
38 42
39 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. 43 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.
40 44
41 - See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ ) 45 + See Apple's Reachability Sample Code (https://developer.apple.com/library/ios/samplecode/reachability/)
42 46
43 @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined. 47 @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
44 */ 48 */
@@ -74,13 +78,6 @@ NS_ASSUME_NONNULL_BEGIN @@ -74,13 +78,6 @@ NS_ASSUME_NONNULL_BEGIN
74 + (instancetype)sharedManager; 78 + (instancetype)sharedManager;
75 79
76 /** 80 /**
77 - Creates and returns a network reachability manager with the default socket address.  
78 -  
79 - @return An initialized network reachability manager, actively monitoring the default socket address.  
80 - */  
81 -+ (instancetype)manager;  
82 -  
83 -/**  
84 Creates and returns a network reachability manager for the specified domain. 81 Creates and returns a network reachability manager for the specified domain.
85 82
86 @param domain The domain used to evaluate network reachability. 83 @param domain The domain used to evaluate network reachability.
@@ -92,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -92,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN
92 /** 89 /**
93 Creates and returns a network reachability manager for the socket address. 90 Creates and returns a network reachability manager for the socket address.
94 91
95 - @param address The socket address (`sockaddr_in6`) used to evaluate network reachability. 92 + @param address The socket address (`sockaddr_in`) used to evaluate network reachability.
96 93
97 @return An initialized network reachability manager, actively monitoring the specified socket address. 94 @return An initialized network reachability manager, actively monitoring the specified socket address.
98 */ 95 */
@@ -107,13 +104,6 @@ NS_ASSUME_NONNULL_BEGIN @@ -107,13 +104,6 @@ NS_ASSUME_NONNULL_BEGIN
107 */ 104 */
108 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER; 105 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
109 106
110 -/**  
111 - * Initializes an instance of a network reachability manager  
112 - *  
113 - * @return nil as this method is unavailable  
114 - */  
115 -- (nullable instancetype)init NS_UNAVAILABLE;  
116 -  
117 ///-------------------------------------------------- 107 ///--------------------------------------------------
118 /// @name Starting & Stopping Reachability Monitoring 108 /// @name Starting & Stopping Reachability Monitoring
119 ///-------------------------------------------------- 109 ///--------------------------------------------------
@@ -146,7 +136,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -146,7 +136,7 @@ NS_ASSUME_NONNULL_BEGIN
146 136
147 @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`. 137 @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`.
148 */ 138 */
149 -- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block; 139 +- (void)setReachabilityStatusChangeBlock:(void (^)(AFNetworkReachabilityStatus status))block;
150 140
151 @end 141 @end
152 142
@@ -197,8 +187,8 @@ NS_ASSUME_NONNULL_BEGIN @@ -197,8 +187,8 @@ NS_ASSUME_NONNULL_BEGIN
197 187
198 @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`). 188 @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`).
199 */ 189 */
200 -FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification;  
201 -FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem; 190 +extern NSString * const AFNetworkingReachabilityDidChangeNotification;
  191 +extern NSString * const AFNetworkingReachabilityNotificationStatusItem;
202 192
203 ///-------------------- 193 ///--------------------
204 /// @name Functions 194 /// @name Functions
@@ -207,7 +197,4 @@ FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusIte @@ -207,7 +197,4 @@ FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusIte
207 /** 197 /**
208 Returns a localized string representation of an `AFNetworkReachabilityStatus` value. 198 Returns a localized string representation of an `AFNetworkReachabilityStatus` value.
209 */ 199 */
210 -FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);  
211 -  
212 -NS_ASSUME_NONNULL_END  
213 -#endif 200 +extern NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFNetworkReachabilityManager.m
1 // AFNetworkReachabilityManager.m 1 // AFNetworkReachabilityManager.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -20,7 +20,6 @@ @@ -20,7 +20,6 @@
20 // THE SOFTWARE. 20 // THE SOFTWARE.
21 21
22 #import "AFNetworkReachabilityManager.h" 22 #import "AFNetworkReachabilityManager.h"
23 -#if !TARGET_OS_WATCH  
24 23
25 #import <netinet/in.h> 24 #import <netinet/in.h>
26 #import <netinet6/in6.h> 25 #import <netinet6/in6.h>
@@ -33,6 +32,12 @@ NSString * const AFNetworkingReachabilityNotificationStatusItem = @&quot;AFNetworking @@ -33,6 +32,12 @@ NSString * const AFNetworkingReachabilityNotificationStatusItem = @&quot;AFNetworking
33 32
34 typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status); 33 typedef void (^AFNetworkReachabilityStatusBlock)(AFNetworkReachabilityStatus status);
35 34
  35 +typedef NS_ENUM(NSUInteger, AFNetworkReachabilityAssociation) {
  36 + AFNetworkReachabilityForAddress = 1,
  37 + AFNetworkReachabilityForAddressPair = 2,
  38 + AFNetworkReachabilityForName = 3,
  39 +};
  40 +
36 NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) { 41 NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status) {
37 switch (status) { 42 switch (status) {
38 case AFNetworkReachabilityStatusNotReachable: 43 case AFNetworkReachabilityStatusNotReachable:
@@ -70,31 +75,22 @@ static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetwork @@ -70,31 +75,22 @@ static AFNetworkReachabilityStatus AFNetworkReachabilityStatusForFlags(SCNetwork
70 return status; 75 return status;
71 } 76 }
72 77
73 -/**  
74 - * Queue a status change notification for the main thread.  
75 - *  
76 - * This is done to ensure that the notifications are received in the same order  
77 - * as they are sent. If notifications are sent directly, it is possible that  
78 - * a queued notification (for an earlier status condition) is processed after  
79 - * the later update, resulting in the listener being left in the wrong state.  
80 - */  
81 -static void AFPostReachabilityStatusChange(SCNetworkReachabilityFlags flags, AFNetworkReachabilityStatusBlock block) { 78 +static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
82 AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags); 79 AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
  80 + AFNetworkReachabilityStatusBlock block = (__bridge AFNetworkReachabilityStatusBlock)info;
  81 + if (block) {
  82 + block(status);
  83 + }
  84 +
  85 +
83 dispatch_async(dispatch_get_main_queue(), ^{ 86 dispatch_async(dispatch_get_main_queue(), ^{
84 - if (block) {  
85 - block(status);  
86 - }  
87 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 87 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
88 NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) }; 88 NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) };
89 [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo]; 89 [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:userInfo];
90 }); 90 });
91 -}  
92 91
93 -static void AFNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {  
94 - AFPostReachabilityStatusChange(flags, (__bridge AFNetworkReachabilityStatusBlock)info);  
95 } 92 }
96 93
97 -  
98 static const void * AFNetworkReachabilityRetainCallback(const void *info) { 94 static const void * AFNetworkReachabilityRetainCallback(const void *info) {
99 return Block_copy(info); 95 return Block_copy(info);
100 } 96 }
@@ -106,7 +102,8 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { @@ -106,7 +102,8 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
106 } 102 }
107 103
108 @interface AFNetworkReachabilityManager () 104 @interface AFNetworkReachabilityManager ()
109 -@property (readonly, nonatomic, assign) SCNetworkReachabilityRef networkReachability; 105 +@property (readwrite, nonatomic, assign) SCNetworkReachabilityRef networkReachability;
  106 +@property (readwrite, nonatomic, assign) AFNetworkReachabilityAssociation networkReachabilityAssociation;
110 @property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; 107 @property (readwrite, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
111 @property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock; 108 @property (readwrite, nonatomic, copy) AFNetworkReachabilityStatusBlock networkReachabilityStatusBlock;
112 @end 109 @end
@@ -117,7 +114,12 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { @@ -117,7 +114,12 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
117 static AFNetworkReachabilityManager *_sharedManager = nil; 114 static AFNetworkReachabilityManager *_sharedManager = nil;
118 static dispatch_once_t onceToken; 115 static dispatch_once_t onceToken;
119 dispatch_once(&onceToken, ^{ 116 dispatch_once(&onceToken, ^{
120 - _sharedManager = [self manager]; 117 + struct sockaddr_in address;
  118 + bzero(&address, sizeof(address));
  119 + address.sin_len = sizeof(address);
  120 + address.sin_family = AF_INET;
  121 +
  122 + _sharedManager = [self managerForAddress:&address];
121 }); 123 });
122 124
123 return _sharedManager; 125 return _sharedManager;
@@ -127,59 +129,38 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { @@ -127,59 +129,38 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
127 SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]); 129 SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, [domain UTF8String]);
128 130
129 AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; 131 AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
130 -  
131 - CFRelease(reachability); 132 + manager.networkReachabilityAssociation = AFNetworkReachabilityForName;
132 133
133 return manager; 134 return manager;
134 } 135 }
135 136
136 + (instancetype)managerForAddress:(const void *)address { 137 + (instancetype)managerForAddress:(const void *)address {
137 SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address); 138 SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)address);
  139 +
138 AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability]; 140 AFNetworkReachabilityManager *manager = [[self alloc] initWithReachability:reachability];
  141 + manager.networkReachabilityAssociation = AFNetworkReachabilityForAddress;
139 142
140 - CFRelease(reachability);  
141 -  
142 return manager; 143 return manager;
143 } 144 }
144 145
145 -+ (instancetype)manager  
146 -{  
147 -#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)  
148 - struct sockaddr_in6 address;  
149 - bzero(&address, sizeof(address));  
150 - address.sin6_len = sizeof(address);  
151 - address.sin6_family = AF_INET6;  
152 -#else  
153 - struct sockaddr_in address;  
154 - bzero(&address, sizeof(address));  
155 - address.sin_len = sizeof(address);  
156 - address.sin_family = AF_INET;  
157 -#endif  
158 - return [self managerForAddress:&address];  
159 -}  
160 -  
161 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability { 146 - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability {
162 self = [super init]; 147 self = [super init];
163 if (!self) { 148 if (!self) {
164 return nil; 149 return nil;
165 } 150 }
166 151
167 - _networkReachability = CFRetain(reachability); 152 + self.networkReachability = reachability;
168 self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown; 153 self.networkReachabilityStatus = AFNetworkReachabilityStatusUnknown;
169 154
170 return self; 155 return self;
171 } 156 }
172 157
173 -- (instancetype)init NS_UNAVAILABLE  
174 -{  
175 - return nil;  
176 -}  
177 -  
178 - (void)dealloc { 158 - (void)dealloc {
179 [self stopMonitoring]; 159 [self stopMonitoring];
180 -  
181 - if (_networkReachability != NULL) { 160 +
  161 + if (_networkReachability) {
182 CFRelease(_networkReachability); 162 CFRelease(_networkReachability);
  163 + _networkReachability = NULL;
183 } 164 }
184 } 165 }
185 166
@@ -221,12 +202,28 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { @@ -221,12 +202,28 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
221 SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context); 202 SCNetworkReachabilitySetCallback(self.networkReachability, AFNetworkReachabilityCallback, &context);
222 SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes); 203 SCNetworkReachabilityScheduleWithRunLoop(self.networkReachability, CFRunLoopGetMain(), kCFRunLoopCommonModes);
223 204
224 - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{  
225 - SCNetworkReachabilityFlags flags;  
226 - if (SCNetworkReachabilityGetFlags(self.networkReachability, &flags)) {  
227 - AFPostReachabilityStatusChange(flags, callback); 205 + switch (self.networkReachabilityAssociation) {
  206 + case AFNetworkReachabilityForName:
  207 + break;
  208 + case AFNetworkReachabilityForAddress:
  209 + case AFNetworkReachabilityForAddressPair:
  210 + default: {
  211 + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0),^{
  212 + SCNetworkReachabilityFlags flags;
  213 + SCNetworkReachabilityGetFlags(self.networkReachability, &flags);
  214 + AFNetworkReachabilityStatus status = AFNetworkReachabilityStatusForFlags(flags);
  215 + dispatch_async(dispatch_get_main_queue(), ^{
  216 + callback(status);
  217 +
  218 + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
  219 + [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:nil userInfo:@{ AFNetworkingReachabilityNotificationStatusItem: @(status) }];
  220 +
  221 +
  222 + });
  223 + });
228 } 224 }
229 - }); 225 + break;
  226 + }
230 } 227 }
231 228
232 - (void)stopMonitoring { 229 - (void)stopMonitoring {
@@ -260,4 +257,3 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) { @@ -260,4 +257,3 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
260 } 257 }
261 258
262 @end 259 @end
263 -#endif  
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFNetworking.h
@@ -22,7 +22,6 @@ @@ -22,7 +22,6 @@
22 22
23 #import <Foundation/Foundation.h> 23 #import <Foundation/Foundation.h>
24 #import <Availability.h> 24 #import <Availability.h>
25 -#import <TargetConditionals.h>  
26 25
27 #ifndef _AFNETWORKING_ 26 #ifndef _AFNETWORKING_
28 #define _AFNETWORKING_ 27 #define _AFNETWORKING_
@@ -30,12 +29,16 @@ @@ -30,12 +29,16 @@
30 #import "AFURLRequestSerialization.h" 29 #import "AFURLRequestSerialization.h"
31 #import "AFURLResponseSerialization.h" 30 #import "AFURLResponseSerialization.h"
32 #import "AFSecurityPolicy.h" 31 #import "AFSecurityPolicy.h"
33 -  
34 -#if !TARGET_OS_WATCH  
35 #import "AFNetworkReachabilityManager.h" 32 #import "AFNetworkReachabilityManager.h"
36 -#endif  
37 33
  34 + #import "AFURLConnectionOperation.h"
  35 + #import "AFHTTPRequestOperation.h"
  36 + #import "AFHTTPRequestOperationManager.h"
  37 +
  38 +#if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \
  39 + ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) )
38 #import "AFURLSessionManager.h" 40 #import "AFURLSessionManager.h"
39 #import "AFHTTPSessionManager.h" 41 #import "AFHTTPSessionManager.h"
  42 +#endif
40 43
41 #endif /* _AFNETWORKING_ */ 44 #endif /* _AFNETWORKING_ */
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFSecurityPolicy.h
1 // AFSecurityPolicy.h 1 // AFSecurityPolicy.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -33,10 +33,7 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { @@ -33,10 +33,7 @@ typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
33 33
34 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. 34 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.
35 */ 35 */
36 -  
37 -NS_ASSUME_NONNULL_BEGIN  
38 -  
39 -@interface AFSecurityPolicy : NSObject <NSSecureCoding, NSCopying> 36 +@interface AFSecurityPolicy : NSObject
40 37
41 /** 38 /**
42 The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 39 The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
@@ -44,13 +41,14 @@ NS_ASSUME_NONNULL_BEGIN @@ -44,13 +41,14 @@ NS_ASSUME_NONNULL_BEGIN
44 @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 41 @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
45 42
46 /** 43 /**
47 - The certificates used to evaluate server trust according to the SSL pinning mode. 44 + Whether to evaluate an entire SSL certificate chain, or just the leaf certificate. Defaults to `YES`.
  45 + */
  46 +@property (nonatomic, assign) BOOL validatesCertificateChain;
48 47
49 - 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`.  
50 -  
51 - Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. 48 +/**
  49 + 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 app bundle.
52 */ 50 */
53 -@property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates; 51 +@property (nonatomic, strong) NSArray *pinnedCertificates;
54 52
55 /** 53 /**
56 Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 54 Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
@@ -63,17 +61,6 @@ NS_ASSUME_NONNULL_BEGIN @@ -63,17 +61,6 @@ NS_ASSUME_NONNULL_BEGIN
63 @property (nonatomic, assign) BOOL validatesDomainName; 61 @property (nonatomic, assign) BOOL validatesDomainName;
64 62
65 ///----------------------------------------- 63 ///-----------------------------------------
66 -/// @name Getting Certificates from the Bundle  
67 -///-----------------------------------------  
68 -  
69 -/**  
70 - 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`.  
71 -  
72 - @return The certificates included in the given bundle.  
73 - */  
74 -+ (NSSet <NSData *> *)certificatesInBundle:(NSBundle *)bundle;  
75 -  
76 -///-----------------------------------------  
77 /// @name Getting Specific Security Policies 64 /// @name Getting Specific Security Policies
78 ///----------------------------------------- 65 ///-----------------------------------------
79 66
@@ -97,19 +84,22 @@ NS_ASSUME_NONNULL_BEGIN @@ -97,19 +84,22 @@ NS_ASSUME_NONNULL_BEGIN
97 */ 84 */
98 + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 85 + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
99 86
  87 +///------------------------------
  88 +/// @name Evaluating Server Trust
  89 +///------------------------------
  90 +
100 /** 91 /**
101 - Creates and returns a security policy with the specified pinning mode. 92 + Whether or not the specified server trust should be accepted, based on the security policy.
102 93
103 - @param pinningMode The SSL pinning mode.  
104 - @param pinnedCertificates The certificates to pin against. 94 + This method should be used when responding to an authentication challenge from a server.
105 95
106 - @return A new security policy.  
107 - */  
108 -+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates; 96 + @param serverTrust The X.509 certificate trust of the server.
109 97
110 -///------------------------------  
111 -/// @name Evaluating Server Trust  
112 -///------------------------------ 98 + @return Whether or not to trust the server.
  99 +
  100 + @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`.
  101 + */
  102 +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE;
113 103
114 /** 104 /**
115 Whether or not the specified server trust should be accepted, based on the security policy. 105 Whether or not the specified server trust should be accepted, based on the security policy.
@@ -122,12 +112,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -122,12 +112,10 @@ NS_ASSUME_NONNULL_BEGIN
122 @return Whether or not to trust the server. 112 @return Whether or not to trust the server.
123 */ 113 */
124 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 114 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
125 - forDomain:(nullable NSString *)domain; 115 + forDomain:(NSString *)domain;
126 116
127 @end 117 @end
128 118
129 -NS_ASSUME_NONNULL_END  
130 -  
131 ///---------------- 119 ///----------------
132 /// @name Constants 120 /// @name Constants
133 ///---------------- 121 ///----------------
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFSecurityPolicy.m
1 // AFSecurityPolicy.m 1 // AFSecurityPolicy.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 23
24 #import <AssertMacros.h> 24 #import <AssertMacros.h>
25 25
26 -#if !TARGET_OS_IOS && !TARGET_OS_WATCH && !TARGET_OS_TV 26 +#if !defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 static NSData * AFSecKeyGetData(SecKeyRef key) { 27 static NSData * AFSecKeyGetData(SecKeyRef key) {
28 CFDataRef data = NULL; 28 CFDataRef data = NULL;
29 29
@@ -41,7 +41,7 @@ _out: @@ -41,7 +41,7 @@ _out:
41 #endif 41 #endif
42 42
43 static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) { 43 static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
44 -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV 44 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
45 return [(__bridge id)key1 isEqual:(__bridge id)key2]; 45 return [(__bridge id)key1 isEqual:(__bridge id)key2];
46 #else 46 #else
47 return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)]; 47 return [AFSecKeyGetData(key1) isEqual:AFSecKeyGetData(key2)];
@@ -51,6 +51,8 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) { @@ -51,6 +51,8 @@ static BOOL AFSecKeyIsEqualToKey(SecKeyRef key1, SecKeyRef key2) {
51 static id AFPublicKeyForCertificate(NSData *certificate) { 51 static id AFPublicKeyForCertificate(NSData *certificate) {
52 id allowedPublicKey = nil; 52 id allowedPublicKey = nil;
53 SecCertificateRef allowedCertificate; 53 SecCertificateRef allowedCertificate;
  54 + SecCertificateRef allowedCertificates[1];
  55 + CFArrayRef tempCertificates = nil;
54 SecPolicyRef policy = nil; 56 SecPolicyRef policy = nil;
55 SecTrustRef allowedTrust = nil; 57 SecTrustRef allowedTrust = nil;
56 SecTrustResultType result; 58 SecTrustResultType result;
@@ -58,8 +60,11 @@ static id AFPublicKeyForCertificate(NSData *certificate) { @@ -58,8 +60,11 @@ static id AFPublicKeyForCertificate(NSData *certificate) {
58 allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate); 60 allowedCertificate = SecCertificateCreateWithData(NULL, (__bridge CFDataRef)certificate);
59 __Require_Quiet(allowedCertificate != NULL, _out); 61 __Require_Quiet(allowedCertificate != NULL, _out);
60 62
  63 + allowedCertificates[0] = allowedCertificate;
  64 + tempCertificates = CFArrayCreate(NULL, (const void **)allowedCertificates, 1, NULL);
  65 +
61 policy = SecPolicyCreateBasicX509(); 66 policy = SecPolicyCreateBasicX509();
62 - __Require_noErr_Quiet(SecTrustCreateWithCertificates(allowedCertificate, policy, &allowedTrust), _out); 67 + __Require_noErr_Quiet(SecTrustCreateWithCertificates(tempCertificates, policy, &allowedTrust), _out);
63 __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out); 68 __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out);
64 69
65 allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust); 70 allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust);
@@ -73,6 +78,10 @@ _out: @@ -73,6 +78,10 @@ _out:
73 CFRelease(policy); 78 CFRelease(policy);
74 } 79 }
75 80
  81 + if (tempCertificates) {
  82 + CFRelease(tempCertificates);
  83 + }
  84 +
76 if (allowedCertificate) { 85 if (allowedCertificate) {
77 CFRelease(allowedCertificate); 86 CFRelease(allowedCertificate);
78 } 87 }
@@ -141,29 +150,25 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -141,29 +150,25 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
141 150
142 @interface AFSecurityPolicy() 151 @interface AFSecurityPolicy()
143 @property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 152 @property (readwrite, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
144 -@property (readwrite, nonatomic, strong) NSSet *pinnedPublicKeys; 153 +@property (readwrite, nonatomic, strong) NSArray *pinnedPublicKeys;
145 @end 154 @end
146 155
147 @implementation AFSecurityPolicy 156 @implementation AFSecurityPolicy
148 157
149 -+ (NSSet *)certificatesInBundle:(NSBundle *)bundle {  
150 - NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."];  
151 -  
152 - NSMutableSet *certificates = [NSMutableSet setWithCapacity:[paths count]];  
153 - for (NSString *path in paths) {  
154 - NSData *certificateData = [NSData dataWithContentsOfFile:path];  
155 - [certificates addObject:certificateData];  
156 - }  
157 -  
158 - return [NSSet setWithSet:certificates];  
159 -}  
160 -  
161 -+ (NSSet *)defaultPinnedCertificates {  
162 - static NSSet *_defaultPinnedCertificates = nil; 158 ++ (NSArray *)defaultPinnedCertificates {
  159 + static NSArray *_defaultPinnedCertificates = nil;
163 static dispatch_once_t onceToken; 160 static dispatch_once_t onceToken;
164 dispatch_once(&onceToken, ^{ 161 dispatch_once(&onceToken, ^{
165 NSBundle *bundle = [NSBundle bundleForClass:[self class]]; 162 NSBundle *bundle = [NSBundle bundleForClass:[self class]];
166 - _defaultPinnedCertificates = [self certificatesInBundle:bundle]; 163 + NSArray *paths = [bundle pathsForResourcesOfType:@"cer" inDirectory:@"."];
  164 +
  165 + NSMutableArray *certificates = [NSMutableArray arrayWithCapacity:[paths count]];
  166 + for (NSString *path in paths) {
  167 + NSData *certificateData = [NSData dataWithContentsOfFile:path];
  168 + [certificates addObject:certificateData];
  169 + }
  170 +
  171 + _defaultPinnedCertificates = [[NSArray alloc] initWithArray:certificates];
167 }); 172 });
168 173
169 return _defaultPinnedCertificates; 174 return _defaultPinnedCertificates;
@@ -177,34 +182,31 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -177,34 +182,31 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
177 } 182 }
178 183
179 + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode { 184 + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode {
180 - return [self policyWithPinningMode:pinningMode withPinnedCertificates:[self defaultPinnedCertificates]];  
181 -}  
182 -  
183 -+ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates {  
184 AFSecurityPolicy *securityPolicy = [[self alloc] init]; 185 AFSecurityPolicy *securityPolicy = [[self alloc] init];
185 securityPolicy.SSLPinningMode = pinningMode; 186 securityPolicy.SSLPinningMode = pinningMode;
186 187
187 - [securityPolicy setPinnedCertificates:pinnedCertificates]; 188 + [securityPolicy setPinnedCertificates:[self defaultPinnedCertificates]];
188 189
189 return securityPolicy; 190 return securityPolicy;
190 } 191 }
191 192
192 -- (instancetype)init { 193 +- (id)init {
193 self = [super init]; 194 self = [super init];
194 if (!self) { 195 if (!self) {
195 return nil; 196 return nil;
196 } 197 }
197 198
  199 + self.validatesCertificateChain = YES;
198 self.validatesDomainName = YES; 200 self.validatesDomainName = YES;
199 201
200 return self; 202 return self;
201 } 203 }
202 204
203 -- (void)setPinnedCertificates:(NSSet *)pinnedCertificates { 205 +- (void)setPinnedCertificates:(NSArray *)pinnedCertificates {
204 _pinnedCertificates = pinnedCertificates; 206 _pinnedCertificates = pinnedCertificates;
205 207
206 if (self.pinnedCertificates) { 208 if (self.pinnedCertificates) {
207 - NSMutableSet *mutablePinnedPublicKeys = [NSMutableSet setWithCapacity:[self.pinnedCertificates count]]; 209 + NSMutableArray *mutablePinnedPublicKeys = [NSMutableArray arrayWithCapacity:[self.pinnedCertificates count]];
208 for (NSData *certificate in self.pinnedCertificates) { 210 for (NSData *certificate in self.pinnedCertificates) {
209 id publicKey = AFPublicKeyForCertificate(certificate); 211 id publicKey = AFPublicKeyForCertificate(certificate);
210 if (!publicKey) { 212 if (!publicKey) {
@@ -212,7 +214,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -212,7 +214,7 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
212 } 214 }
213 [mutablePinnedPublicKeys addObject:publicKey]; 215 [mutablePinnedPublicKeys addObject:publicKey];
214 } 216 }
215 - self.pinnedPublicKeys = [NSSet setWithSet:mutablePinnedPublicKeys]; 217 + self.pinnedPublicKeys = [NSArray arrayWithArray:mutablePinnedPublicKeys];
216 } else { 218 } else {
217 self.pinnedPublicKeys = nil; 219 self.pinnedPublicKeys = nil;
218 } 220 }
@@ -220,22 +222,13 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -220,22 +222,13 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
220 222
221 #pragma mark - 223 #pragma mark -
222 224
  225 +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust {
  226 + return [self evaluateServerTrust:serverTrust forDomain:nil];
  227 +}
  228 +
223 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 229 - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
224 forDomain:(NSString *)domain 230 forDomain:(NSString *)domain
225 { 231 {
226 - if (domain && self.allowInvalidCertificates && self.validatesDomainName && (self.SSLPinningMode == AFSSLPinningModeNone || [self.pinnedCertificates count] == 0)) {  
227 - // https://developer.apple.com/library/mac/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/OverridingSSLChainValidationCorrectly.html  
228 - // According to the docs, you should only trust your provided certs for evaluation.  
229 - // Pinned certificates are added to the trust. Without pinned certificates,  
230 - // there is nothing to evaluate against.  
231 - //  
232 - // From Apple Docs:  
233 - // "Do not implicitly trust self-signed certificates as anchors (kSecTrustOptionImplicitAnchors).  
234 - // Instead, add your own (self-signed) CA certificate to the list of trusted anchors."  
235 - NSLog(@"In order to validate a domain name for self signed certificates, you MUST use pinning.");  
236 - return NO;  
237 - }  
238 -  
239 NSMutableArray *policies = [NSMutableArray array]; 232 NSMutableArray *policies = [NSMutableArray array];
240 if (self.validatesDomainName) { 233 if (self.validatesDomainName) {
241 [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)]; 234 [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)];
@@ -246,11 +239,16 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -246,11 +239,16 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
246 SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies); 239 SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies);
247 240
248 if (self.SSLPinningMode == AFSSLPinningModeNone) { 241 if (self.SSLPinningMode == AFSSLPinningModeNone) {
249 - return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust); 242 + if (self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust)){
  243 + return YES;
  244 + } else {
  245 + return NO;
  246 + }
250 } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) { 247 } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) {
251 return NO; 248 return NO;
252 } 249 }
253 250
  251 + NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);
254 switch (self.SSLPinningMode) { 252 switch (self.SSLPinningMode) {
255 case AFSSLPinningModeNone: 253 case AFSSLPinningModeNone:
256 default: 254 default:
@@ -266,20 +264,25 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -266,20 +264,25 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
266 return NO; 264 return NO;
267 } 265 }
268 266
269 - // obtain the chain after being validated, which *should* contain the pinned certificate in the last position (if it's the Root CA)  
270 - NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);  
271 -  
272 - for (NSData *trustChainCertificate in [serverCertificates reverseObjectEnumerator]) { 267 + if (!self.validatesCertificateChain) {
  268 + return YES;
  269 + }
  270 +
  271 + NSUInteger trustedCertificateCount = 0;
  272 + for (NSData *trustChainCertificate in serverCertificates) {
273 if ([self.pinnedCertificates containsObject:trustChainCertificate]) { 273 if ([self.pinnedCertificates containsObject:trustChainCertificate]) {
274 - return YES; 274 + trustedCertificateCount++;
275 } 275 }
276 } 276 }
277 -  
278 - return NO; 277 +
  278 + return trustedCertificateCount == [serverCertificates count];
279 } 279 }
280 case AFSSLPinningModePublicKey: { 280 case AFSSLPinningModePublicKey: {
281 NSUInteger trustedPublicKeyCount = 0; 281 NSUInteger trustedPublicKeyCount = 0;
282 NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust); 282 NSArray *publicKeys = AFPublicKeyTrustChainForServerTrust(serverTrust);
  283 + if (!self.validatesCertificateChain && [publicKeys count] > 0) {
  284 + publicKeys = @[[publicKeys firstObject]];
  285 + }
283 286
284 for (id trustChainPublicKey in publicKeys) { 287 for (id trustChainPublicKey in publicKeys) {
285 for (id pinnedPublicKey in self.pinnedPublicKeys) { 288 for (id pinnedPublicKey in self.pinnedPublicKeys) {
@@ -288,10 +291,11 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -288,10 +291,11 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
288 } 291 }
289 } 292 }
290 } 293 }
291 - return trustedPublicKeyCount > 0; 294 +
  295 + return trustedPublicKeyCount > 0 && ((self.validatesCertificateChain && trustedPublicKeyCount == [serverCertificates count]) || (!self.validatesCertificateChain && trustedPublicKeyCount >= 1));
292 } 296 }
293 } 297 }
294 - 298 +
295 return NO; 299 return NO;
296 } 300 }
297 301
@@ -301,44 +305,4 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) { @@ -301,44 +305,4 @@ static NSArray * AFPublicKeyTrustChainForServerTrust(SecTrustRef serverTrust) {
301 return [NSSet setWithObject:@"pinnedCertificates"]; 305 return [NSSet setWithObject:@"pinnedCertificates"];
302 } 306 }
303 307
304 -#pragma mark - NSSecureCoding  
305 -  
306 -+ (BOOL)supportsSecureCoding {  
307 - return YES;  
308 -}  
309 -  
310 -- (instancetype)initWithCoder:(NSCoder *)decoder {  
311 -  
312 - self = [self init];  
313 - if (!self) {  
314 - return nil;  
315 - }  
316 -  
317 - self.SSLPinningMode = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(SSLPinningMode))] unsignedIntegerValue];  
318 - self.allowInvalidCertificates = [decoder decodeBoolForKey:NSStringFromSelector(@selector(allowInvalidCertificates))];  
319 - self.validatesDomainName = [decoder decodeBoolForKey:NSStringFromSelector(@selector(validatesDomainName))];  
320 - self.pinnedCertificates = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(pinnedCertificates))];  
321 -  
322 - return self;  
323 -}  
324 -  
325 -- (void)encodeWithCoder:(NSCoder *)coder {  
326 - [coder encodeObject:[NSNumber numberWithUnsignedInteger:self.SSLPinningMode] forKey:NSStringFromSelector(@selector(SSLPinningMode))];  
327 - [coder encodeBool:self.allowInvalidCertificates forKey:NSStringFromSelector(@selector(allowInvalidCertificates))];  
328 - [coder encodeBool:self.validatesDomainName forKey:NSStringFromSelector(@selector(validatesDomainName))];  
329 - [coder encodeObject:self.pinnedCertificates forKey:NSStringFromSelector(@selector(pinnedCertificates))];  
330 -}  
331 -  
332 -#pragma mark - NSCopying  
333 -  
334 -- (instancetype)copyWithZone:(NSZone *)zone {  
335 - AFSecurityPolicy *securityPolicy = [[[self class] allocWithZone:zone] init];  
336 - securityPolicy.SSLPinningMode = self.SSLPinningMode;  
337 - securityPolicy.allowInvalidCertificates = self.allowInvalidCertificates;  
338 - securityPolicy.validatesDomainName = self.validatesDomainName;  
339 - securityPolicy.pinnedCertificates = [self.pinnedCertificates copyWithZone:zone];  
340 -  
341 - return securityPolicy;  
342 -}  
343 -  
344 @end 308 @end
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFURLRequestSerialization.h
1 // AFURLRequestSerialization.h 1 // AFURLRequestSerialization.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -20,41 +20,10 @@ @@ -20,41 +20,10 @@
20 // THE SOFTWARE. 20 // THE SOFTWARE.
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 -#import <TargetConditionals.h>  
24 -  
25 -#if TARGET_OS_IOS || TARGET_OS_TV 23 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
26 #import <UIKit/UIKit.h> 24 #import <UIKit/UIKit.h>
27 -#elif TARGET_OS_WATCH  
28 -#import <WatchKit/WatchKit.h>  
29 #endif 25 #endif
30 26
31 -NS_ASSUME_NONNULL_BEGIN  
32 -  
33 -/**  
34 - Returns a percent-escaped string following RFC 3986 for a query string key or value.  
35 - RFC 3986 states that the following characters are "reserved" characters.  
36 - - General Delimiters: ":", "#", "[", "]", "@", "?", "/"  
37 - - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "="  
38 -  
39 - In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow  
40 - query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/"  
41 - should be percent-escaped in the query string.  
42 -  
43 - @param string The string to be percent-escaped.  
44 -  
45 - @return The percent-escaped string.  
46 - */  
47 -FOUNDATION_EXPORT NSString * AFPercentEscapedStringFromString(NSString *string);  
48 -  
49 -/**  
50 - A helper method to generate encoded url query parameters for appending to the end of a URL.  
51 -  
52 - @param parameters A dictionary of key/values to be encoded.  
53 -  
54 - @return A url encoded query string  
55 - */  
56 -FOUNDATION_EXPORT NSString * AFQueryStringFromParameters(NSDictionary *parameters);  
57 -  
58 /** 27 /**
59 The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary. 28 The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary.
60 29
@@ -71,9 +40,9 @@ FOUNDATION_EXPORT NSString * AFQueryStringFromParameters(NSDictionary *parameter @@ -71,9 +40,9 @@ FOUNDATION_EXPORT NSString * AFQueryStringFromParameters(NSDictionary *parameter
71 40
72 @return A serialized request. 41 @return A serialized request.
73 */ 42 */
74 -- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request  
75 - withParameters:(nullable id)parameters  
76 - error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; 43 +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
  44 + withParameters:(id)parameters
  45 + error:(NSError * __autoreleasing *)error;
77 46
78 @end 47 @end
79 48
@@ -154,7 +123,7 @@ typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) { @@ -154,7 +123,7 @@ typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) {
154 123
155 @discussion To add or remove default request headers, use `setValue:forHTTPHeaderField:`. 124 @discussion To add or remove default request headers, use `setValue:forHTTPHeaderField:`.
156 */ 125 */
157 -@property (readonly, nonatomic, strong) NSDictionary <NSString *, NSString *> *HTTPRequestHeaders; 126 +@property (readonly, nonatomic, strong) NSDictionary *HTTPRequestHeaders;
158 127
159 /** 128 /**
160 Creates and returns a serializer with default configuration. 129 Creates and returns a serializer with default configuration.
@@ -167,7 +136,7 @@ typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) { @@ -167,7 +136,7 @@ typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) {
167 @param field The HTTP header to set a default value for 136 @param field The HTTP header to set a default value for
168 @param value The value set as default for the specified header, or `nil` 137 @param value The value set as default for the specified header, or `nil`
169 */ 138 */
170 -- (void)setValue:(nullable NSString *)value 139 +- (void)setValue:(NSString *)value
171 forHTTPHeaderField:(NSString *)field; 140 forHTTPHeaderField:(NSString *)field;
172 141
173 /** 142 /**
@@ -177,7 +146,7 @@ forHTTPHeaderField:(NSString *)field; @@ -177,7 +146,7 @@ forHTTPHeaderField:(NSString *)field;
177 146
178 @return The value set as default for the specified header, or `nil` 147 @return The value set as default for the specified header, or `nil`
179 */ 148 */
180 -- (nullable NSString *)valueForHTTPHeaderField:(NSString *)field; 149 +- (NSString *)valueForHTTPHeaderField:(NSString *)field;
181 150
182 /** 151 /**
183 Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header. 152 Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header.
@@ -189,6 +158,12 @@ forHTTPHeaderField:(NSString *)field; @@ -189,6 +158,12 @@ forHTTPHeaderField:(NSString *)field;
189 password:(NSString *)password; 158 password:(NSString *)password;
190 159
191 /** 160 /**
  161 + @deprecated This method has been deprecated. Use -setValue:forHTTPHeaderField: instead.
  162 + */
  163 +- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token DEPRECATED_ATTRIBUTE;
  164 +
  165 +
  166 +/**
192 Clears any existing value for the "Authorization" HTTP header. 167 Clears any existing value for the "Authorization" HTTP header.
193 */ 168 */
194 - (void)clearAuthorizationHeader; 169 - (void)clearAuthorizationHeader;
@@ -200,7 +175,7 @@ forHTTPHeaderField:(NSString *)field; @@ -200,7 +175,7 @@ forHTTPHeaderField:(NSString *)field;
200 /** 175 /**
201 HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default. 176 HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default.
202 */ 177 */
203 -@property (nonatomic, strong) NSSet <NSString *> *HTTPMethodsEncodingParametersInURI; 178 +@property (nonatomic, strong) NSSet *HTTPMethodsEncodingParametersInURI;
204 179
205 /** 180 /**
206 Set the method of query string serialization according to one of the pre-defined styles. 181 Set the method of query string serialization according to one of the pre-defined styles.
@@ -216,13 +191,20 @@ forHTTPHeaderField:(NSString *)field; @@ -216,13 +191,20 @@ forHTTPHeaderField:(NSString *)field;
216 191
217 @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request. 192 @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request.
218 */ 193 */
219 -- (void)setQueryStringSerializationWithBlock:(nullable NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; 194 +- (void)setQueryStringSerializationWithBlock:(NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block;
220 195
221 ///------------------------------- 196 ///-------------------------------
222 /// @name Creating Request Objects 197 /// @name Creating Request Objects
223 ///------------------------------- 198 ///-------------------------------
224 199
225 /** 200 /**
  201 + @deprecated This method has been deprecated. Use -requestWithMethod:URLString:parameters:error: instead.
  202 + */
  203 +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
  204 + URLString:(NSString *)URLString
  205 + parameters:(id)parameters DEPRECATED_ATTRIBUTE;
  206 +
  207 +/**
226 Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string. 208 Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string.
227 209
228 If the HTTP method is `GET`, `HEAD`, or `DELETE`, the parameters will be used to construct a url-encoded query string that is appended to the request's URL. Otherwise, the parameters will be encoded according to the value of the `parameterEncoding` property, and set as the request body. 210 If the HTTP method is `GET`, `HEAD`, or `DELETE`, the parameters will be used to construct a url-encoded query string that is appended to the request's URL. Otherwise, the parameters will be encoded according to the value of the `parameterEncoding` property, and set as the request body.
@@ -236,8 +218,16 @@ forHTTPHeaderField:(NSString *)field; @@ -236,8 +218,16 @@ forHTTPHeaderField:(NSString *)field;
236 */ 218 */
237 - (NSMutableURLRequest *)requestWithMethod:(NSString *)method 219 - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
238 URLString:(NSString *)URLString 220 URLString:(NSString *)URLString
239 - parameters:(nullable id)parameters  
240 - error:(NSError * _Nullable __autoreleasing *)error; 221 + parameters:(id)parameters
  222 + error:(NSError * __autoreleasing *)error;
  223 +
  224 +/**
  225 + @deprecated This method has been deprecated. Use -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error: instead.
  226 + */
  227 +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
  228 + URLString:(NSString *)URLString
  229 + parameters:(NSDictionary *)parameters
  230 + constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block DEPRECATED_ATTRIBUTE;
241 231
242 /** 232 /**
243 Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 233 Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2
@@ -254,9 +244,9 @@ forHTTPHeaderField:(NSString *)field; @@ -254,9 +244,9 @@ forHTTPHeaderField:(NSString *)field;
254 */ 244 */
255 - (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method 245 - (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
256 URLString:(NSString *)URLString 246 URLString:(NSString *)URLString
257 - parameters:(nullable NSDictionary <NSString *, id> *)parameters  
258 - constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block  
259 - error:(NSError * _Nullable __autoreleasing *)error; 247 + parameters:(NSDictionary *)parameters
  248 + constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
  249 + error:(NSError * __autoreleasing *)error;
260 250
261 /** 251 /**
262 Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished. 252 Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished.
@@ -271,7 +261,7 @@ forHTTPHeaderField:(NSString *)field; @@ -271,7 +261,7 @@ forHTTPHeaderField:(NSString *)field;
271 */ 261 */
272 - (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request 262 - (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request
273 writingStreamContentsToFile:(NSURL *)fileURL 263 writingStreamContentsToFile:(NSURL *)fileURL
274 - completionHandler:(nullable void (^)(NSError * _Nullable error))handler; 264 + completionHandler:(void (^)(NSError *error))handler;
275 265
276 @end 266 @end
277 267
@@ -295,7 +285,7 @@ forHTTPHeaderField:(NSString *)field; @@ -295,7 +285,7 @@ forHTTPHeaderField:(NSString *)field;
295 */ 285 */
296 - (BOOL)appendPartWithFileURL:(NSURL *)fileURL 286 - (BOOL)appendPartWithFileURL:(NSURL *)fileURL
297 name:(NSString *)name 287 name:(NSString *)name
298 - error:(NSError * _Nullable __autoreleasing *)error; 288 + error:(NSError * __autoreleasing *)error;
299 289
300 /** 290 /**
301 Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. 291 Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary.
@@ -312,7 +302,7 @@ forHTTPHeaderField:(NSString *)field; @@ -312,7 +302,7 @@ forHTTPHeaderField:(NSString *)field;
312 name:(NSString *)name 302 name:(NSString *)name
313 fileName:(NSString *)fileName 303 fileName:(NSString *)fileName
314 mimeType:(NSString *)mimeType 304 mimeType:(NSString *)mimeType
315 - error:(NSError * _Nullable __autoreleasing *)error; 305 + error:(NSError * __autoreleasing *)error;
316 306
317 /** 307 /**
318 Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary. 308 Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary.
@@ -323,7 +313,7 @@ forHTTPHeaderField:(NSString *)field; @@ -323,7 +313,7 @@ forHTTPHeaderField:(NSString *)field;
323 @param length The length of the specified input stream in bytes. 313 @param length The length of the specified input stream in bytes.
324 @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. 314 @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`.
325 */ 315 */
326 -- (void)appendPartWithInputStream:(nullable NSInputStream *)inputStream 316 +- (void)appendPartWithInputStream:(NSInputStream *)inputStream
327 name:(NSString *)name 317 name:(NSString *)name
328 fileName:(NSString *)fileName 318 fileName:(NSString *)fileName
329 length:(int64_t)length 319 length:(int64_t)length
@@ -359,7 +349,7 @@ forHTTPHeaderField:(NSString *)field; @@ -359,7 +349,7 @@ forHTTPHeaderField:(NSString *)field;
359 @param headers The HTTP headers to be appended to the form data. 349 @param headers The HTTP headers to be appended to the form data.
360 @param body The data to be encoded and appended to the form data. This parameter must not be `nil`. 350 @param body The data to be encoded and appended to the form data. This parameter must not be `nil`.
361 */ 351 */
362 -- (void)appendPartWithHeaders:(nullable NSDictionary <NSString *, NSString *> *)headers 352 +- (void)appendPartWithHeaders:(NSDictionary *)headers
363 body:(NSData *)body; 353 body:(NSData *)body;
364 354
365 /** 355 /**
@@ -444,7 +434,7 @@ forHTTPHeaderField:(NSString *)field; @@ -444,7 +434,7 @@ forHTTPHeaderField:(NSString *)field;
444 `AFURLRequestSerializationErrorDomain` 434 `AFURLRequestSerializationErrorDomain`
445 AFURLRequestSerializer errors. Error codes for `AFURLRequestSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. 435 AFURLRequestSerializer errors. Error codes for `AFURLRequestSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`.
446 */ 436 */
447 -FOUNDATION_EXPORT NSString * const AFURLRequestSerializationErrorDomain; 437 +extern NSString * const AFURLRequestSerializationErrorDomain;
448 438
449 /** 439 /**
450 ## User info dictionary keys 440 ## User info dictionary keys
@@ -458,7 +448,7 @@ FOUNDATION_EXPORT NSString * const AFURLRequestSerializationErrorDomain; @@ -458,7 +448,7 @@ FOUNDATION_EXPORT NSString * const AFURLRequestSerializationErrorDomain;
458 `AFNetworkingOperationFailingURLRequestErrorKey` 448 `AFNetworkingOperationFailingURLRequestErrorKey`
459 The corresponding value is an `NSURLRequest` containing the request of the operation associated with an error. This key is only present in the `AFURLRequestSerializationErrorDomain`. 449 The corresponding value is an `NSURLRequest` containing the request of the operation associated with an error. This key is only present in the `AFURLRequestSerializationErrorDomain`.
460 */ 450 */
461 -FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLRequestErrorKey; 451 +extern NSString * const AFNetworkingOperationFailingURLRequestErrorKey;
462 452
463 /** 453 /**
464 ## Throttling Bandwidth for HTTP Request Input Streams 454 ## Throttling Bandwidth for HTTP Request Input Streams
@@ -473,7 +463,5 @@ FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLRequestErrorKe @@ -473,7 +463,5 @@ FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLRequestErrorKe
473 `kAFUploadStream3GSuggestedDelay` 463 `kAFUploadStream3GSuggestedDelay`
474 Duration of delay each time a packet is read. Equal to 0.2 seconds. 464 Duration of delay each time a packet is read. Equal to 0.2 seconds.
475 */ 465 */
476 -FOUNDATION_EXPORT NSUInteger const kAFUploadStream3GSuggestedPacketSize;  
477 -FOUNDATION_EXPORT NSTimeInterval const kAFUploadStream3GSuggestedDelay;  
478 -  
479 -NS_ASSUME_NONNULL_END 466 +extern NSUInteger const kAFUploadStream3GSuggestedPacketSize;
  467 +extern NSTimeInterval const kAFUploadStream3GSuggestedDelay;
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFURLRequestSerialization.m
1 // AFURLRequestSerialization.m 1 // AFURLRequestSerialization.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 21
22 #import "AFURLRequestSerialization.h" 22 #import "AFURLRequestSerialization.h"
23 23
24 -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV 24 +#if __IPHONE_OS_VERSION_MIN_REQUIRED
25 #import <MobileCoreServices/MobileCoreServices.h> 25 #import <MobileCoreServices/MobileCoreServices.h>
26 #else 26 #else
27 #import <CoreServices/CoreServices.h> 27 #import <CoreServices/CoreServices.h>
@@ -32,48 +32,45 @@ NSString * const AFNetworkingOperationFailingURLRequestErrorKey = @&quot;com.alamofir @@ -32,48 +32,45 @@ NSString * const AFNetworkingOperationFailingURLRequestErrorKey = @&quot;com.alamofir
32 32
33 typedef NSString * (^AFQueryStringSerializationBlock)(NSURLRequest *request, id parameters, NSError *__autoreleasing *error); 33 typedef NSString * (^AFQueryStringSerializationBlock)(NSURLRequest *request, id parameters, NSError *__autoreleasing *error);
34 34
35 -/**  
36 - Returns a percent-escaped string following RFC 3986 for a query string key or value.  
37 - RFC 3986 states that the following characters are "reserved" characters.  
38 - - General Delimiters: ":", "#", "[", "]", "@", "?", "/"  
39 - - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" 35 +static NSString * AFBase64EncodedStringFromString(NSString *string) {
  36 + NSData *data = [NSData dataWithBytes:[string UTF8String] length:[string lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
  37 + NSUInteger length = [data length];
  38 + NSMutableData *mutableData = [NSMutableData dataWithLength:((length + 2) / 3) * 4];
40 39
41 - In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow  
42 - query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/"  
43 - should be percent-escaped in the query string.  
44 - - parameter string: The string to be percent-escaped.  
45 - - returns: The percent-escaped string.  
46 - */  
47 -NSString * AFPercentEscapedStringFromString(NSString *string) {  
48 - static NSString * const kAFCharactersGeneralDelimitersToEncode = @":#[]@"; // does not include "?" or "/" due to RFC 3986 - Section 3.4  
49 - static NSString * const kAFCharactersSubDelimitersToEncode = @"!$&'()*+,;="; 40 + uint8_t *input = (uint8_t *)[data bytes];
  41 + uint8_t *output = (uint8_t *)[mutableData mutableBytes];
50 42
51 - NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy];  
52 - [allowedCharacterSet removeCharactersInString:[kAFCharactersGeneralDelimitersToEncode stringByAppendingString:kAFCharactersSubDelimitersToEncode]];  
53 -  
54 - // FIXME: https://github.com/AFNetworking/AFNetworking/pull/3028  
55 - // return [string stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; 43 + for (NSUInteger i = 0; i < length; i += 3) {
  44 + NSUInteger value = 0;
  45 + for (NSUInteger j = i; j < (i + 3); j++) {
  46 + value <<= 8;
  47 + if (j < length) {
  48 + value |= (0xFF & input[j]);
  49 + }
  50 + }
56 51
57 - static NSUInteger const batchSize = 50; 52 + static uint8_t const kAFBase64EncodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
58 53
59 - NSUInteger index = 0;  
60 - NSMutableString *escaped = @"".mutableCopy; 54 + NSUInteger idx = (i / 3) * 4;
  55 + output[idx + 0] = kAFBase64EncodingTable[(value >> 18) & 0x3F];
  56 + output[idx + 1] = kAFBase64EncodingTable[(value >> 12) & 0x3F];
  57 + output[idx + 2] = (i + 1) < length ? kAFBase64EncodingTable[(value >> 6) & 0x3F] : '=';
  58 + output[idx + 3] = (i + 2) < length ? kAFBase64EncodingTable[(value >> 0) & 0x3F] : '=';
  59 + }
61 60
62 - while (index < string.length) {  
63 - NSUInteger length = MIN(string.length - index, batchSize);  
64 - NSRange range = NSMakeRange(index, length); 61 + return [[NSString alloc] initWithData:mutableData encoding:NSASCIIStringEncoding];
  62 +}
65 63
66 - // To avoid breaking up character sequences such as 👴🏻👮🏽  
67 - range = [string rangeOfComposedCharacterSequencesForRange:range]; 64 +static NSString * const kAFCharactersToBeEscapedInQueryString = @":/?&=;+!@#$()',*";
68 65
69 - NSString *substring = [string substringWithRange:range];  
70 - NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet];  
71 - [escaped appendString:encoded]; 66 +static NSString * AFPercentEscapedQueryStringKeyFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
  67 + static NSString * const kAFCharactersToLeaveUnescapedInQueryStringPairKey = @"[].";
72 68
73 - index += range.length;  
74 - } 69 + return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, (__bridge CFStringRef)kAFCharactersToLeaveUnescapedInQueryStringPairKey, (__bridge CFStringRef)kAFCharactersToBeEscapedInQueryString, CFStringConvertNSStringEncodingToEncoding(encoding));
  70 +}
75 71
76 - return escaped; 72 +static NSString * AFPercentEscapedQueryStringValueFromStringWithEncoding(NSString *string, NSStringEncoding encoding) {
  73 + return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)string, NULL, (__bridge CFStringRef)kAFCharactersToBeEscapedInQueryString, CFStringConvertNSStringEncodingToEncoding(encoding));
77 } 74 }
78 75
79 #pragma mark - 76 #pragma mark -
@@ -82,14 +79,14 @@ NSString * AFPercentEscapedStringFromString(NSString *string) { @@ -82,14 +79,14 @@ NSString * AFPercentEscapedStringFromString(NSString *string) {
82 @property (readwrite, nonatomic, strong) id field; 79 @property (readwrite, nonatomic, strong) id field;
83 @property (readwrite, nonatomic, strong) id value; 80 @property (readwrite, nonatomic, strong) id value;
84 81
85 -- (instancetype)initWithField:(id)field value:(id)value; 82 +- (id)initWithField:(id)field value:(id)value;
86 83
87 -- (NSString *)URLEncodedStringValue; 84 +- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding;
88 @end 85 @end
89 86
90 @implementation AFQueryStringPair 87 @implementation AFQueryStringPair
91 88
92 -- (instancetype)initWithField:(id)field value:(id)value { 89 +- (id)initWithField:(id)field value:(id)value {
93 self = [super init]; 90 self = [super init];
94 if (!self) { 91 if (!self) {
95 return nil; 92 return nil;
@@ -101,11 +98,11 @@ NSString * AFPercentEscapedStringFromString(NSString *string) { @@ -101,11 +98,11 @@ NSString * AFPercentEscapedStringFromString(NSString *string) {
101 return self; 98 return self;
102 } 99 }
103 100
104 -- (NSString *)URLEncodedStringValue { 101 +- (NSString *)URLEncodedStringValueWithEncoding:(NSStringEncoding)stringEncoding {
105 if (!self.value || [self.value isEqual:[NSNull null]]) { 102 if (!self.value || [self.value isEqual:[NSNull null]]) {
106 - return AFPercentEscapedStringFromString([self.field description]); 103 + return AFPercentEscapedQueryStringKeyFromStringWithEncoding([self.field description], stringEncoding);
107 } else { 104 } else {
108 - return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedStringFromString([self.field description]), AFPercentEscapedStringFromString([self.value description])]; 105 + return [NSString stringWithFormat:@"%@=%@", AFPercentEscapedQueryStringKeyFromStringWithEncoding([self.field description], stringEncoding), AFPercentEscapedQueryStringValueFromStringWithEncoding([self.value description], stringEncoding)];
109 } 106 }
110 } 107 }
111 108
@@ -113,13 +110,13 @@ NSString * AFPercentEscapedStringFromString(NSString *string) { @@ -113,13 +110,13 @@ NSString * AFPercentEscapedStringFromString(NSString *string) {
113 110
114 #pragma mark - 111 #pragma mark -
115 112
116 -FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary);  
117 -FOUNDATION_EXPORT NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value); 113 +extern NSArray * AFQueryStringPairsFromDictionary(NSDictionary *dictionary);
  114 +extern NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value);
118 115
119 -NSString * AFQueryStringFromParameters(NSDictionary *parameters) { 116 +static NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *parameters, NSStringEncoding stringEncoding) {
120 NSMutableArray *mutablePairs = [NSMutableArray array]; 117 NSMutableArray *mutablePairs = [NSMutableArray array];
121 for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) { 118 for (AFQueryStringPair *pair in AFQueryStringPairsFromDictionary(parameters)) {
122 - [mutablePairs addObject:[pair URLEncodedStringValue]]; 119 + [mutablePairs addObject:[pair URLEncodedStringValueWithEncoding:stringEncoding]];
123 } 120 }
124 121
125 return [mutablePairs componentsJoinedByString:@"&"]; 122 return [mutablePairs componentsJoinedByString:@"&"];
@@ -138,7 +135,7 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) { @@ -138,7 +135,7 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
138 NSDictionary *dictionary = value; 135 NSDictionary *dictionary = value;
139 // Sort dictionary keys to ensure consistent ordering in query string, which is important when deserializing potentially ambiguous sequences, such as an array of dictionaries 136 // Sort dictionary keys to ensure consistent ordering in query string, which is important when deserializing potentially ambiguous sequences, such as an array of dictionaries
140 for (id nestedKey in [dictionary.allKeys sortedArrayUsingDescriptors:@[ sortDescriptor ]]) { 137 for (id nestedKey in [dictionary.allKeys sortedArrayUsingDescriptors:@[ sortDescriptor ]]) {
141 - id nestedValue = dictionary[nestedKey]; 138 + id nestedValue = [dictionary objectForKey:nestedKey];
142 if (nestedValue) { 139 if (nestedValue) {
143 [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue((key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey), nestedValue)]; 140 [mutableQueryStringComponents addObjectsFromArray:AFQueryStringPairsFromKeyAndValue((key ? [NSString stringWithFormat:@"%@[%@]", key, nestedKey] : nestedKey), nestedValue)];
144 } 141 }
@@ -186,7 +183,6 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb @@ -186,7 +183,6 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb
186 @interface AFHTTPRequestSerializer () 183 @interface AFHTTPRequestSerializer ()
187 @property (readwrite, nonatomic, strong) NSMutableSet *mutableObservedChangedKeyPaths; 184 @property (readwrite, nonatomic, strong) NSMutableSet *mutableObservedChangedKeyPaths;
188 @property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders; 185 @property (readwrite, nonatomic, strong) NSMutableDictionary *mutableHTTPRequestHeaders;
189 -@property (readwrite, nonatomic, strong) dispatch_queue_t requestHeaderModificationQueue;  
190 @property (readwrite, nonatomic, assign) AFHTTPRequestQueryStringSerializationStyle queryStringSerializationStyle; 186 @property (readwrite, nonatomic, assign) AFHTTPRequestQueryStringSerializationStyle queryStringSerializationStyle;
191 @property (readwrite, nonatomic, copy) AFQueryStringSerializationBlock queryStringSerialization; 187 @property (readwrite, nonatomic, copy) AFQueryStringSerializationBlock queryStringSerialization;
192 @end 188 @end
@@ -206,7 +202,6 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb @@ -206,7 +202,6 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb
206 self.stringEncoding = NSUTF8StringEncoding; 202 self.stringEncoding = NSUTF8StringEncoding;
207 203
208 self.mutableHTTPRequestHeaders = [NSMutableDictionary dictionary]; 204 self.mutableHTTPRequestHeaders = [NSMutableDictionary dictionary];
209 - self.requestHeaderModificationQueue = dispatch_queue_create("requestHeaderModificationQueue", DISPATCH_QUEUE_CONCURRENT);  
210 205
211 // Accept-Language HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4 206 // Accept-Language HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4
212 NSMutableArray *acceptLanguagesComponents = [NSMutableArray array]; 207 NSMutableArray *acceptLanguagesComponents = [NSMutableArray array];
@@ -218,15 +213,15 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb @@ -218,15 +213,15 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb
218 [self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"]; 213 [self setValue:[acceptLanguagesComponents componentsJoinedByString:@", "] forHTTPHeaderField:@"Accept-Language"];
219 214
220 NSString *userAgent = nil; 215 NSString *userAgent = nil;
221 -#if TARGET_OS_IOS  
222 - // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43  
223 - userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];  
224 -#elif TARGET_OS_WATCH 216 +#pragma clang diagnostic push
  217 +#pragma clang diagnostic ignored "-Wgnu"
  218 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
225 // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 219 // User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43
226 - userAgent = [NSString stringWithFormat:@"%@/%@ (%@; watchOS %@; Scale/%0.2f)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[WKInterfaceDevice currentDevice] model], [[WKInterfaceDevice currentDevice] systemVersion], [[WKInterfaceDevice currentDevice] screenScale]]; 220 + userAgent = [NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[UIDevice currentDevice] model], [[UIDevice currentDevice] systemVersion], [[UIScreen mainScreen] scale]];
227 #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 221 #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
228 - userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleExecutableKey] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleIdentifierKey], [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"] ?: [[NSBundle mainBundle] infoDictionary][(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]]; 222 + userAgent = [NSString stringWithFormat:@"%@/%@ (Mac OS X %@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey], [[NSProcessInfo processInfo] operatingSystemVersionString]];
229 #endif 223 #endif
  224 +#pragma clang diagnostic pop
230 if (userAgent) { 225 if (userAgent) {
231 if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) { 226 if (![userAgent canBeConvertedToEncoding:NSASCIIStringEncoding]) {
232 NSMutableString *mutableUserAgent = [userAgent mutableCopy]; 227 NSMutableString *mutableUserAgent = [userAgent mutableCopy];
@@ -302,41 +297,32 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb @@ -302,41 +297,32 @@ static void *AFHTTPRequestSerializerObserverContext = &amp;AFHTTPRequestSerializerOb
302 #pragma mark - 297 #pragma mark -
303 298
304 - (NSDictionary *)HTTPRequestHeaders { 299 - (NSDictionary *)HTTPRequestHeaders {
305 - NSDictionary __block *value;  
306 - dispatch_sync(self.requestHeaderModificationQueue, ^{  
307 - value = [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders];  
308 - });  
309 - return value; 300 + return [NSDictionary dictionaryWithDictionary:self.mutableHTTPRequestHeaders];
310 } 301 }
311 302
312 - (void)setValue:(NSString *)value 303 - (void)setValue:(NSString *)value
313 forHTTPHeaderField:(NSString *)field 304 forHTTPHeaderField:(NSString *)field
314 { 305 {
315 - dispatch_barrier_async(self.requestHeaderModificationQueue, ^{  
316 - [self.mutableHTTPRequestHeaders setValue:value forKey:field];  
317 - }); 306 + [self.mutableHTTPRequestHeaders setValue:value forKey:field];
318 } 307 }
319 308
320 - (NSString *)valueForHTTPHeaderField:(NSString *)field { 309 - (NSString *)valueForHTTPHeaderField:(NSString *)field {
321 - NSString __block *value;  
322 - dispatch_sync(self.requestHeaderModificationQueue, ^{  
323 - value = [self.mutableHTTPRequestHeaders valueForKey:field];  
324 - });  
325 - return value; 310 + return [self.mutableHTTPRequestHeaders valueForKey:field];
326 } 311 }
327 312
328 - (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username 313 - (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username
329 password:(NSString *)password 314 password:(NSString *)password
330 { 315 {
331 - NSData *basicAuthCredentials = [[NSString stringWithFormat:@"%@:%@", username, password] dataUsingEncoding:NSUTF8StringEncoding];  
332 - NSString *base64AuthCredentials = [basicAuthCredentials base64EncodedStringWithOptions:(NSDataBase64EncodingOptions)0];  
333 - [self setValue:[NSString stringWithFormat:@"Basic %@", base64AuthCredentials] forHTTPHeaderField:@"Authorization"]; 316 + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password];
  317 + [self setValue:[NSString stringWithFormat:@"Basic %@", AFBase64EncodedStringFromString(basicAuthCredentials)] forHTTPHeaderField:@"Authorization"];
  318 +}
  319 +
  320 +- (void)setAuthorizationHeaderFieldWithToken:(NSString *)token {
  321 + [self setValue:[NSString stringWithFormat:@"Token token=\"%@\"", token] forHTTPHeaderField:@"Authorization"];
334 } 322 }
335 323
336 - (void)clearAuthorizationHeader { 324 - (void)clearAuthorizationHeader {
337 - dispatch_barrier_async(self.requestHeaderModificationQueue, ^{  
338 - [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"];  
339 - }); 325 + [self.mutableHTTPRequestHeaders removeObjectForKey:@"Authorization"];
340 } 326 }
341 327
342 #pragma mark - 328 #pragma mark -
@@ -355,6 +341,13 @@ forHTTPHeaderField:(NSString *)field @@ -355,6 +341,13 @@ forHTTPHeaderField:(NSString *)field
355 - (NSMutableURLRequest *)requestWithMethod:(NSString *)method 341 - (NSMutableURLRequest *)requestWithMethod:(NSString *)method
356 URLString:(NSString *)URLString 342 URLString:(NSString *)URLString
357 parameters:(id)parameters 343 parameters:(id)parameters
  344 +{
  345 + return [self requestWithMethod:method URLString:URLString parameters:parameters error:nil];
  346 +}
  347 +
  348 +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
  349 + URLString:(NSString *)URLString
  350 + parameters:(id)parameters
358 error:(NSError *__autoreleasing *)error 351 error:(NSError *__autoreleasing *)error
359 { 352 {
360 NSParameterAssert(method); 353 NSParameterAssert(method);
@@ -382,6 +375,14 @@ forHTTPHeaderField:(NSString *)field @@ -382,6 +375,14 @@ forHTTPHeaderField:(NSString *)field
382 URLString:(NSString *)URLString 375 URLString:(NSString *)URLString
383 parameters:(NSDictionary *)parameters 376 parameters:(NSDictionary *)parameters
384 constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block 377 constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
  378 +{
  379 + return [self multipartFormRequestWithMethod:method URLString:URLString parameters:parameters constructingBodyWithBlock:block error:nil];
  380 +}
  381 +
  382 +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method
  383 + URLString:(NSString *)URLString
  384 + parameters:(NSDictionary *)parameters
  385 + constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
385 error:(NSError *__autoreleasing *)error 386 error:(NSError *__autoreleasing *)error
386 { 387 {
387 NSParameterAssert(method); 388 NSParameterAssert(method);
@@ -485,8 +486,8 @@ forHTTPHeaderField:(NSString *)field @@ -485,8 +486,8 @@ forHTTPHeaderField:(NSString *)field
485 } 486 }
486 }]; 487 }];
487 488
488 - NSString *query = nil;  
489 if (parameters) { 489 if (parameters) {
  490 + NSString *query = nil;
490 if (self.queryStringSerialization) { 491 if (self.queryStringSerialization) {
491 NSError *serializationError; 492 NSError *serializationError;
492 query = self.queryStringSerialization(request, parameters, &serializationError); 493 query = self.queryStringSerialization(request, parameters, &serializationError);
@@ -501,25 +502,19 @@ forHTTPHeaderField:(NSString *)field @@ -501,25 +502,19 @@ forHTTPHeaderField:(NSString *)field
501 } else { 502 } else {
502 switch (self.queryStringSerializationStyle) { 503 switch (self.queryStringSerializationStyle) {
503 case AFHTTPRequestQueryStringDefaultStyle: 504 case AFHTTPRequestQueryStringDefaultStyle:
504 - query = AFQueryStringFromParameters(parameters); 505 + query = AFQueryStringFromParametersWithEncoding(parameters, self.stringEncoding);
505 break; 506 break;
506 } 507 }
507 } 508 }
508 - }  
509 509
510 - if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) {  
511 - if (query && query.length > 0) { 510 + if ([self.HTTPMethodsEncodingParametersInURI containsObject:[[request HTTPMethod] uppercaseString]]) {
512 mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]]; 511 mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]];
  512 + } else {
  513 + if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
  514 + [mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
  515 + }
  516 + [mutableRequest setHTTPBody:[query dataUsingEncoding:self.stringEncoding]];
513 } 517 }
514 - } else {  
515 - // #2864: an empty string is a valid x-www-form-urlencoded payload  
516 - if (!query) {  
517 - query = @"";  
518 - }  
519 - if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {  
520 - [mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];  
521 - }  
522 - [mutableRequest setHTTPBody:[query dataUsingEncoding:self.stringEncoding]];  
523 } 518 }
524 519
525 return mutableRequest; 520 return mutableRequest;
@@ -555,32 +550,28 @@ forHTTPHeaderField:(NSString *)field @@ -555,32 +550,28 @@ forHTTPHeaderField:(NSString *)field
555 return YES; 550 return YES;
556 } 551 }
557 552
558 -- (instancetype)initWithCoder:(NSCoder *)decoder { 553 +- (id)initWithCoder:(NSCoder *)decoder {
559 self = [self init]; 554 self = [self init];
560 if (!self) { 555 if (!self) {
561 return nil; 556 return nil;
562 } 557 }
563 558
564 self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy]; 559 self.mutableHTTPRequestHeaders = [[decoder decodeObjectOfClass:[NSDictionary class] forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))] mutableCopy];
565 - self.queryStringSerializationStyle = (AFHTTPRequestQueryStringSerializationStyle)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue]; 560 + self.queryStringSerializationStyle = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))] unsignedIntegerValue];
566 561
567 return self; 562 return self;
568 } 563 }
569 564
570 - (void)encodeWithCoder:(NSCoder *)coder { 565 - (void)encodeWithCoder:(NSCoder *)coder {
571 - dispatch_sync(self.requestHeaderModificationQueue, ^{  
572 - [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];  
573 - }); 566 + [coder encodeObject:self.mutableHTTPRequestHeaders forKey:NSStringFromSelector(@selector(mutableHTTPRequestHeaders))];
574 [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))]; 567 [coder encodeInteger:self.queryStringSerializationStyle forKey:NSStringFromSelector(@selector(queryStringSerializationStyle))];
575 } 568 }
576 569
577 #pragma mark - NSCopying 570 #pragma mark - NSCopying
578 571
579 -- (instancetype)copyWithZone:(NSZone *)zone { 572 +- (id)copyWithZone:(NSZone *)zone {
580 AFHTTPRequestSerializer *serializer = [[[self class] allocWithZone:zone] init]; 573 AFHTTPRequestSerializer *serializer = [[[self class] allocWithZone:zone] init];
581 - dispatch_sync(self.requestHeaderModificationQueue, ^{  
582 - serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];  
583 - }); 574 + serializer.mutableHTTPRequestHeaders = [self.mutableHTTPRequestHeaders mutableCopyWithZone:zone];
584 serializer.queryStringSerializationStyle = self.queryStringSerializationStyle; 575 serializer.queryStringSerializationStyle = self.queryStringSerializationStyle;
585 serializer.queryStringSerialization = self.queryStringSerialization; 576 serializer.queryStringSerialization = self.queryStringSerialization;
586 577
@@ -610,6 +601,7 @@ static inline NSString * AFMultipartFormFinalBoundary(NSString *boundary) { @@ -610,6 +601,7 @@ static inline NSString * AFMultipartFormFinalBoundary(NSString *boundary) {
610 } 601 }
611 602
612 static inline NSString * AFContentTypeForPathExtension(NSString *extension) { 603 static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
  604 +#ifdef __UTTYPE__
613 NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL); 605 NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (__bridge CFStringRef)extension, NULL);
614 NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType); 606 NSString *contentType = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType);
615 if (!contentType) { 607 if (!contentType) {
@@ -617,6 +609,10 @@ static inline NSString * AFContentTypeForPathExtension(NSString *extension) { @@ -617,6 +609,10 @@ static inline NSString * AFContentTypeForPathExtension(NSString *extension) {
617 } else { 609 } else {
618 return contentType; 610 return contentType;
619 } 611 }
  612 +#else
  613 +#pragma unused (extension)
  614 + return @"application/octet-stream";
  615 +#endif
620 } 616 }
621 617
622 NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16; 618 NSUInteger const kAFUploadStream3GSuggestedPacketSize = 1024 * 16;
@@ -647,7 +643,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -647,7 +643,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
647 @property (readonly, nonatomic, assign) unsigned long long contentLength; 643 @property (readonly, nonatomic, assign) unsigned long long contentLength;
648 @property (readonly, nonatomic, assign, getter = isEmpty) BOOL empty; 644 @property (readonly, nonatomic, assign, getter = isEmpty) BOOL empty;
649 645
650 -- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding; 646 +- (id)initWithStringEncoding:(NSStringEncoding)encoding;
651 - (void)setInitialAndFinalBoundaries; 647 - (void)setInitialAndFinalBoundaries;
652 - (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart; 648 - (void)appendHTTPBodyPart:(AFHTTPBodyPart *)bodyPart;
653 @end 649 @end
@@ -663,8 +659,8 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -663,8 +659,8 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
663 659
664 @implementation AFStreamingMultipartFormData 660 @implementation AFStreamingMultipartFormData
665 661
666 -- (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest  
667 - stringEncoding:(NSStringEncoding)encoding 662 +- (id)initWithURLRequest:(NSMutableURLRequest *)urlRequest
  663 + stringEncoding:(NSStringEncoding)encoding
668 { 664 {
669 self = [super init]; 665 self = [super init];
670 if (!self) { 666 if (!self) {
@@ -733,7 +729,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -733,7 +729,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
733 bodyPart.headers = mutableHeaders; 729 bodyPart.headers = mutableHeaders;
734 bodyPart.boundary = self.boundary; 730 bodyPart.boundary = self.boundary;
735 bodyPart.body = fileURL; 731 bodyPart.body = fileURL;
736 - bodyPart.bodyContentLength = [fileAttributes[NSFileSize] unsignedLongLongValue]; 732 + bodyPart.bodyContentLength = [[fileAttributes objectForKey:NSFileSize] unsignedLongLongValue];
737 [self.bodyStream appendHTTPBodyPart:bodyPart]; 733 [self.bodyStream appendHTTPBodyPart:bodyPart];
738 734
739 return YES; 735 return YES;
@@ -847,13 +843,16 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -847,13 +843,16 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
847 @end 843 @end
848 844
849 @implementation AFMultipartBodyStream 845 @implementation AFMultipartBodyStream
  846 +#pragma clang diagnostic push
  847 +#pragma clang diagnostic ignored "-Wimplicit-atomic-properties"
850 #if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1100) 848 #if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1100)
851 @synthesize delegate; 849 @synthesize delegate;
852 #endif 850 #endif
853 @synthesize streamStatus; 851 @synthesize streamStatus;
854 @synthesize streamError; 852 @synthesize streamError;
  853 +#pragma clang diagnostic pop
855 854
856 -- (instancetype)initWithStringEncoding:(NSStringEncoding)encoding { 855 +- (id)initWithStringEncoding:(NSStringEncoding)encoding {
857 self = [super init]; 856 self = [super init];
858 if (!self) { 857 if (!self) {
859 return nil; 858 return nil;
@@ -873,7 +872,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -873,7 +872,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
873 bodyPart.hasFinalBoundary = NO; 872 bodyPart.hasFinalBoundary = NO;
874 } 873 }
875 874
876 - [[self.HTTPBodyParts firstObject] setHasInitialBoundary:YES]; 875 + [[self.HTTPBodyParts objectAtIndex:0] setHasInitialBoundary:YES];
877 [[self.HTTPBodyParts lastObject] setHasFinalBoundary:YES]; 876 [[self.HTTPBodyParts lastObject] setHasFinalBoundary:YES];
878 } 877 }
879 } 878 }
@@ -897,13 +896,15 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -897,13 +896,15 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
897 896
898 NSInteger totalNumberOfBytesRead = 0; 897 NSInteger totalNumberOfBytesRead = 0;
899 898
  899 +#pragma clang diagnostic push
  900 +#pragma clang diagnostic ignored "-Wgnu"
900 while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) { 901 while ((NSUInteger)totalNumberOfBytesRead < MIN(length, self.numberOfBytesInPacket)) {
901 if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) { 902 if (!self.currentHTTPBodyPart || ![self.currentHTTPBodyPart hasBytesAvailable]) {
902 if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) { 903 if (!(self.currentHTTPBodyPart = [self.HTTPBodyPartEnumerator nextObject])) {
903 break; 904 break;
904 } 905 }
905 } else { 906 } else {
906 - NSUInteger maxLength = MIN(length, self.numberOfBytesInPacket) - (NSUInteger)totalNumberOfBytesRead; 907 + NSUInteger maxLength = length - (NSUInteger)totalNumberOfBytesRead;
907 NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength]; 908 NSInteger numberOfBytesRead = [self.currentHTTPBodyPart read:&buffer[totalNumberOfBytesRead] maxLength:maxLength];
908 if (numberOfBytesRead == -1) { 909 if (numberOfBytesRead == -1) {
909 self.streamError = self.currentHTTPBodyPart.inputStream.streamError; 910 self.streamError = self.currentHTTPBodyPart.inputStream.streamError;
@@ -917,6 +918,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -917,6 +918,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
917 } 918 }
918 } 919 }
919 } 920 }
  921 +#pragma clang diagnostic pop
920 922
921 return totalNumberOfBytesRead; 923 return totalNumberOfBytesRead;
922 } 924 }
@@ -993,7 +995,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2; @@ -993,7 +995,7 @@ NSTimeInterval const kAFUploadStream3GSuggestedDelay = 0.2;
993 995
994 #pragma mark - NSCopying 996 #pragma mark - NSCopying
995 997
996 -- (instancetype)copyWithZone:(NSZone *)zone { 998 +-(id)copyWithZone:(NSZone *)zone {
997 AFMultipartBodyStream *bodyStreamCopy = [[[self class] allocWithZone:zone] initWithStringEncoding:self.stringEncoding]; 999 AFMultipartBodyStream *bodyStreamCopy = [[[self class] allocWithZone:zone] initWithStringEncoding:self.stringEncoding];
998 1000
999 for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) { 1001 for (AFHTTPBodyPart *bodyPart in self.HTTPBodyParts) {
@@ -1030,7 +1032,7 @@ typedef enum { @@ -1030,7 +1032,7 @@ typedef enum {
1030 1032
1031 @implementation AFHTTPBodyPart 1033 @implementation AFHTTPBodyPart
1032 1034
1033 -- (instancetype)init { 1035 +- (id)init {
1034 self = [super init]; 1036 self = [super init];
1035 if (!self) { 1037 if (!self) {
1036 return nil; 1038 return nil;
@@ -1097,6 +1099,8 @@ typedef enum { @@ -1097,6 +1099,8 @@ typedef enum {
1097 return YES; 1099 return YES;
1098 } 1100 }
1099 1101
  1102 +#pragma clang diagnostic push
  1103 +#pragma clang diagnostic ignored "-Wcovered-switch-default"
1100 switch (self.inputStream.streamStatus) { 1104 switch (self.inputStream.streamStatus) {
1101 case NSStreamStatusNotOpen: 1105 case NSStreamStatusNotOpen:
1102 case NSStreamStatusOpening: 1106 case NSStreamStatusOpening:
@@ -1110,6 +1114,7 @@ typedef enum { @@ -1110,6 +1114,7 @@ typedef enum {
1110 default: 1114 default:
1111 return NO; 1115 return NO;
1112 } 1116 }
  1117 +#pragma clang diagnostic pop
1113 } 1118 }
1114 1119
1115 - (NSInteger)read:(uint8_t *)buffer 1120 - (NSInteger)read:(uint8_t *)buffer
@@ -1154,8 +1159,11 @@ typedef enum { @@ -1154,8 +1159,11 @@ typedef enum {
1154 intoBuffer:(uint8_t *)buffer 1159 intoBuffer:(uint8_t *)buffer
1155 maxLength:(NSUInteger)length 1160 maxLength:(NSUInteger)length
1156 { 1161 {
  1162 +#pragma clang diagnostic push
  1163 +#pragma clang diagnostic ignored "-Wgnu"
1157 NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length)); 1164 NSRange range = NSMakeRange((NSUInteger)_phaseReadOffset, MIN([data length] - ((NSUInteger)_phaseReadOffset), length));
1158 [data getBytes:buffer range:range]; 1165 [data getBytes:buffer range:range];
  1166 +#pragma clang diagnostic pop
1159 1167
1160 _phaseReadOffset += range.length; 1168 _phaseReadOffset += range.length;
1161 1169
@@ -1174,6 +1182,8 @@ typedef enum { @@ -1174,6 +1182,8 @@ typedef enum {
1174 return YES; 1182 return YES;
1175 } 1183 }
1176 1184
  1185 +#pragma clang diagnostic push
  1186 +#pragma clang diagnostic ignored "-Wcovered-switch-default"
1177 switch (_phase) { 1187 switch (_phase) {
1178 case AFEncapsulationBoundaryPhase: 1188 case AFEncapsulationBoundaryPhase:
1179 _phase = AFHeaderPhase; 1189 _phase = AFHeaderPhase;
@@ -1193,13 +1203,14 @@ typedef enum { @@ -1193,13 +1203,14 @@ typedef enum {
1193 break; 1203 break;
1194 } 1204 }
1195 _phaseReadOffset = 0; 1205 _phaseReadOffset = 0;
  1206 +#pragma clang diagnostic pop
1196 1207
1197 return YES; 1208 return YES;
1198 } 1209 }
1199 1210
1200 #pragma mark - NSCopying 1211 #pragma mark - NSCopying
1201 1212
1202 -- (instancetype)copyWithZone:(NSZone *)zone { 1213 +- (id)copyWithZone:(NSZone *)zone {
1203 AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init]; 1214 AFHTTPBodyPart *bodyPart = [[[self class] allocWithZone:zone] init];
1204 1215
1205 bodyPart.stringEncoding = self.stringEncoding; 1216 bodyPart.stringEncoding = self.stringEncoding;
@@ -1254,21 +1265,7 @@ typedef enum { @@ -1254,21 +1265,7 @@ typedef enum {
1254 [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; 1265 [mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
1255 } 1266 }
1256 1267
1257 - if (![NSJSONSerialization isValidJSONObject:parameters]) {  
1258 - if (error) {  
1259 - NSDictionary *userInfo = @{NSLocalizedFailureReasonErrorKey: NSLocalizedStringFromTable(@"The `parameters` argument is not valid JSON.", @"AFNetworking", nil)};  
1260 - *error = [[NSError alloc] initWithDomain:AFURLRequestSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];  
1261 - }  
1262 - return nil;  
1263 - }  
1264 -  
1265 - NSData *jsonData = [NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error];  
1266 -  
1267 - if (!jsonData) {  
1268 - return nil;  
1269 - }  
1270 -  
1271 - [mutableRequest setHTTPBody:jsonData]; 1268 + [mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]];
1272 } 1269 }
1273 1270
1274 return mutableRequest; 1271 return mutableRequest;
@@ -1276,7 +1273,7 @@ typedef enum { @@ -1276,7 +1273,7 @@ typedef enum {
1276 1273
1277 #pragma mark - NSSecureCoding 1274 #pragma mark - NSSecureCoding
1278 1275
1279 -- (instancetype)initWithCoder:(NSCoder *)decoder { 1276 +- (id)initWithCoder:(NSCoder *)decoder {
1280 self = [super initWithCoder:decoder]; 1277 self = [super initWithCoder:decoder];
1281 if (!self) { 1278 if (!self) {
1282 return nil; 1279 return nil;
@@ -1295,7 +1292,7 @@ typedef enum { @@ -1295,7 +1292,7 @@ typedef enum {
1295 1292
1296 #pragma mark - NSCopying 1293 #pragma mark - NSCopying
1297 1294
1298 -- (instancetype)copyWithZone:(NSZone *)zone { 1295 +- (id)copyWithZone:(NSZone *)zone {
1299 AFJSONRequestSerializer *serializer = [super copyWithZone:zone]; 1296 AFJSONRequestSerializer *serializer = [super copyWithZone:zone];
1300 serializer.writingOptions = self.writingOptions; 1297 serializer.writingOptions = self.writingOptions;
1301 1298
@@ -1347,13 +1344,7 @@ typedef enum { @@ -1347,13 +1344,7 @@ typedef enum {
1347 [mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"]; 1344 [mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"];
1348 } 1345 }
1349 1346
1350 - NSData *plistData = [NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error];  
1351 -  
1352 - if (!plistData) {  
1353 - return nil;  
1354 - }  
1355 -  
1356 - [mutableRequest setHTTPBody:plistData]; 1347 + [mutableRequest setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:self.format options:self.writeOptions error:error]];
1357 } 1348 }
1358 1349
1359 return mutableRequest; 1350 return mutableRequest;
@@ -1361,13 +1352,13 @@ typedef enum { @@ -1361,13 +1352,13 @@ typedef enum {
1361 1352
1362 #pragma mark - NSSecureCoding 1353 #pragma mark - NSSecureCoding
1363 1354
1364 -- (instancetype)initWithCoder:(NSCoder *)decoder { 1355 +- (id)initWithCoder:(NSCoder *)decoder {
1365 self = [super initWithCoder:decoder]; 1356 self = [super initWithCoder:decoder];
1366 if (!self) { 1357 if (!self) {
1367 return nil; 1358 return nil;
1368 } 1359 }
1369 1360
1370 - self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; 1361 + self.format = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
1371 self.writeOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writeOptions))] unsignedIntegerValue]; 1362 self.writeOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(writeOptions))] unsignedIntegerValue];
1372 1363
1373 return self; 1364 return self;
@@ -1382,7 +1373,7 @@ typedef enum { @@ -1382,7 +1373,7 @@ typedef enum {
1382 1373
1383 #pragma mark - NSCopying 1374 #pragma mark - NSCopying
1384 1375
1385 -- (instancetype)copyWithZone:(NSZone *)zone { 1376 +- (id)copyWithZone:(NSZone *)zone {
1386 AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone]; 1377 AFPropertyListRequestSerializer *serializer = [super copyWithZone:zone];
1387 serializer.format = self.format; 1378 serializer.format = self.format;
1388 serializer.writeOptions = self.writeOptions; 1379 serializer.writeOptions = self.writeOptions;
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFURLResponseSerialization.h
1 // AFURLResponseSerialization.h 1 // AFURLResponseSerialization.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -22,8 +22,6 @@ @@ -22,8 +22,6 @@
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 #import <CoreGraphics/CoreGraphics.h> 23 #import <CoreGraphics/CoreGraphics.h>
24 24
25 -NS_ASSUME_NONNULL_BEGIN  
26 -  
27 /** 25 /**
28 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. 26 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.
29 27
@@ -40,9 +38,9 @@ NS_ASSUME_NONNULL_BEGIN @@ -40,9 +38,9 @@ NS_ASSUME_NONNULL_BEGIN
40 38
41 @return The object decoded from the specified response data. 39 @return The object decoded from the specified response data.
42 */ 40 */
43 -- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response  
44 - data:(nullable NSData *)data  
45 - error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; 41 +- (id)responseObjectForResponse:(NSURLResponse *)response
  42 + data:(NSData *)data
  43 + error:(NSError *__autoreleasing *)error;
46 44
47 @end 45 @end
48 46
@@ -55,9 +53,12 @@ NS_ASSUME_NONNULL_BEGIN @@ -55,9 +53,12 @@ NS_ASSUME_NONNULL_BEGIN
55 */ 53 */
56 @interface AFHTTPResponseSerializer : NSObject <AFURLResponseSerialization> 54 @interface AFHTTPResponseSerializer : NSObject <AFURLResponseSerialization>
57 55
58 -- (instancetype)init; 56 +- (instancetype) init;
59 57
60 -@property (nonatomic, assign) NSStringEncoding stringEncoding DEPRECATED_MSG_ATTRIBUTE("The string encoding is never used. AFHTTPResponseSerializer only validates status codes and content types but does not try to decode the received data in any way."); 58 +/**
  59 + The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default.
  60 + */
  61 +@property (nonatomic, assign) NSStringEncoding stringEncoding;
61 62
62 /** 63 /**
63 Creates and returns a serializer with default configuration. 64 Creates and returns a serializer with default configuration.
@@ -73,12 +74,12 @@ NS_ASSUME_NONNULL_BEGIN @@ -73,12 +74,12 @@ NS_ASSUME_NONNULL_BEGIN
73 74
74 See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html 75 See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
75 */ 76 */
76 -@property (nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes; 77 +@property (nonatomic, copy) NSIndexSet *acceptableStatusCodes;
77 78
78 /** 79 /**
79 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. 80 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.
80 */ 81 */
81 -@property (nonatomic, copy, nullable) NSSet <NSString *> *acceptableContentTypes; 82 +@property (nonatomic, copy) NSSet *acceptableContentTypes;
82 83
83 /** 84 /**
84 Validates the specified response and data. 85 Validates the specified response and data.
@@ -91,9 +92,9 @@ NS_ASSUME_NONNULL_BEGIN @@ -91,9 +92,9 @@ NS_ASSUME_NONNULL_BEGIN
91 92
92 @return `YES` if the response is valid, otherwise `NO`. 93 @return `YES` if the response is valid, otherwise `NO`.
93 */ 94 */
94 -- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response  
95 - data:(nullable NSData *)data  
96 - error:(NSError * _Nullable __autoreleasing *)error; 95 +- (BOOL)validateResponse:(NSHTTPURLResponse *)response
  96 + data:(NSData *)data
  97 + error:(NSError *__autoreleasing *)error;
97 98
98 @end 99 @end
99 100
@@ -111,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -111,7 +112,7 @@ NS_ASSUME_NONNULL_BEGIN
111 */ 112 */
112 @interface AFJSONResponseSerializer : AFHTTPResponseSerializer 113 @interface AFJSONResponseSerializer : AFHTTPResponseSerializer
113 114
114 -- (instancetype)init; 115 +- (instancetype) init;
115 116
116 /** 117 /**
117 Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. 118 Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
@@ -160,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -160,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN
160 */ 161 */
161 @interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer 162 @interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer
162 163
163 -- (instancetype)init; 164 +- (instancetype) init;
164 165
165 /** 166 /**
166 Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. 167 Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
@@ -189,7 +190,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -189,7 +190,7 @@ NS_ASSUME_NONNULL_BEGIN
189 */ 190 */
190 @interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer 191 @interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer
191 192
192 -- (instancetype)init; 193 +- (instancetype) init;
193 194
194 /** 195 /**
195 The property list format. Possible values are described in "NSPropertyListFormat". 196 The property list format. Possible values are described in "NSPropertyListFormat".
@@ -232,7 +233,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -232,7 +233,7 @@ NS_ASSUME_NONNULL_BEGIN
232 */ 233 */
233 @interface AFImageResponseSerializer : AFHTTPResponseSerializer 234 @interface AFImageResponseSerializer : AFHTTPResponseSerializer
234 235
235 -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH 236 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
236 /** 237 /**
237 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. 238 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.
238 */ 239 */
@@ -256,14 +257,14 @@ NS_ASSUME_NONNULL_BEGIN @@ -256,14 +257,14 @@ NS_ASSUME_NONNULL_BEGIN
256 /** 257 /**
257 The component response serializers. 258 The component response serializers.
258 */ 259 */
259 -@property (readonly, nonatomic, copy) NSArray <id<AFURLResponseSerialization>> *responseSerializers; 260 +@property (readonly, nonatomic, copy) NSArray *responseSerializers;
260 261
261 /** 262 /**
262 Creates and returns a compound serializer comprised of the specified response serializers. 263 Creates and returns a compound serializer comprised of the specified response serializers.
263 264
264 @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`. 265 @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`.
265 */ 266 */
266 -+ (instancetype)compoundSerializerWithResponseSerializers:(NSArray <id<AFURLResponseSerialization>> *)responseSerializers; 267 ++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray *)responseSerializers;
267 268
268 @end 269 @end
269 270
@@ -283,7 +284,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -283,7 +284,7 @@ NS_ASSUME_NONNULL_BEGIN
283 `AFURLResponseSerializationErrorDomain` 284 `AFURLResponseSerializationErrorDomain`
284 AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. 285 AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`.
285 */ 286 */
286 -FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain; 287 +extern NSString * const AFURLResponseSerializationErrorDomain;
287 288
288 /** 289 /**
289 ## User info dictionary keys 290 ## User info dictionary keys
@@ -301,8 +302,8 @@ FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain; @@ -301,8 +302,8 @@ FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain;
301 `AFNetworkingOperationFailingURLResponseDataErrorKey` 302 `AFNetworkingOperationFailingURLResponseDataErrorKey`
302 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`. 303 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`.
303 */ 304 */
304 -FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseErrorKey; 305 +extern NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
  306 +
  307 +extern NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey;
305 308
306 -FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey;  
307 309
308 -NS_ASSUME_NONNULL_END  
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFURLResponseSerialization.m
1 // AFURLResponseSerialization.m 1 // AFURLResponseSerialization.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,12 +21,8 @@ @@ -21,12 +21,8 @@
21 21
22 #import "AFURLResponseSerialization.h" 22 #import "AFURLResponseSerialization.h"
23 23
24 -#import <TargetConditionals.h>  
25 -  
26 -#if TARGET_OS_IOS 24 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 #import <UIKit/UIKit.h> 25 #import <UIKit/UIKit.h>
28 -#elif TARGET_OS_WATCH  
29 -#import <WatchKit/WatchKit.h>  
30 #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) 26 #elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
31 #import <Cocoa/Cocoa.h> 27 #import <Cocoa/Cocoa.h>
32 #endif 28 #endif
@@ -71,11 +67,11 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -71,11 +67,11 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
71 } else if ([JSONObject isKindOfClass:[NSDictionary class]]) { 67 } else if ([JSONObject isKindOfClass:[NSDictionary class]]) {
72 NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:JSONObject]; 68 NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionaryWithDictionary:JSONObject];
73 for (id <NSCopying> key in [(NSDictionary *)JSONObject allKeys]) { 69 for (id <NSCopying> key in [(NSDictionary *)JSONObject allKeys]) {
74 - id value = (NSDictionary *)JSONObject[key]; 70 + id value = [(NSDictionary *)JSONObject objectForKey:key];
75 if (!value || [value isEqual:[NSNull null]]) { 71 if (!value || [value isEqual:[NSNull null]]) {
76 [mutableDictionary removeObjectForKey:key]; 72 [mutableDictionary removeObjectForKey:key];
77 } else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]]) { 73 } else if ([value isKindOfClass:[NSArray class]] || [value isKindOfClass:[NSDictionary class]]) {
78 - mutableDictionary[key] = AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions); 74 + [mutableDictionary setObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions) forKey:key];
79 } 75 }
80 } 76 }
81 77
@@ -97,6 +93,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -97,6 +93,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
97 return nil; 93 return nil;
98 } 94 }
99 95
  96 + self.stringEncoding = NSUTF8StringEncoding;
  97 +
100 self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)]; 98 self.acceptableStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(200, 100)];
101 self.acceptableContentTypes = nil; 99 self.acceptableContentTypes = nil;
102 100
@@ -113,9 +111,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -113,9 +111,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
113 NSError *validationError = nil; 111 NSError *validationError = nil;
114 112
115 if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) { 113 if (response && [response isKindOfClass:[NSHTTPURLResponse class]]) {
116 - if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]] &&  
117 - !([response MIMEType] == nil && [data length] == 0)) {  
118 - 114 + if (self.acceptableContentTypes && ![self.acceptableContentTypes containsObject:[response MIMEType]]) {
119 if ([data length] > 0 && [response URL]) { 115 if ([data length] > 0 && [response URL]) {
120 NSMutableDictionary *mutableUserInfo = [@{ 116 NSMutableDictionary *mutableUserInfo = [@{
121 NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]], 117 NSLocalizedDescriptionKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Request failed: unacceptable content-type: %@", @"AFNetworking", nil), [response MIMEType]],
@@ -173,7 +169,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -173,7 +169,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
173 return YES; 169 return YES;
174 } 170 }
175 171
176 -- (instancetype)initWithCoder:(NSCoder *)decoder { 172 +- (id)initWithCoder:(NSCoder *)decoder {
177 self = [self init]; 173 self = [self init];
178 if (!self) { 174 if (!self) {
179 return nil; 175 return nil;
@@ -192,7 +188,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -192,7 +188,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
192 188
193 #pragma mark - NSCopying 189 #pragma mark - NSCopying
194 190
195 -- (instancetype)copyWithZone:(NSZone *)zone { 191 +- (id)copyWithZone:(NSZone *)zone {
196 AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init]; 192 AFHTTPResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
197 serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone]; 193 serializer.acceptableStatusCodes = [self.acceptableStatusCodes copyWithZone:zone];
198 serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone]; 194 serializer.acceptableContentTypes = [self.acceptableContentTypes copyWithZone:zone];
@@ -223,7 +219,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -223,7 +219,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
223 return nil; 219 return nil;
224 } 220 }
225 221
226 - self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", @"text/plain", nil]; 222 + self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];
227 223
228 return self; 224 return self;
229 } 225 }
@@ -242,26 +238,51 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -242,26 +238,51 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
242 238
243 // 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. 239 // 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.
244 // See https://github.com/rails/rails/issues/1742 240 // See https://github.com/rails/rails/issues/1742
245 - BOOL isSpace = [data isEqualToData:[NSData dataWithBytes:" " length:1]];  
246 -  
247 - if (data.length == 0 || isSpace) {  
248 - return nil; 241 + NSStringEncoding stringEncoding = self.stringEncoding;
  242 + if (response.textEncodingName) {
  243 + CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
  244 + if (encoding != kCFStringEncodingInvalidId) {
  245 + stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
  246 + }
249 } 247 }
250 - 248 +
  249 + id responseObject = nil;
251 NSError *serializationError = nil; 250 NSError *serializationError = nil;
252 -  
253 - id responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError]; 251 + @autoreleasepool {
  252 + NSString *responseString = [[NSString alloc] initWithData:data encoding:stringEncoding];
  253 +
  254 + /*change true/false to nsstring add by lc*/
  255 + responseString = [responseString stringByReplacingOccurrencesOfString:@":true" withString:@":\"true\""];
  256 + responseString = [responseString stringByReplacingOccurrencesOfString:@":false" withString:@":\"false\""];
  257 +
  258 + if (responseString && ![responseString isEqualToString:@" "]) {
  259 + // Workaround for a bug in NSJSONSerialization when Unicode character escape codes are used instead of the actual character
  260 + // See http://stackoverflow.com/a/12843465/157142
  261 + data = [responseString dataUsingEncoding:NSUTF8StringEncoding];
254 262
255 - if (!responseObject)  
256 - {  
257 - if (error) {  
258 - *error = AFErrorWithUnderlyingError(serializationError, *error); 263 + if (data) {
  264 + if ([data length] > 0) {
  265 + responseObject = [NSJSONSerialization JSONObjectWithData:data options:self.readingOptions error:&serializationError];
  266 + } else {
  267 + return nil;
  268 + }
  269 + } else {
  270 + NSDictionary *userInfo = @{
  271 + NSLocalizedDescriptionKey: NSLocalizedStringFromTable(@"Data failed decoding as a UTF-8 string", @"AFNetworking", nil),
  272 + NSLocalizedFailureReasonErrorKey: [NSString stringWithFormat:NSLocalizedStringFromTable(@"Could not decode string: %@", @"AFNetworking", nil), responseString]
  273 + };
  274 +
  275 + serializationError = [NSError errorWithDomain:AFURLResponseSerializationErrorDomain code:NSURLErrorCannotDecodeContentData userInfo:userInfo];
  276 + }
259 } 277 }
260 - return nil;  
261 } 278 }
262 -  
263 - if (self.removesKeysWithNullValues) {  
264 - return AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions); 279 +
  280 + if (self.removesKeysWithNullValues && responseObject) {
  281 + responseObject = AFJSONObjectByRemovingKeysWithNullValues(responseObject, self.readingOptions);
  282 + }
  283 +
  284 + if (error) {
  285 + *error = AFErrorWithUnderlyingError(serializationError, *error);
265 } 286 }
266 287
267 return responseObject; 288 return responseObject;
@@ -269,7 +290,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -269,7 +290,7 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
269 290
270 #pragma mark - NSSecureCoding 291 #pragma mark - NSSecureCoding
271 292
272 -- (instancetype)initWithCoder:(NSCoder *)decoder { 293 +- (id)initWithCoder:(NSCoder *)decoder {
273 self = [super initWithCoder:decoder]; 294 self = [super initWithCoder:decoder];
274 if (!self) { 295 if (!self) {
275 return nil; 296 return nil;
@@ -290,8 +311,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -290,8 +311,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
290 311
291 #pragma mark - NSCopying 312 #pragma mark - NSCopying
292 313
293 -- (instancetype)copyWithZone:(NSZone *)zone {  
294 - AFJSONResponseSerializer *serializer = [super copyWithZone:zone]; 314 +- (id)copyWithZone:(NSZone *)zone {
  315 + AFJSONResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
295 serializer.readingOptions = self.readingOptions; 316 serializer.readingOptions = self.readingOptions;
296 serializer.removesKeysWithNullValues = self.removesKeysWithNullValues; 317 serializer.removesKeysWithNullValues = self.removesKeysWithNullValues;
297 318
@@ -381,20 +402,16 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -381,20 +402,16 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
381 NSError *serializationError = nil; 402 NSError *serializationError = nil;
382 NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError]; 403 NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:self.options error:&serializationError];
383 404
384 - if (!document)  
385 - {  
386 - if (error) {  
387 - *error = AFErrorWithUnderlyingError(serializationError, *error);  
388 - }  
389 - return nil; 405 + if (error) {
  406 + *error = AFErrorWithUnderlyingError(serializationError, *error);
390 } 407 }
391 - 408 +
392 return document; 409 return document;
393 } 410 }
394 411
395 #pragma mark - NSSecureCoding 412 #pragma mark - NSSecureCoding
396 413
397 -- (instancetype)initWithCoder:(NSCoder *)decoder { 414 +- (id)initWithCoder:(NSCoder *)decoder {
398 self = [super initWithCoder:decoder]; 415 self = [super initWithCoder:decoder];
399 if (!self) { 416 if (!self) {
400 return nil; 417 return nil;
@@ -413,8 +430,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -413,8 +430,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
413 430
414 #pragma mark - NSCopying 431 #pragma mark - NSCopying
415 432
416 -- (instancetype)copyWithZone:(NSZone *)zone {  
417 - AFXMLDocumentResponseSerializer *serializer = [super copyWithZone:zone]; 433 +- (id)copyWithZone:(NSZone *)zone {
  434 + AFXMLDocumentResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
418 serializer.options = self.options; 435 serializer.options = self.options;
419 436
420 return serializer; 437 return serializer;
@@ -465,20 +482,15 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -465,20 +482,15 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
465 } 482 }
466 } 483 }
467 484
468 - if (!data) {  
469 - return nil;  
470 - }  
471 - 485 + id responseObject;
472 NSError *serializationError = nil; 486 NSError *serializationError = nil;
473 -  
474 - id responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];  
475 -  
476 - if (!responseObject)  
477 - {  
478 - if (error) {  
479 - *error = AFErrorWithUnderlyingError(serializationError, *error);  
480 - }  
481 - return nil; 487 +
  488 + if (data) {
  489 + responseObject = [NSPropertyListSerialization propertyListWithData:data options:self.readOptions format:NULL error:&serializationError];
  490 + }
  491 +
  492 + if (error) {
  493 + *error = AFErrorWithUnderlyingError(serializationError, *error);
482 } 494 }
483 495
484 return responseObject; 496 return responseObject;
@@ -486,13 +498,13 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -486,13 +498,13 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
486 498
487 #pragma mark - NSSecureCoding 499 #pragma mark - NSSecureCoding
488 500
489 -- (instancetype)initWithCoder:(NSCoder *)decoder { 501 +- (id)initWithCoder:(NSCoder *)decoder {
490 self = [super initWithCoder:decoder]; 502 self = [super initWithCoder:decoder];
491 if (!self) { 503 if (!self) {
492 return nil; 504 return nil;
493 } 505 }
494 506
495 - self.format = (NSPropertyListFormat)[[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue]; 507 + self.format = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(format))] unsignedIntegerValue];
496 self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue]; 508 self.readOptions = [[decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(readOptions))] unsignedIntegerValue];
497 509
498 return self; 510 return self;
@@ -507,8 +519,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -507,8 +519,8 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
507 519
508 #pragma mark - NSCopying 520 #pragma mark - NSCopying
509 521
510 -- (instancetype)copyWithZone:(NSZone *)zone {  
511 - AFPropertyListResponseSerializer *serializer = [super copyWithZone:zone]; 522 +- (id)copyWithZone:(NSZone *)zone {
  523 + AFPropertyListResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
512 serializer.format = self.format; 524 serializer.format = self.format;
513 serializer.readOptions = self.readOptions; 525 serializer.readOptions = self.readOptions;
514 526
@@ -519,39 +531,15 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO @@ -519,39 +531,15 @@ static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingO
519 531
520 #pragma mark - 532 #pragma mark -
521 533
522 -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH 534 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
523 #import <CoreGraphics/CoreGraphics.h> 535 #import <CoreGraphics/CoreGraphics.h>
524 -#import <UIKit/UIKit.h>  
525 -  
526 -@interface UIImage (AFNetworkingSafeImageLoading)  
527 -+ (UIImage *)af_safeImageWithData:(NSData *)data;  
528 -@end  
529 -  
530 -static NSLock* imageLock = nil;  
531 -  
532 -@implementation UIImage (AFNetworkingSafeImageLoading)  
533 -  
534 -+ (UIImage *)af_safeImageWithData:(NSData *)data {  
535 - UIImage* image = nil;  
536 - static dispatch_once_t onceToken;  
537 - dispatch_once(&onceToken, ^{  
538 - imageLock = [[NSLock alloc] init];  
539 - });  
540 -  
541 - [imageLock lock];  
542 - image = [UIImage imageWithData:data];  
543 - [imageLock unlock];  
544 - return image;  
545 -}  
546 -  
547 -@end  
548 536
549 static UIImage * AFImageWithDataAtScale(NSData *data, CGFloat scale) { 537 static UIImage * AFImageWithDataAtScale(NSData *data, CGFloat scale) {
550 - UIImage *image = [UIImage af_safeImageWithData:data]; 538 + UIImage *image = [[UIImage alloc] initWithData:data];
551 if (image.images) { 539 if (image.images) {
552 return image; 540 return image;
553 } 541 }
554 - 542 +
555 return [[UIImage alloc] initWithCGImage:[image CGImage] scale:scale orientation:image.imageOrientation]; 543 return [[UIImage alloc] initWithCGImage:[image CGImage] scale:scale orientation:image.imageOrientation];
556 } 544 }
557 545
@@ -659,12 +647,9 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r @@ -659,12 +647,9 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
659 647
660 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]; 648 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];
661 649
662 -#if TARGET_OS_IOS || TARGET_OS_TV 650 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
663 self.imageScale = [[UIScreen mainScreen] scale]; 651 self.imageScale = [[UIScreen mainScreen] scale];
664 self.automaticallyInflatesResponseImage = YES; 652 self.automaticallyInflatesResponseImage = YES;
665 -#elif TARGET_OS_WATCH  
666 - self.imageScale = [[WKInterfaceDevice currentDevice] screenScale];  
667 - self.automaticallyInflatesResponseImage = YES;  
668 #endif 653 #endif
669 654
670 return self; 655 return self;
@@ -682,13 +667,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r @@ -682,13 +667,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
682 } 667 }
683 } 668 }
684 669
685 -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH 670 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
686 if (self.automaticallyInflatesResponseImage) { 671 if (self.automaticallyInflatesResponseImage) {
687 return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale); 672 return AFInflatedImageFromResponseWithDataAtScale((NSHTTPURLResponse *)response, data, self.imageScale);
688 } else { 673 } else {
689 return AFImageWithDataAtScale(data, self.imageScale); 674 return AFImageWithDataAtScale(data, self.imageScale);
690 } 675 }
691 -#else 676 +#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
692 // Ensure that the image is set to it's correct pixel width and height 677 // Ensure that the image is set to it's correct pixel width and height
693 NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data]; 678 NSBitmapImageRep *bitimage = [[NSBitmapImageRep alloc] initWithData:data];
694 NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])]; 679 NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize([bitimage pixelsWide], [bitimage pixelsHigh])];
@@ -702,13 +687,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r @@ -702,13 +687,13 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
702 687
703 #pragma mark - NSSecureCoding 688 #pragma mark - NSSecureCoding
704 689
705 -- (instancetype)initWithCoder:(NSCoder *)decoder { 690 +- (id)initWithCoder:(NSCoder *)decoder {
706 self = [super initWithCoder:decoder]; 691 self = [super initWithCoder:decoder];
707 if (!self) { 692 if (!self) {
708 return nil; 693 return nil;
709 } 694 }
710 695
711 -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH 696 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
712 NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))]; 697 NSNumber *imageScale = [decoder decodeObjectOfClass:[NSNumber class] forKey:NSStringFromSelector(@selector(imageScale))];
713 #if CGFLOAT_IS_DOUBLE 698 #if CGFLOAT_IS_DOUBLE
714 self.imageScale = [imageScale doubleValue]; 699 self.imageScale = [imageScale doubleValue];
@@ -725,7 +710,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r @@ -725,7 +710,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
725 - (void)encodeWithCoder:(NSCoder *)coder { 710 - (void)encodeWithCoder:(NSCoder *)coder {
726 [super encodeWithCoder:coder]; 711 [super encodeWithCoder:coder];
727 712
728 -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH 713 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
729 [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))]; 714 [coder encodeObject:@(self.imageScale) forKey:NSStringFromSelector(@selector(imageScale))];
730 [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))]; 715 [coder encodeBool:self.automaticallyInflatesResponseImage forKey:NSStringFromSelector(@selector(automaticallyInflatesResponseImage))];
731 #endif 716 #endif
@@ -733,10 +718,10 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r @@ -733,10 +718,10 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
733 718
734 #pragma mark - NSCopying 719 #pragma mark - NSCopying
735 720
736 -- (instancetype)copyWithZone:(NSZone *)zone {  
737 - AFImageResponseSerializer *serializer = [super copyWithZone:zone]; 721 +- (id)copyWithZone:(NSZone *)zone {
  722 + AFImageResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
738 723
739 -#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH 724 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
740 serializer.imageScale = self.imageScale; 725 serializer.imageScale = self.imageScale;
741 serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage; 726 serializer.automaticallyInflatesResponseImage = self.automaticallyInflatesResponseImage;
742 #endif 727 #endif
@@ -788,7 +773,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r @@ -788,7 +773,7 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
788 773
789 #pragma mark - NSSecureCoding 774 #pragma mark - NSSecureCoding
790 775
791 -- (instancetype)initWithCoder:(NSCoder *)decoder { 776 +- (id)initWithCoder:(NSCoder *)decoder {
792 self = [super initWithCoder:decoder]; 777 self = [super initWithCoder:decoder];
793 if (!self) { 778 if (!self) {
794 return nil; 779 return nil;
@@ -807,8 +792,8 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r @@ -807,8 +792,8 @@ static UIImage * AFInflatedImageFromResponseWithDataAtScale(NSHTTPURLResponse *r
807 792
808 #pragma mark - NSCopying 793 #pragma mark - NSCopying
809 794
810 -- (instancetype)copyWithZone:(NSZone *)zone {  
811 - AFCompoundResponseSerializer *serializer = [super copyWithZone:zone]; 795 +- (id)copyWithZone:(NSZone *)zone {
  796 + AFCompoundResponseSerializer *serializer = [[[self class] allocWithZone:zone] init];
812 serializer.responseSerializers = self.responseSerializers; 797 serializer.responseSerializers = self.responseSerializers;
813 798
814 return serializer; 799 return serializer;
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFURLSessionManager.h
1 // AFURLSessionManager.h 1 // AFURLSessionManager.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -19,14 +19,19 @@ @@ -19,14 +19,19 @@
19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 // THE SOFTWARE. 20 // THE SOFTWARE.
21 21
22 -  
23 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
24 23
25 #import "AFURLResponseSerialization.h" 24 #import "AFURLResponseSerialization.h"
26 #import "AFURLRequestSerialization.h" 25 #import "AFURLRequestSerialization.h"
27 #import "AFSecurityPolicy.h" 26 #import "AFSecurityPolicy.h"
28 -#if !TARGET_OS_WATCH  
29 #import "AFNetworkReachabilityManager.h" 27 #import "AFNetworkReachabilityManager.h"
  28 +
  29 +#ifndef NS_DESIGNATED_INITIALIZER
  30 +#if __has_attribute(objc_designated_initializer)
  31 +#define NS_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
  32 +#else
  33 +#define NS_DESIGNATED_INITIALIZER
  34 +#endif
30 #endif 35 #endif
31 36
32 /** 37 /**
@@ -51,7 +56,6 @@ @@ -51,7 +56,6 @@
51 - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:` 56 - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`
52 - `URLSession:task:didReceiveChallenge:completionHandler:` 57 - `URLSession:task:didReceiveChallenge:completionHandler:`
53 - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:` 58 - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`
54 - - `URLSession:task:needNewBodyStream:`  
55 - `URLSession:task:didCompleteWithError:` 59 - `URLSession:task:didCompleteWithError:`
56 60
57 ### `NSURLSessionDataDelegate` 61 ### `NSURLSessionDataDelegate`
@@ -85,7 +89,7 @@ @@ -85,7 +89,7 @@
85 @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. 89 @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.
86 */ 90 */
87 91
88 -NS_ASSUME_NONNULL_BEGIN 92 +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
89 93
90 @interface AFURLSessionManager : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSSecureCoding, NSCopying> 94 @interface AFURLSessionManager : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate, NSSecureCoding, NSCopying>
91 95
@@ -111,11 +115,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -111,11 +115,10 @@ NS_ASSUME_NONNULL_BEGIN
111 ///------------------------------- 115 ///-------------------------------
112 116
113 /** 117 /**
114 - The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. 118 + The security policy used by created request operations to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified.
115 */ 119 */
116 @property (nonatomic, strong) AFSecurityPolicy *securityPolicy; 120 @property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
117 121
118 -#if !TARGET_OS_WATCH  
119 ///-------------------------------------- 122 ///--------------------------------------
120 /// @name Monitoring Network Reachability 123 /// @name Monitoring Network Reachability
121 ///-------------------------------------- 124 ///--------------------------------------
@@ -124,7 +127,6 @@ NS_ASSUME_NONNULL_BEGIN @@ -124,7 +127,6 @@ NS_ASSUME_NONNULL_BEGIN
124 The network reachability manager. `AFURLSessionManager` uses the `sharedManager` by default. 127 The network reachability manager. `AFURLSessionManager` uses the `sharedManager` by default.
125 */ 128 */
126 @property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager; 129 @property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager;
127 -#endif  
128 130
129 ///---------------------------- 131 ///----------------------------
130 /// @name Getting Session Tasks 132 /// @name Getting Session Tasks
@@ -133,22 +135,22 @@ NS_ASSUME_NONNULL_BEGIN @@ -133,22 +135,22 @@ NS_ASSUME_NONNULL_BEGIN
133 /** 135 /**
134 The data, upload, and download tasks currently run by the managed session. 136 The data, upload, and download tasks currently run by the managed session.
135 */ 137 */
136 -@property (readonly, nonatomic, strong) NSArray <NSURLSessionTask *> *tasks; 138 +@property (readonly, nonatomic, strong) NSArray *tasks;
137 139
138 /** 140 /**
139 The data tasks currently run by the managed session. 141 The data tasks currently run by the managed session.
140 */ 142 */
141 -@property (readonly, nonatomic, strong) NSArray <NSURLSessionDataTask *> *dataTasks; 143 +@property (readonly, nonatomic, strong) NSArray *dataTasks;
142 144
143 /** 145 /**
144 The upload tasks currently run by the managed session. 146 The upload tasks currently run by the managed session.
145 */ 147 */
146 -@property (readonly, nonatomic, strong) NSArray <NSURLSessionUploadTask *> *uploadTasks; 148 +@property (readonly, nonatomic, strong) NSArray *uploadTasks;
147 149
148 /** 150 /**
149 The download tasks currently run by the managed session. 151 The download tasks currently run by the managed session.
150 */ 152 */
151 -@property (readonly, nonatomic, strong) NSArray <NSURLSessionDownloadTask *> *downloadTasks; 153 +@property (readonly, nonatomic, strong) NSArray *downloadTasks;
152 154
153 ///------------------------------- 155 ///-------------------------------
154 /// @name Managing Callback Queues 156 /// @name Managing Callback Queues
@@ -157,12 +159,20 @@ NS_ASSUME_NONNULL_BEGIN @@ -157,12 +159,20 @@ NS_ASSUME_NONNULL_BEGIN
157 /** 159 /**
158 The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used. 160 The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used.
159 */ 161 */
160 -@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; 162 +#if OS_OBJECT_HAVE_OBJC_SUPPORT
  163 +@property (nonatomic, strong) dispatch_queue_t completionQueue;
  164 +#else
  165 +@property (nonatomic, assign) dispatch_queue_t completionQueue;
  166 +#endif
161 167
162 /** 168 /**
163 The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used. 169 The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used.
164 */ 170 */
165 -@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; 171 +#if OS_OBJECT_HAVE_OBJC_SUPPORT
  172 +@property (nonatomic, strong) dispatch_group_t completionGroup;
  173 +#else
  174 +@property (nonatomic, assign) dispatch_group_t completionGroup;
  175 +#endif
166 176
167 ///--------------------------------- 177 ///---------------------------------
168 /// @name Working Around System Bugs 178 /// @name Working Around System Bugs
@@ -188,7 +198,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -188,7 +198,7 @@ NS_ASSUME_NONNULL_BEGIN
188 198
189 @return A manager for a newly-created session. 199 @return A manager for a newly-created session.
190 */ 200 */
191 -- (instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; 201 +- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
192 202
193 /** 203 /**
194 Invalidates the managed session, optionally canceling pending tasks. 204 Invalidates the managed session, optionally canceling pending tasks.
@@ -208,20 +218,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -208,20 +218,7 @@ NS_ASSUME_NONNULL_BEGIN
208 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. 218 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
209 */ 219 */
210 - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request 220 - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
211 - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler DEPRECATED_ATTRIBUTE;  
212 -  
213 -/**  
214 - Creates an `NSURLSessionDataTask` with the specified request.  
215 -  
216 - @param request The HTTP request for the request.  
217 - @param uploadProgressBlock 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.  
218 - @param downloadProgressBlock 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.  
219 - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.  
220 - */  
221 -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request  
222 - uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock  
223 - downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock  
224 - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; 221 + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
225 222
226 ///--------------------------- 223 ///---------------------------
227 /// @name Running Upload Tasks 224 /// @name Running Upload Tasks
@@ -232,39 +229,39 @@ NS_ASSUME_NONNULL_BEGIN @@ -232,39 +229,39 @@ NS_ASSUME_NONNULL_BEGIN
232 229
233 @param request The HTTP request for the request. 230 @param request The HTTP request for the request.
234 @param fileURL A URL to the local file to be uploaded. 231 @param fileURL A URL to the local file to be uploaded.
235 - @param uploadProgressBlock 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. 232 + @param progress A progress object monitoring the current upload progress.
236 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. 233 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
237 234
238 @see `attemptsToRecreateUploadTasksForBackgroundSessions` 235 @see `attemptsToRecreateUploadTasksForBackgroundSessions`
239 */ 236 */
240 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request 237 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
241 fromFile:(NSURL *)fileURL 238 fromFile:(NSURL *)fileURL
242 - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock  
243 - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; 239 + progress:(NSProgress * __autoreleasing *)progress
  240 + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
244 241
245 /** 242 /**
246 Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body. 243 Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body.
247 244
248 @param request The HTTP request for the request. 245 @param request The HTTP request for the request.
249 @param bodyData A data object containing the HTTP body to be uploaded. 246 @param bodyData A data object containing the HTTP body to be uploaded.
250 - @param uploadProgressBlock 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. 247 + @param progress A progress object monitoring the current upload progress.
251 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. 248 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
252 */ 249 */
253 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request 250 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
254 - fromData:(nullable NSData *)bodyData  
255 - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock  
256 - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; 251 + fromData:(NSData *)bodyData
  252 + progress:(NSProgress * __autoreleasing *)progress
  253 + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
257 254
258 /** 255 /**
259 Creates an `NSURLSessionUploadTask` with the specified streaming request. 256 Creates an `NSURLSessionUploadTask` with the specified streaming request.
260 257
261 @param request The HTTP request for the request. 258 @param request The HTTP request for the request.
262 - @param uploadProgressBlock 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. 259 + @param progress A progress object monitoring the current upload progress.
263 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. 260 @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any.
264 */ 261 */
265 - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request 262 - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
266 - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock  
267 - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; 263 + progress:(NSProgress * __autoreleasing *)progress
  264 + completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler;
268 265
269 ///----------------------------- 266 ///-----------------------------
270 /// @name Running Download Tasks 267 /// @name Running Download Tasks
@@ -274,29 +271,29 @@ NS_ASSUME_NONNULL_BEGIN @@ -274,29 +271,29 @@ NS_ASSUME_NONNULL_BEGIN
274 Creates an `NSURLSessionDownloadTask` with the specified request. 271 Creates an `NSURLSessionDownloadTask` with the specified request.
275 272
276 @param request The HTTP request for the request. 273 @param request The HTTP request for the request.
277 - @param downloadProgressBlock 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. 274 + @param progress A progress object monitoring the current download progress.
278 @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. 275 @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL.
279 @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. 276 @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any.
280 277
281 @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method. 278 @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method.
282 */ 279 */
283 - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request 280 - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request
284 - progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock  
285 - destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination  
286 - completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; 281 + progress:(NSProgress * __autoreleasing *)progress
  282 + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
  283 + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler;
287 284
288 /** 285 /**
289 Creates an `NSURLSessionDownloadTask` with the specified resume data. 286 Creates an `NSURLSessionDownloadTask` with the specified resume data.
290 287
291 @param resumeData The data used to resume downloading. 288 @param resumeData The data used to resume downloading.
292 - @param downloadProgressBlock 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. 289 + @param progress A progress object monitoring the current download progress.
293 @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. 290 @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL.
294 @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. 291 @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any.
295 */ 292 */
296 - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData 293 - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData
297 - progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock  
298 - destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination  
299 - completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; 294 + progress:(NSProgress * __autoreleasing *)progress
  295 + destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
  296 + completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler;
300 297
301 ///--------------------------------- 298 ///---------------------------------
302 /// @name Getting Progress for Tasks 299 /// @name Getting Progress for Tasks
@@ -305,20 +302,20 @@ NS_ASSUME_NONNULL_BEGIN @@ -305,20 +302,20 @@ NS_ASSUME_NONNULL_BEGIN
305 /** 302 /**
306 Returns the upload progress of the specified task. 303 Returns the upload progress of the specified task.
307 304
308 - @param task The session task. Must not be `nil`. 305 + @param uploadTask The session upload task. Must not be `nil`.
309 306
310 @return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable. 307 @return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable.
311 */ 308 */
312 -- (nullable NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task; 309 +- (NSProgress *)uploadProgressForTask:(NSURLSessionUploadTask *)uploadTask;
313 310
314 /** 311 /**
315 Returns the download progress of the specified task. 312 Returns the download progress of the specified task.
316 313
317 - @param task The session task. Must not be `nil`. 314 + @param downloadTask The session download task. Must not be `nil`.
318 315
319 @return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable. 316 @return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable.
320 */ 317 */
321 -- (nullable NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task; 318 +- (NSProgress *)downloadProgressForTask:(NSURLSessionDownloadTask *)downloadTask;
322 319
323 ///----------------------------------------- 320 ///-----------------------------------------
324 /// @name Setting Session Delegate Callbacks 321 /// @name Setting Session Delegate Callbacks
@@ -329,14 +326,14 @@ NS_ASSUME_NONNULL_BEGIN @@ -329,14 +326,14 @@ NS_ASSUME_NONNULL_BEGIN
329 326
330 @param block A block object to be executed when the managed session becomes invalid. The block has no return value, and takes two arguments: the session, and the error related to the cause of invalidation. 327 @param block A block object to be executed when the managed session becomes invalid. The block has no return value, and takes two arguments: the session, and the error related to the cause of invalidation.
331 */ 328 */
332 -- (void)setSessionDidBecomeInvalidBlock:(nullable void (^)(NSURLSession *session, NSError *error))block; 329 +- (void)setSessionDidBecomeInvalidBlock:(void (^)(NSURLSession *session, NSError *error))block;
333 330
334 /** 331 /**
335 Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`. 332 Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`.
336 333
337 @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. 334 @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge.
338 */ 335 */
339 -- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; 336 +- (void)setSessionDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block;
340 337
341 ///-------------------------------------- 338 ///--------------------------------------
342 /// @name Setting Task Delegate Callbacks 339 /// @name Setting Task Delegate Callbacks
@@ -347,35 +344,35 @@ NS_ASSUME_NONNULL_BEGIN @@ -347,35 +344,35 @@ NS_ASSUME_NONNULL_BEGIN
347 344
348 @param block A block object to be executed when a task requires a new request body stream. 345 @param block A block object to be executed when a task requires a new request body stream.
349 */ 346 */
350 -- (void)setTaskNeedNewBodyStreamBlock:(nullable NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block; 347 +- (void)setTaskNeedNewBodyStreamBlock:(NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block;
351 348
352 /** 349 /**
353 Sets a block to be executed when an HTTP request is attempting to perform a redirection to a different URL, as handled by the `NSURLSessionTaskDelegate` method `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`. 350 Sets a block to be executed when an HTTP request is attempting to perform a redirection to a different URL, as handled by the `NSURLSessionTaskDelegate` method `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`.
354 351
355 @param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response. 352 @param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response.
356 */ 353 */
357 -- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block; 354 +- (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block;
358 355
359 /** 356 /**
360 Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`. 357 Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`.
361 358
362 @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. 359 @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge.
363 */ 360 */
364 -- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; 361 +- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block;
365 362
366 /** 363 /**
367 Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. 364 Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`.
368 365
369 @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes five arguments: the session, the task, the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread. 366 @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes five arguments: the session, the task, the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread.
370 */ 367 */
371 -- (void)setTaskDidSendBodyDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block; 368 +- (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block;
372 369
373 /** 370 /**
374 Sets a block to be executed as the last message related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didCompleteWithError:`. 371 Sets a block to be executed as the last message related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didCompleteWithError:`.
375 372
376 @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task. 373 @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task.
377 */ 374 */
378 -- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block; 375 +- (void)setTaskDidCompleteBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, NSError *error))block;
379 376
380 ///------------------------------------------- 377 ///-------------------------------------------
381 /// @name Setting Data Task Delegate Callbacks 378 /// @name Setting Data Task Delegate Callbacks
@@ -386,35 +383,35 @@ NS_ASSUME_NONNULL_BEGIN @@ -386,35 +383,35 @@ NS_ASSUME_NONNULL_BEGIN
386 383
387 @param block A block object to be executed when a data task has received a response. The block returns the disposition of the session response, and takes three arguments: the session, the data task, and the received response. 384 @param block A block object to be executed when a data task has received a response. The block returns the disposition of the session response, and takes three arguments: the session, the data task, and the received response.
388 */ 385 */
389 -- (void)setDataTaskDidReceiveResponseBlock:(nullable NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block; 386 +- (void)setDataTaskDidReceiveResponseBlock:(NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block;
390 387
391 /** 388 /**
392 Sets a block to be executed when a data task has become a download task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didBecomeDownloadTask:`. 389 Sets a block to be executed when a data task has become a download task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didBecomeDownloadTask:`.
393 390
394 @param block A block object to be executed when a data task has become a download task. The block has no return value, and takes three arguments: the session, the data task, and the download task it has become. 391 @param block A block object to be executed when a data task has become a download task. The block has no return value, and takes three arguments: the session, the data task, and the download task it has become.
395 */ 392 */
396 -- (void)setDataTaskDidBecomeDownloadTaskBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block; 393 +- (void)setDataTaskDidBecomeDownloadTaskBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block;
397 394
398 /** 395 /**
399 Sets a block to be executed when a data task receives data, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveData:`. 396 Sets a block to be executed when a data task receives data, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveData:`.
400 397
401 @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the session, the data task, and the data received. This block may be called multiple times, and will execute on the session manager operation queue. 398 @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the session, the data task, and the data received. This block may be called multiple times, and will execute on the session manager operation queue.
402 */ 399 */
403 -- (void)setDataTaskDidReceiveDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block; 400 +- (void)setDataTaskDidReceiveDataBlock:(void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block;
404 401
405 /** 402 /**
406 Sets a block to be executed to determine the caching behavior of a data task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:willCacheResponse:completionHandler:`. 403 Sets a block to be executed to determine the caching behavior of a data task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:willCacheResponse:completionHandler:`.
407 404
408 @param block A block object to be executed to determine the caching behavior of a data task. The block returns the response to cache, and takes three arguments: the session, the data task, and the proposed cached URL response. 405 @param block A block object to be executed to determine the caching behavior of a data task. The block returns the response to cache, and takes three arguments: the session, the data task, and the proposed cached URL response.
409 */ 406 */
410 -- (void)setDataTaskWillCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block; 407 +- (void)setDataTaskWillCacheResponseBlock:(NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block;
411 408
412 /** 409 /**
413 Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`. 410 Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`.
414 411
415 @param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session. 412 @param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session.
416 */ 413 */
417 -- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block; 414 +- (void)setDidFinishEventsForBackgroundURLSessionBlock:(void (^)(NSURLSession *session))block;
418 415
419 ///----------------------------------------------- 416 ///-----------------------------------------------
420 /// @name Setting Download Task Delegate Callbacks 417 /// @name Setting Download Task Delegate Callbacks
@@ -425,76 +422,125 @@ NS_ASSUME_NONNULL_BEGIN @@ -425,76 +422,125 @@ NS_ASSUME_NONNULL_BEGIN
425 422
426 @param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error. 423 @param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error.
427 */ 424 */
428 -- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * _Nullable (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block; 425 +- (void)setDownloadTaskDidFinishDownloadingBlock:(NSURL * (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block;
429 426
430 /** 427 /**
431 Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`. 428 Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`.
432 429
433 @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue. 430 @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue.
434 */ 431 */
435 -- (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block; 432 +- (void)setDownloadTaskDidWriteDataBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block;
436 433
437 /** 434 /**
438 Sets a block to be executed when a download task has been resumed, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. 435 Sets a block to be executed when a download task has been resumed, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`.
439 436
440 @param block A block object to be executed when a download task has been resumed. The block has no return value and takes four arguments: the session, the download task, the file offset of the resumed download, and the total number of bytes expected to be downloaded. 437 @param block A block object to be executed when a download task has been resumed. The block has no return value and takes four arguments: the session, the download task, the file offset of the resumed download, and the total number of bytes expected to be downloaded.
441 */ 438 */
442 -- (void)setDownloadTaskDidResumeBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block; 439 +- (void)setDownloadTaskDidResumeBlock:(void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block;
443 440
444 @end 441 @end
445 442
  443 +#endif
  444 +
446 ///-------------------- 445 ///--------------------
447 /// @name Notifications 446 /// @name Notifications
448 ///-------------------- 447 ///--------------------
449 448
450 /** 449 /**
  450 + Posted when a task begins executing.
  451 +
  452 + @deprecated Use `AFNetworkingTaskDidResumeNotification` instead.
  453 + */
  454 +extern NSString * const AFNetworkingTaskDidStartNotification DEPRECATED_ATTRIBUTE;
  455 +
  456 +/**
451 Posted when a task resumes. 457 Posted when a task resumes.
452 */ 458 */
453 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidResumeNotification; 459 +extern NSString * const AFNetworkingTaskDidResumeNotification;
  460 +
  461 +/**
  462 + Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task.
  463 +
  464 + @deprecated Use `AFNetworkingTaskDidCompleteNotification` instead.
  465 + */
  466 +extern NSString * const AFNetworkingTaskDidFinishNotification DEPRECATED_ATTRIBUTE;
454 467
455 /** 468 /**
456 Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task. 469 Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task.
457 */ 470 */
458 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteNotification; 471 +extern NSString * const AFNetworkingTaskDidCompleteNotification;
459 472
460 /** 473 /**
461 Posted when a task suspends its execution. 474 Posted when a task suspends its execution.
462 */ 475 */
463 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidSuspendNotification; 476 +extern NSString * const AFNetworkingTaskDidSuspendNotification;
464 477
465 /** 478 /**
466 Posted when a session is invalidated. 479 Posted when a session is invalidated.
467 */ 480 */
468 -FOUNDATION_EXPORT NSString * const AFURLSessionDidInvalidateNotification; 481 +extern NSString * const AFURLSessionDidInvalidateNotification;
469 482
470 /** 483 /**
471 Posted when a session download task encountered an error when moving the temporary download file to a specified destination. 484 Posted when a session download task encountered an error when moving the temporary download file to a specified destination.
472 */ 485 */
473 -FOUNDATION_EXPORT NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification; 486 +extern NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification;
  487 +
  488 +/**
  489 + The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if response data exists for the task.
  490 +
  491 + @deprecated Use `AFNetworkingTaskDidCompleteResponseDataKey` instead.
  492 + */
  493 +extern NSString * const AFNetworkingTaskDidFinishResponseDataKey DEPRECATED_ATTRIBUTE;
  494 +
  495 +/**
  496 + The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if response data exists for the task.
  497 + */
  498 +extern NSString * const AFNetworkingTaskDidCompleteResponseDataKey;
  499 +
  500 +/**
  501 + The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the response was serialized.
  502 +
  503 + @deprecated Use `AFNetworkingTaskDidCompleteSerializedResponseKey` instead.
  504 + */
  505 +extern NSString * const AFNetworkingTaskDidFinishSerializedResponseKey DEPRECATED_ATTRIBUTE;
474 506
475 /** 507 /**
476 - The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if response data exists for the task. 508 + The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the response was serialized.
477 */ 509 */
478 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseDataKey; 510 +extern NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey;
479 511
480 /** 512 /**
481 - The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the response was serialized. 513 + The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the task has an associated response serializer.
  514 +
  515 + @deprecated Use `AFNetworkingTaskDidCompleteResponseSerializerKey` instead.
482 */ 516 */
483 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey; 517 +extern NSString * const AFNetworkingTaskDidFinishResponseSerializerKey DEPRECATED_ATTRIBUTE;
484 518
485 /** 519 /**
486 - The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the task has an associated response serializer. 520 + The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if the task has an associated response serializer.
487 */ 521 */
488 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey; 522 +extern NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey;
489 523
490 /** 524 /**
491 - The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an the response data has been stored directly to disk. 525 + The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an the response data has been stored directly to disk.
  526 +
  527 + @deprecated Use `AFNetworkingTaskDidCompleteAssetPathKey` instead.
492 */ 528 */
493 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteAssetPathKey; 529 +extern NSString * const AFNetworkingTaskDidFinishAssetPathKey DEPRECATED_ATTRIBUTE;
494 530
495 /** 531 /**
496 - Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an error exists. 532 + The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an the response data has been stored directly to disk.
497 */ 533 */
498 -FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteErrorKey; 534 +extern NSString * const AFNetworkingTaskDidCompleteAssetPathKey;
499 535
500 -NS_ASSUME_NONNULL_END 536 +/**
  537 + Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an error exists.
  538 +
  539 + @deprecated Use `AFNetworkingTaskDidCompleteErrorKey` instead.
  540 + */
  541 +extern NSString * const AFNetworkingTaskDidFinishErrorKey DEPRECATED_ATTRIBUTE;
  542 +
  543 +/**
  544 + Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidFinishNotification` if an error exists.
  545 + */
  546 +extern NSString * const AFNetworkingTaskDidCompleteErrorKey;
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/AFURLSessionManager.m
1 // AFURLSessionManager.m 1 // AFURLSessionManager.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -22,11 +22,7 @@ @@ -22,11 +22,7 @@
22 #import "AFURLSessionManager.h" 22 #import "AFURLSessionManager.h"
23 #import <objc/runtime.h> 23 #import <objc/runtime.h>
24 24
25 -#ifndef NSFoundationVersionNumber_iOS_8_0  
26 -#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug 1140.11  
27 -#else  
28 -#define NSFoundationVersionNumber_With_Fixed_5871104061079552_bug NSFoundationVersionNumber_iOS_8_0  
29 -#endif 25 +#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
30 26
31 static dispatch_queue_t url_session_manager_creation_queue() { 27 static dispatch_queue_t url_session_manager_creation_queue() {
32 static dispatch_queue_t af_url_session_manager_creation_queue; 28 static dispatch_queue_t af_url_session_manager_creation_queue;
@@ -38,17 +34,6 @@ static dispatch_queue_t url_session_manager_creation_queue() { @@ -38,17 +34,6 @@ static dispatch_queue_t url_session_manager_creation_queue() {
38 return af_url_session_manager_creation_queue; 34 return af_url_session_manager_creation_queue;
39 } 35 }
40 36
41 -static void url_session_manager_create_task_safely(dispatch_block_t block) {  
42 - if (NSFoundationVersionNumber < NSFoundationVersionNumber_With_Fixed_5871104061079552_bug) {  
43 - // Fix of bug  
44 - // Open Radar:http://openradar.appspot.com/radar?id=5871104061079552 (status: Fixed in iOS8)  
45 - // Issue about:https://github.com/AFNetworking/AFNetworking/issues/2093  
46 - dispatch_sync(url_session_manager_creation_queue(), block);  
47 - } else {  
48 - block();  
49 - }  
50 -}  
51 -  
52 static dispatch_queue_t url_session_manager_processing_queue() { 37 static dispatch_queue_t url_session_manager_processing_queue() {
53 static dispatch_queue_t af_url_session_manager_processing_queue; 38 static dispatch_queue_t af_url_session_manager_processing_queue;
54 static dispatch_once_t onceToken; 39 static dispatch_once_t onceToken;
@@ -75,16 +60,27 @@ NSString * const AFNetworkingTaskDidSuspendNotification = @&quot;com.alamofire.networ @@ -75,16 +60,27 @@ NSString * const AFNetworkingTaskDidSuspendNotification = @&quot;com.alamofire.networ
75 NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate"; 60 NSString * const AFURLSessionDidInvalidateNotification = @"com.alamofire.networking.session.invalidate";
76 NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error"; 61 NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification = @"com.alamofire.networking.session.download.file-manager-error";
77 62
  63 +NSString * const AFNetworkingTaskDidStartNotification = @"com.alamofire.networking.task.resume"; // Deprecated
  64 +NSString * const AFNetworkingTaskDidFinishNotification = @"com.alamofire.networking.task.complete"; // Deprecated
  65 +
78 NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; 66 NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse";
79 NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; 67 NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer";
80 NSString * const AFNetworkingTaskDidCompleteResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; 68 NSString * const AFNetworkingTaskDidCompleteResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata";
81 NSString * const AFNetworkingTaskDidCompleteErrorKey = @"com.alamofire.networking.task.complete.error"; 69 NSString * const AFNetworkingTaskDidCompleteErrorKey = @"com.alamofire.networking.task.complete.error";
82 NSString * const AFNetworkingTaskDidCompleteAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; 70 NSString * const AFNetworkingTaskDidCompleteAssetPathKey = @"com.alamofire.networking.task.complete.assetpath";
83 71
  72 +NSString * const AFNetworkingTaskDidFinishSerializedResponseKey = @"com.alamofire.networking.task.complete.serializedresponse"; // Deprecated
  73 +NSString * const AFNetworkingTaskDidFinishResponseSerializerKey = @"com.alamofire.networking.task.complete.responseserializer"; // Deprecated
  74 +NSString * const AFNetworkingTaskDidFinishResponseDataKey = @"com.alamofire.networking.complete.finish.responsedata"; // Deprecated
  75 +NSString * const AFNetworkingTaskDidFinishErrorKey = @"com.alamofire.networking.task.complete.error"; // Deprecated
  76 +NSString * const AFNetworkingTaskDidFinishAssetPathKey = @"com.alamofire.networking.task.complete.assetpath"; // Deprecated
  77 +
84 static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock"; 78 static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock";
85 79
86 static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3; 80 static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3;
87 81
  82 +static void * AFTaskStateChangedContext = &AFTaskStateChangedContext;
  83 +
88 typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error); 84 typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error);
89 typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); 85 typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential);
90 86
@@ -104,89 +100,53 @@ typedef NSCachedURLResponse * (^AFURLSessionDataTaskWillCacheResponseBlock)(NSUR @@ -104,89 +100,53 @@ typedef NSCachedURLResponse * (^AFURLSessionDataTaskWillCacheResponseBlock)(NSUR
104 typedef NSURL * (^AFURLSessionDownloadTaskDidFinishDownloadingBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location); 100 typedef NSURL * (^AFURLSessionDownloadTaskDidFinishDownloadingBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location);
105 typedef void (^AFURLSessionDownloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite); 101 typedef void (^AFURLSessionDownloadTaskDidWriteDataBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite);
106 typedef void (^AFURLSessionDownloadTaskDidResumeBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes); 102 typedef void (^AFURLSessionDownloadTaskDidResumeBlock)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes);
107 -typedef void (^AFURLSessionTaskProgressBlock)(NSProgress *);  
108 103
109 typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error); 104 typedef void (^AFURLSessionTaskCompletionHandler)(NSURLResponse *response, id responseObject, NSError *error);
110 105
111 -  
112 #pragma mark - 106 #pragma mark -
113 107
114 @interface AFURLSessionManagerTaskDelegate : NSObject <NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate> 108 @interface AFURLSessionManagerTaskDelegate : NSObject <NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate>
115 -- (instancetype)initWithTask:(NSURLSessionTask *)task;  
116 @property (nonatomic, weak) AFURLSessionManager *manager; 109 @property (nonatomic, weak) AFURLSessionManager *manager;
117 @property (nonatomic, strong) NSMutableData *mutableData; 110 @property (nonatomic, strong) NSMutableData *mutableData;
118 -@property (nonatomic, strong) NSProgress *uploadProgress;  
119 -@property (nonatomic, strong) NSProgress *downloadProgress; 111 +@property (nonatomic, strong) NSProgress *progress;
120 @property (nonatomic, copy) NSURL *downloadFileURL; 112 @property (nonatomic, copy) NSURL *downloadFileURL;
121 @property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading; 113 @property (nonatomic, copy) AFURLSessionDownloadTaskDidFinishDownloadingBlock downloadTaskDidFinishDownloading;
122 -@property (nonatomic, copy) AFURLSessionTaskProgressBlock uploadProgressBlock;  
123 -@property (nonatomic, copy) AFURLSessionTaskProgressBlock downloadProgressBlock;  
124 @property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler; 114 @property (nonatomic, copy) AFURLSessionTaskCompletionHandler completionHandler;
125 @end 115 @end
126 116
127 @implementation AFURLSessionManagerTaskDelegate 117 @implementation AFURLSessionManagerTaskDelegate
128 118
129 -- (instancetype)initWithTask:(NSURLSessionTask *)task { 119 +- (instancetype)init {
130 self = [super init]; 120 self = [super init];
131 if (!self) { 121 if (!self) {
132 return nil; 122 return nil;
133 } 123 }
134 -  
135 - _mutableData = [NSMutableData data];  
136 - _uploadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil];  
137 - _downloadProgress = [[NSProgress alloc] initWithParent:nil userInfo:nil];  
138 -  
139 - __weak __typeof__(task) weakTask = task;  
140 - for (NSProgress *progress in @[ _uploadProgress, _downloadProgress ])  
141 - {  
142 - progress.totalUnitCount = NSURLSessionTransferSizeUnknown;  
143 - progress.cancellable = YES;  
144 - progress.cancellationHandler = ^{  
145 - [weakTask cancel];  
146 - };  
147 - progress.pausable = YES;  
148 - progress.pausingHandler = ^{  
149 - [weakTask suspend];  
150 - };  
151 - if ([progress respondsToSelector:@selector(setResumingHandler:)]) {  
152 - progress.resumingHandler = ^{  
153 - [weakTask resume];  
154 - };  
155 - }  
156 - [progress addObserver:self  
157 - forKeyPath:NSStringFromSelector(@selector(fractionCompleted))  
158 - options:NSKeyValueObservingOptionNew  
159 - context:NULL];  
160 - }  
161 - return self;  
162 -}  
163 124
164 -- (void)dealloc {  
165 - [self.downloadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))];  
166 - [self.uploadProgress removeObserver:self forKeyPath:NSStringFromSelector(@selector(fractionCompleted))];  
167 -} 125 + self.mutableData = [NSMutableData data];
168 126
169 -#pragma mark - NSProgress Tracking 127 + self.progress = [NSProgress progressWithTotalUnitCount:0];
170 128
171 -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context {  
172 - if ([object isEqual:self.downloadProgress]) {  
173 - if (self.downloadProgressBlock) {  
174 - self.downloadProgressBlock(object);  
175 - }  
176 - }  
177 - else if ([object isEqual:self.uploadProgress]) {  
178 - if (self.uploadProgressBlock) {  
179 - self.uploadProgressBlock(object);  
180 - }  
181 - } 129 + return self;
182 } 130 }
183 131
184 #pragma mark - NSURLSessionTaskDelegate 132 #pragma mark - NSURLSessionTaskDelegate
185 133
186 - (void)URLSession:(__unused NSURLSession *)session 134 - (void)URLSession:(__unused NSURLSession *)session
  135 + task:(__unused NSURLSessionTask *)task
  136 + didSendBodyData:(__unused int64_t)bytesSent
  137 + totalBytesSent:(int64_t)totalBytesSent
  138 +totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
  139 +{
  140 + self.progress.totalUnitCount = totalBytesExpectedToSend;
  141 + self.progress.completedUnitCount = totalBytesSent;
  142 +}
  143 +
  144 +- (void)URLSession:(__unused NSURLSession *)session
187 task:(NSURLSessionTask *)task 145 task:(NSURLSessionTask *)task
188 didCompleteWithError:(NSError *)error 146 didCompleteWithError:(NSError *)error
189 { 147 {
  148 +#pragma clang diagnostic push
  149 +#pragma clang diagnostic ignored "-Wgnu"
190 __strong AFURLSessionManager *manager = self.manager; 150 __strong AFURLSessionManager *manager = self.manager;
191 151
192 __block id responseObject = nil; 152 __block id responseObject = nil;
@@ -194,18 +154,10 @@ didCompleteWithError:(NSError *)error @@ -194,18 +154,10 @@ didCompleteWithError:(NSError *)error
194 __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; 154 __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
195 userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer; 155 userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer;
196 156
197 - //Performance Improvement from #2672  
198 - NSData *data = nil;  
199 - if (self.mutableData) {  
200 - data = [self.mutableData copy];  
201 - //We no longer need the reference, so nil it out to gain back some memory.  
202 - self.mutableData = nil;  
203 - }  
204 -  
205 if (self.downloadFileURL) { 157 if (self.downloadFileURL) {
206 userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL; 158 userInfo[AFNetworkingTaskDidCompleteAssetPathKey] = self.downloadFileURL;
207 - } else if (data) {  
208 - userInfo[AFNetworkingTaskDidCompleteResponseDataKey] = data; 159 + } else if (self.mutableData) {
  160 + userInfo[AFNetworkingTaskDidCompleteResponseDataKey] = [NSData dataWithData:self.mutableData];
209 } 161 }
210 162
211 if (error) { 163 if (error) {
@@ -223,7 +175,7 @@ didCompleteWithError:(NSError *)error @@ -223,7 +175,7 @@ didCompleteWithError:(NSError *)error
223 } else { 175 } else {
224 dispatch_async(url_session_manager_processing_queue(), ^{ 176 dispatch_async(url_session_manager_processing_queue(), ^{
225 NSError *serializationError = nil; 177 NSError *serializationError = nil;
226 - responseObject = [manager.responseSerializer responseObjectForResponse:task.response data:data error:&serializationError]; 178 + responseObject = [manager.responseSerializer responseObjectForResponse:task.response data:[NSData dataWithData:self.mutableData] error:&serializationError];
227 179
228 if (self.downloadFileURL) { 180 if (self.downloadFileURL) {
229 responseObject = self.downloadFileURL; 181 responseObject = self.downloadFileURL;
@@ -248,66 +200,57 @@ didCompleteWithError:(NSError *)error @@ -248,66 +200,57 @@ didCompleteWithError:(NSError *)error
248 }); 200 });
249 }); 201 });
250 } 202 }
  203 +#pragma clang diagnostic pop
251 } 204 }
252 205
253 -#pragma mark - NSURLSessionDataDelegate 206 +#pragma mark - NSURLSessionDataTaskDelegate
254 207
255 - (void)URLSession:(__unused NSURLSession *)session 208 - (void)URLSession:(__unused NSURLSession *)session
256 dataTask:(__unused NSURLSessionDataTask *)dataTask 209 dataTask:(__unused NSURLSessionDataTask *)dataTask
257 didReceiveData:(NSData *)data 210 didReceiveData:(NSData *)data
258 { 211 {
259 - self.downloadProgress.totalUnitCount = dataTask.countOfBytesExpectedToReceive;  
260 - self.downloadProgress.completedUnitCount = dataTask.countOfBytesReceived;  
261 -  
262 [self.mutableData appendData:data]; 212 [self.mutableData appendData:data];
263 } 213 }
264 214
265 -- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task  
266 - didSendBodyData:(int64_t)bytesSent  
267 - totalBytesSent:(int64_t)totalBytesSent  
268 -totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend{  
269 -  
270 - self.uploadProgress.totalUnitCount = task.countOfBytesExpectedToSend;  
271 - self.uploadProgress.completedUnitCount = task.countOfBytesSent;  
272 -}  
273 -  
274 -#pragma mark - NSURLSessionDownloadDelegate  
275 -  
276 -- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask  
277 - didWriteData:(int64_t)bytesWritten  
278 - totalBytesWritten:(int64_t)totalBytesWritten  
279 -totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite{  
280 -  
281 - self.downloadProgress.totalUnitCount = totalBytesExpectedToWrite;  
282 - self.downloadProgress.completedUnitCount = totalBytesWritten;  
283 -}  
284 -  
285 -- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask  
286 - didResumeAtOffset:(int64_t)fileOffset  
287 -expectedTotalBytes:(int64_t)expectedTotalBytes{  
288 -  
289 - self.downloadProgress.totalUnitCount = expectedTotalBytes;  
290 - self.downloadProgress.completedUnitCount = fileOffset;  
291 -} 215 +#pragma mark - NSURLSessionDownloadTaskDelegate
292 216
293 - (void)URLSession:(NSURLSession *)session 217 - (void)URLSession:(NSURLSession *)session
294 downloadTask:(NSURLSessionDownloadTask *)downloadTask 218 downloadTask:(NSURLSessionDownloadTask *)downloadTask
295 didFinishDownloadingToURL:(NSURL *)location 219 didFinishDownloadingToURL:(NSURL *)location
296 { 220 {
  221 + NSError *fileManagerError = nil;
297 self.downloadFileURL = nil; 222 self.downloadFileURL = nil;
298 223
299 if (self.downloadTaskDidFinishDownloading) { 224 if (self.downloadTaskDidFinishDownloading) {
300 self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location); 225 self.downloadFileURL = self.downloadTaskDidFinishDownloading(session, downloadTask, location);
301 if (self.downloadFileURL) { 226 if (self.downloadFileURL) {
302 - NSError *fileManagerError = nil; 227 + [[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError];
303 228
304 - if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:self.downloadFileURL error:&fileManagerError]) { 229 + if (fileManagerError) {
305 [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo]; 230 [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:fileManagerError.userInfo];
306 } 231 }
307 } 232 }
308 } 233 }
309 } 234 }
310 235
  236 +- (void)URLSession:(__unused NSURLSession *)session
  237 + downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask
  238 + didWriteData:(__unused int64_t)bytesWritten
  239 + totalBytesWritten:(int64_t)totalBytesWritten
  240 +totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
  241 +{
  242 + self.progress.totalUnitCount = totalBytesExpectedToWrite;
  243 + self.progress.completedUnitCount = totalBytesWritten;
  244 +}
  245 +
  246 +- (void)URLSession:(__unused NSURLSession *)session
  247 + downloadTask:(__unused NSURLSessionDownloadTask *)downloadTask
  248 + didResumeAtOffset:(int64_t)fileOffset
  249 +expectedTotalBytes:(int64_t)expectedTotalBytes {
  250 + self.progress.totalUnitCount = expectedTotalBytes;
  251 + self.progress.completedUnitCount = fileOffset;
  252 +}
  253 +
311 @end 254 @end
312 255
313 #pragma mark - 256 #pragma mark -
@@ -321,14 +264,14 @@ didFinishDownloadingToURL:(NSURL *)location @@ -321,14 +264,14 @@ didFinishDownloadingToURL:(NSURL *)location
321 * - https://github.com/AFNetworking/AFNetworking/pull/2702 264 * - https://github.com/AFNetworking/AFNetworking/pull/2702
322 */ 265 */
323 266
324 -static inline void af_swizzleSelector(Class theClass, SEL originalSelector, SEL swizzledSelector) {  
325 - Method originalMethod = class_getInstanceMethod(theClass, originalSelector);  
326 - Method swizzledMethod = class_getInstanceMethod(theClass, swizzledSelector); 267 +static inline void af_swizzleSelector(Class class, SEL originalSelector, SEL swizzledSelector) {
  268 + Method originalMethod = class_getInstanceMethod(class, originalSelector);
  269 + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector);
327 method_exchangeImplementations(originalMethod, swizzledMethod); 270 method_exchangeImplementations(originalMethod, swizzledMethod);
328 } 271 }
329 272
330 -static inline BOOL af_addMethod(Class theClass, SEL selector, Method method) {  
331 - return class_addMethod(theClass, selector, method_getImplementation(method), method_getTypeEncoding(method)); 273 +static inline BOOL af_addMethod(Class class, SEL selector, Method method) {
  274 + return class_addMethod(class, selector, method_getImplementation(method), method_getTypeEncoding(method));
332 } 275 }
333 276
334 static NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume"; 277 static NSString * const AFNSURLSessionTaskDidResumeNotification = @"com.alamofire.networking.nsurlsessiontask.resume";
@@ -373,13 +316,8 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -373,13 +316,8 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
373 7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods 316 7) If the current class implementation of `resume` is not equal to the super class implementation of `resume` AND the current implementation of `resume` is not equal to the original implementation of `af_resume`, THEN swizzle the methods
374 8) Set the current class to the super class, and repeat steps 3-8 317 8) Set the current class to the super class, and repeat steps 3-8
375 */ 318 */
376 - NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration ephemeralSessionConfiguration];  
377 - NSURLSession * session = [NSURLSession sessionWithConfiguration:configuration];  
378 -#pragma GCC diagnostic push  
379 -#pragma GCC diagnostic ignored "-Wnonnull"  
380 - NSURLSessionDataTask *localDataTask = [session dataTaskWithURL:nil];  
381 -#pragma clang diagnostic pop  
382 - IMP originalAFResumeIMP = method_getImplementation(class_getInstanceMethod([self class], @selector(af_resume))); 319 + NSURLSessionDataTask *localDataTask = [[NSURLSession sessionWithConfiguration:nil] dataTaskWithURL:nil];
  320 + IMP originalAFResumeIMP = method_getImplementation(class_getInstanceMethod([_AFURLSessionTaskSwizzling class], @selector(af_resume)));
383 Class currentClass = [localDataTask class]; 321 Class currentClass = [localDataTask class];
384 322
385 while (class_getInstanceMethod(currentClass, @selector(resume))) { 323 while (class_getInstanceMethod(currentClass, @selector(resume))) {
@@ -394,21 +332,18 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -394,21 +332,18 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
394 } 332 }
395 333
396 [localDataTask cancel]; 334 [localDataTask cancel];
397 - [session finishTasksAndInvalidate];  
398 } 335 }
399 } 336 }
400 337
401 -+ (void)swizzleResumeAndSuspendMethodForClass:(Class)theClass { 338 ++ (void)swizzleResumeAndSuspendMethodForClass:(Class)class {
402 Method afResumeMethod = class_getInstanceMethod(self, @selector(af_resume)); 339 Method afResumeMethod = class_getInstanceMethod(self, @selector(af_resume));
403 Method afSuspendMethod = class_getInstanceMethod(self, @selector(af_suspend)); 340 Method afSuspendMethod = class_getInstanceMethod(self, @selector(af_suspend));
404 -  
405 - if (af_addMethod(theClass, @selector(af_resume), afResumeMethod)) {  
406 - af_swizzleSelector(theClass, @selector(resume), @selector(af_resume));  
407 - }  
408 -  
409 - if (af_addMethod(theClass, @selector(af_suspend), afSuspendMethod)) {  
410 - af_swizzleSelector(theClass, @selector(suspend), @selector(af_suspend));  
411 - } 341 +
  342 + af_addMethod(class, @selector(af_resume), afResumeMethod);
  343 + af_addMethod(class, @selector(af_suspend), afSuspendMethod);
  344 +
  345 + af_swizzleSelector(class, @selector(resume), @selector(af_resume));
  346 + af_swizzleSelector(class, @selector(suspend), @selector(af_suspend));
412 } 347 }
413 348
414 - (NSURLSessionTaskState)state { 349 - (NSURLSessionTaskState)state {
@@ -490,9 +425,7 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -490,9 +425,7 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
490 425
491 self.securityPolicy = [AFSecurityPolicy defaultPolicy]; 426 self.securityPolicy = [AFSecurityPolicy defaultPolicy];
492 427
493 -#if !TARGET_OS_WATCH  
494 self.reachabilityManager = [AFNetworkReachabilityManager sharedManager]; 428 self.reachabilityManager = [AFNetworkReachabilityManager sharedManager];
495 -#endif  
496 429
497 self.mutableTaskDelegatesKeyedByTaskIdentifier = [[NSMutableDictionary alloc] init]; 430 self.mutableTaskDelegatesKeyedByTaskIdentifier = [[NSMutableDictionary alloc] init];
498 431
@@ -501,7 +434,7 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -501,7 +434,7 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
501 434
502 [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { 435 [self.session getTasksWithCompletionHandler:^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) {
503 for (NSURLSessionDataTask *task in dataTasks) { 436 for (NSURLSessionDataTask *task in dataTasks) {
504 - [self addDelegateForDataTask:task uploadProgress:nil downloadProgress:nil completionHandler:nil]; 437 + [self addDelegateForDataTask:task completionHandler:nil];
505 } 438 }
506 439
507 for (NSURLSessionUploadTask *uploadTask in uploadTasks) { 440 for (NSURLSessionUploadTask *uploadTask in uploadTasks) {
@@ -513,6 +446,9 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -513,6 +446,9 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
513 } 446 }
514 }]; 447 }];
515 448
  449 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:nil];
  450 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:nil];
  451 +
516 return self; 452 return self;
517 } 453 }
518 454
@@ -569,47 +505,64 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -569,47 +505,64 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
569 505
570 [self.lock lock]; 506 [self.lock lock];
571 self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)] = delegate; 507 self.mutableTaskDelegatesKeyedByTaskIdentifier[@(task.taskIdentifier)] = delegate;
572 - [self addNotificationObserverForTask:task];  
573 [self.lock unlock]; 508 [self.lock unlock];
574 } 509 }
575 510
576 - (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask 511 - (void)addDelegateForDataTask:(NSURLSessionDataTask *)dataTask
577 - uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock  
578 - downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock  
579 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler 512 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
580 { 513 {
581 - AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] initWithTask:dataTask]; 514 + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
582 delegate.manager = self; 515 delegate.manager = self;
583 delegate.completionHandler = completionHandler; 516 delegate.completionHandler = completionHandler;
584 517
585 dataTask.taskDescription = self.taskDescriptionForSessionTasks; 518 dataTask.taskDescription = self.taskDescriptionForSessionTasks;
586 [self setDelegate:delegate forTask:dataTask]; 519 [self setDelegate:delegate forTask:dataTask];
587 -  
588 - delegate.uploadProgressBlock = uploadProgressBlock;  
589 - delegate.downloadProgressBlock = downloadProgressBlock;  
590 } 520 }
591 521
592 - (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask 522 - (void)addDelegateForUploadTask:(NSURLSessionUploadTask *)uploadTask
593 - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock 523 + progress:(NSProgress * __autoreleasing *)progress
594 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler 524 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
595 { 525 {
596 - AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] initWithTask:uploadTask]; 526 + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
597 delegate.manager = self; 527 delegate.manager = self;
598 delegate.completionHandler = completionHandler; 528 delegate.completionHandler = completionHandler;
599 529
  530 + int64_t totalUnitCount = uploadTask.countOfBytesExpectedToSend;
  531 + if(totalUnitCount == NSURLSessionTransferSizeUnknown) {
  532 + NSString *contentLength = [uploadTask.originalRequest valueForHTTPHeaderField:@"Content-Length"];
  533 + if(contentLength) {
  534 + totalUnitCount = (int64_t)[contentLength longLongValue];
  535 + }
  536 + }
  537 +
  538 + if (delegate.progress) {
  539 + delegate.progress.totalUnitCount = totalUnitCount;
  540 + } else {
  541 + delegate.progress = [NSProgress progressWithTotalUnitCount:totalUnitCount];
  542 + }
  543 +
  544 + delegate.progress.pausingHandler = ^{
  545 + [uploadTask suspend];
  546 + };
  547 + delegate.progress.cancellationHandler = ^{
  548 + [uploadTask cancel];
  549 + };
  550 +
  551 + if (progress) {
  552 + *progress = delegate.progress;
  553 + }
  554 +
600 uploadTask.taskDescription = self.taskDescriptionForSessionTasks; 555 uploadTask.taskDescription = self.taskDescriptionForSessionTasks;
601 556
602 [self setDelegate:delegate forTask:uploadTask]; 557 [self setDelegate:delegate forTask:uploadTask];
603 -  
604 - delegate.uploadProgressBlock = uploadProgressBlock;  
605 } 558 }
606 559
607 - (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask 560 - (void)addDelegateForDownloadTask:(NSURLSessionDownloadTask *)downloadTask
608 - progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock 561 + progress:(NSProgress * __autoreleasing *)progress
609 destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination 562 destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
610 completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler 563 completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
611 { 564 {
612 - AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] initWithTask:downloadTask]; 565 + AFURLSessionManagerTaskDelegate *delegate = [[AFURLSessionManagerTaskDelegate alloc] init];
613 delegate.manager = self; 566 delegate.manager = self;
614 delegate.completionHandler = completionHandler; 567 delegate.completionHandler = completionHandler;
615 568
@@ -619,22 +572,29 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -619,22 +572,29 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
619 }; 572 };
620 } 573 }
621 574
  575 + if (progress) {
  576 + *progress = delegate.progress;
  577 + }
  578 +
622 downloadTask.taskDescription = self.taskDescriptionForSessionTasks; 579 downloadTask.taskDescription = self.taskDescriptionForSessionTasks;
623 580
624 [self setDelegate:delegate forTask:downloadTask]; 581 [self setDelegate:delegate forTask:downloadTask];
625 -  
626 - delegate.downloadProgressBlock = downloadProgressBlock;  
627 } 582 }
628 583
629 - (void)removeDelegateForTask:(NSURLSessionTask *)task { 584 - (void)removeDelegateForTask:(NSURLSessionTask *)task {
630 NSParameterAssert(task); 585 NSParameterAssert(task);
631 586
632 [self.lock lock]; 587 [self.lock lock];
633 - [self removeNotificationObserverForTask:task];  
634 [self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)]; 588 [self.mutableTaskDelegatesKeyedByTaskIdentifier removeObjectForKey:@(task.taskIdentifier)];
635 [self.lock unlock]; 589 [self.lock unlock];
636 } 590 }
637 591
  592 +- (void)removeAllDelegates {
  593 + [self.lock lock];
  594 + [self.mutableTaskDelegatesKeyedByTaskIdentifier removeAllObjects];
  595 + [self.lock unlock];
  596 +}
  597 +
638 #pragma mark - 598 #pragma mark -
639 599
640 - (NSArray *)tasksForKeyPath:(NSString *)keyPath { 600 - (NSArray *)tasksForKeyPath:(NSString *)keyPath {
@@ -678,11 +638,13 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -678,11 +638,13 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
678 #pragma mark - 638 #pragma mark -
679 639
680 - (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks { 640 - (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks {
681 - if (cancelPendingTasks) {  
682 - [self.session invalidateAndCancel];  
683 - } else {  
684 - [self.session finishTasksAndInvalidate];  
685 - } 641 + dispatch_async(dispatch_get_main_queue(), ^{
  642 + if (cancelPendingTasks) {
  643 + [self.session invalidateAndCancel];
  644 + } else {
  645 + [self.session finishTasksAndInvalidate];
  646 + }
  647 + });
686 } 648 }
687 649
688 #pragma mark - 650 #pragma mark -
@@ -694,35 +656,16 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -694,35 +656,16 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
694 } 656 }
695 657
696 #pragma mark - 658 #pragma mark -
697 -- (void)addNotificationObserverForTask:(NSURLSessionTask *)task {  
698 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidResume:) name:AFNSURLSessionTaskDidResumeNotification object:task];  
699 - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(taskDidSuspend:) name:AFNSURLSessionTaskDidSuspendNotification object:task];  
700 -}  
701 -  
702 -- (void)removeNotificationObserverForTask:(NSURLSessionTask *)task {  
703 - [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidSuspendNotification object:task];  
704 - [[NSNotificationCenter defaultCenter] removeObserver:self name:AFNSURLSessionTaskDidResumeNotification object:task];  
705 -}  
706 -  
707 -#pragma mark -  
708 659
709 - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request 660 - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
710 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler 661 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
711 { 662 {
712 - return [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:completionHandler];  
713 -}  
714 -  
715 -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request  
716 - uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock  
717 - downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock  
718 - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler {  
719 -  
720 __block NSURLSessionDataTask *dataTask = nil; 663 __block NSURLSessionDataTask *dataTask = nil;
721 - url_session_manager_create_task_safely(^{ 664 + dispatch_sync(url_session_manager_creation_queue(), ^{
722 dataTask = [self.session dataTaskWithRequest:request]; 665 dataTask = [self.session dataTaskWithRequest:request];
723 }); 666 });
724 667
725 - [self addDelegateForDataTask:dataTask uploadProgress:uploadProgressBlock downloadProgress:downloadProgressBlock completionHandler:completionHandler]; 668 + [self addDelegateForDataTask:dataTask completionHandler:completionHandler];
726 669
727 return dataTask; 670 return dataTask;
728 } 671 }
@@ -731,51 +674,50 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -731,51 +674,50 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
731 674
732 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request 675 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
733 fromFile:(NSURL *)fileURL 676 fromFile:(NSURL *)fileURL
734 - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock 677 + progress:(NSProgress * __autoreleasing *)progress
735 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler 678 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
736 { 679 {
737 __block NSURLSessionUploadTask *uploadTask = nil; 680 __block NSURLSessionUploadTask *uploadTask = nil;
738 - url_session_manager_create_task_safely(^{ 681 + dispatch_sync(url_session_manager_creation_queue(), ^{
739 uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; 682 uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
740 }); 683 });
741 684
742 - // uploadTask may be nil on iOS7 because uploadTaskWithRequest:fromFile: may return nil despite being documented as nonnull (https://devforums.apple.com/message/926113#926113)  
743 if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) { 685 if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) {
744 for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) { 686 for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) {
745 uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; 687 uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL];
746 } 688 }
747 } 689 }
748 690
749 - [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; 691 + [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
750 692
751 return uploadTask; 693 return uploadTask;
752 } 694 }
753 695
754 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request 696 - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request
755 fromData:(NSData *)bodyData 697 fromData:(NSData *)bodyData
756 - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock 698 + progress:(NSProgress * __autoreleasing *)progress
757 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler 699 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
758 { 700 {
759 __block NSURLSessionUploadTask *uploadTask = nil; 701 __block NSURLSessionUploadTask *uploadTask = nil;
760 - url_session_manager_create_task_safely(^{ 702 + dispatch_sync(url_session_manager_creation_queue(), ^{
761 uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData]; 703 uploadTask = [self.session uploadTaskWithRequest:request fromData:bodyData];
762 }); 704 });
763 705
764 - [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; 706 + [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
765 707
766 return uploadTask; 708 return uploadTask;
767 } 709 }
768 710
769 - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request 711 - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request
770 - progress:(void (^)(NSProgress *uploadProgress)) uploadProgressBlock 712 + progress:(NSProgress * __autoreleasing *)progress
771 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler 713 completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler
772 { 714 {
773 __block NSURLSessionUploadTask *uploadTask = nil; 715 __block NSURLSessionUploadTask *uploadTask = nil;
774 - url_session_manager_create_task_safely(^{ 716 + dispatch_sync(url_session_manager_creation_queue(), ^{
775 uploadTask = [self.session uploadTaskWithStreamedRequest:request]; 717 uploadTask = [self.session uploadTaskWithStreamedRequest:request];
776 }); 718 });
777 719
778 - [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock completionHandler:completionHandler]; 720 + [self addDelegateForUploadTask:uploadTask progress:progress completionHandler:completionHandler];
779 721
780 return uploadTask; 722 return uploadTask;
781 } 723 }
@@ -783,42 +725,43 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi @@ -783,42 +725,43 @@ static NSString * const AFNSURLSessionTaskDidSuspendNotification = @&quot;com.alamofi
783 #pragma mark - 725 #pragma mark -
784 726
785 - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request 727 - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request
786 - progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock 728 + progress:(NSProgress * __autoreleasing *)progress
787 destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination 729 destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
788 completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler 730 completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
789 { 731 {
790 __block NSURLSessionDownloadTask *downloadTask = nil; 732 __block NSURLSessionDownloadTask *downloadTask = nil;
791 - url_session_manager_create_task_safely(^{ 733 + dispatch_sync(url_session_manager_creation_queue(), ^{
792 downloadTask = [self.session downloadTaskWithRequest:request]; 734 downloadTask = [self.session downloadTaskWithRequest:request];
793 }); 735 });
794 736
795 - [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; 737 + [self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler];
796 738
797 return downloadTask; 739 return downloadTask;
798 } 740 }
799 741
800 - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData 742 - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData
801 - progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock 743 + progress:(NSProgress * __autoreleasing *)progress
802 destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination 744 destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
803 completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler 745 completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler
804 { 746 {
805 __block NSURLSessionDownloadTask *downloadTask = nil; 747 __block NSURLSessionDownloadTask *downloadTask = nil;
806 - url_session_manager_create_task_safely(^{ 748 + dispatch_sync(url_session_manager_creation_queue(), ^{
807 downloadTask = [self.session downloadTaskWithResumeData:resumeData]; 749 downloadTask = [self.session downloadTaskWithResumeData:resumeData];
808 }); 750 });
809 751
810 - [self addDelegateForDownloadTask:downloadTask progress:downloadProgressBlock destination:destination completionHandler:completionHandler]; 752 + [self addDelegateForDownloadTask:downloadTask progress:progress destination:destination completionHandler:completionHandler];
811 753
812 return downloadTask; 754 return downloadTask;
813 } 755 }
814 756
815 #pragma mark - 757 #pragma mark -
816 -- (NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task {  
817 - return [[self delegateForTask:task] uploadProgress]; 758 +
  759 +- (NSProgress *)uploadProgressForTask:(NSURLSessionUploadTask *)uploadTask {
  760 + return [[self delegateForTask:uploadTask] progress];
818 } 761 }
819 762
820 -- (NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task {  
821 - return [[self delegateForTask:task] downloadProgress]; 763 +- (NSProgress *)downloadProgressForTask:(NSURLSessionDownloadTask *)downloadTask {
  764 + return [[self delegateForTask:downloadTask] progress];
822 } 765 }
823 766
824 #pragma mark - 767 #pragma mark -
@@ -918,6 +861,7 @@ didBecomeInvalidWithError:(NSError *)error @@ -918,6 +861,7 @@ didBecomeInvalidWithError:(NSError *)error
918 self.sessionDidBecomeInvalid(session, error); 861 self.sessionDidBecomeInvalid(session, error);
919 } 862 }
920 863
  864 + [self removeAllDelegates];
921 [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session]; 865 [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDidInvalidateNotification object:session];
922 } 866 }
923 867
@@ -1030,12 +974,9 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend @@ -1030,12 +974,9 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend
1030 totalUnitCount = (int64_t) [contentLength longLongValue]; 974 totalUnitCount = (int64_t) [contentLength longLongValue];
1031 } 975 }
1032 } 976 }
1033 - 977 +
1034 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task]; 978 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:task];
1035 -  
1036 - if (delegate) {  
1037 - [delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalBytesExpectedToSend];  
1038 - } 979 + [delegate URLSession:session task:task didSendBodyData:bytesSent totalBytesSent:totalBytesSent totalBytesExpectedToSend:totalUnitCount];
1039 980
1040 if (self.taskDidSendBodyData) { 981 if (self.taskDidSendBodyData) {
1041 self.taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalUnitCount); 982 self.taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalUnitCount);
@@ -1058,6 +999,7 @@ didCompleteWithError:(NSError *)error @@ -1058,6 +999,7 @@ didCompleteWithError:(NSError *)error
1058 if (self.taskDidComplete) { 999 if (self.taskDidComplete) {
1059 self.taskDidComplete(session, task, error); 1000 self.taskDidComplete(session, task, error);
1060 } 1001 }
  1002 +
1061 } 1003 }
1062 1004
1063 #pragma mark - NSURLSessionDataDelegate 1005 #pragma mark - NSURLSessionDataDelegate
@@ -1097,7 +1039,6 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask @@ -1097,7 +1039,6 @@ didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
1097 dataTask:(NSURLSessionDataTask *)dataTask 1039 dataTask:(NSURLSessionDataTask *)dataTask
1098 didReceiveData:(NSData *)data 1040 didReceiveData:(NSData *)data
1099 { 1041 {
1100 -  
1101 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask]; 1042 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:dataTask];
1102 [delegate URLSession:session dataTask:dataTask didReceiveData:data]; 1043 [delegate URLSession:session dataTask:dataTask didReceiveData:data];
1103 1044
@@ -1142,8 +1083,8 @@ didFinishDownloadingToURL:(NSURL *)location @@ -1142,8 +1083,8 @@ didFinishDownloadingToURL:(NSURL *)location
1142 if (fileURL) { 1083 if (fileURL) {
1143 delegate.downloadFileURL = fileURL; 1084 delegate.downloadFileURL = fileURL;
1144 NSError *error = nil; 1085 NSError *error = nil;
1145 -  
1146 - if (![[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error]) { 1086 + [[NSFileManager defaultManager] moveItemAtURL:location toURL:fileURL error:&error];
  1087 + if (error) {
1147 [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo]; 1088 [[NSNotificationCenter defaultCenter] postNotificationName:AFURLSessionDownloadTaskDidFailToMoveFileNotification object:downloadTask userInfo:error.userInfo];
1148 } 1089 }
1149 1090
@@ -1162,12 +1103,8 @@ didFinishDownloadingToURL:(NSURL *)location @@ -1162,12 +1103,8 @@ didFinishDownloadingToURL:(NSURL *)location
1162 totalBytesWritten:(int64_t)totalBytesWritten 1103 totalBytesWritten:(int64_t)totalBytesWritten
1163 totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite 1104 totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
1164 { 1105 {
1165 -  
1166 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask]; 1106 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask];
1167 -  
1168 - if (delegate) {  
1169 - [delegate URLSession:session downloadTask:downloadTask didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];  
1170 - } 1107 + [delegate URLSession:session downloadTask:downloadTask didWriteData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
1171 1108
1172 if (self.downloadTaskDidWriteData) { 1109 if (self.downloadTaskDidWriteData) {
1173 self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite); 1110 self.downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
@@ -1179,12 +1116,8 @@ totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite @@ -1179,12 +1116,8 @@ totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
1179 didResumeAtOffset:(int64_t)fileOffset 1116 didResumeAtOffset:(int64_t)fileOffset
1180 expectedTotalBytes:(int64_t)expectedTotalBytes 1117 expectedTotalBytes:(int64_t)expectedTotalBytes
1181 { 1118 {
1182 -  
1183 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask]; 1119 AFURLSessionManagerTaskDelegate *delegate = [self delegateForTask:downloadTask];
1184 -  
1185 - if (delegate) {  
1186 - [delegate URLSession:session downloadTask:downloadTask didResumeAtOffset:fileOffset expectedTotalBytes:expectedTotalBytes];  
1187 - } 1120 + [delegate URLSession:session downloadTask:downloadTask didResumeAtOffset:fileOffset expectedTotalBytes:expectedTotalBytes];
1188 1121
1189 if (self.downloadTaskDidResume) { 1122 if (self.downloadTaskDidResume) {
1190 self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes); 1123 self.downloadTaskDidResume(session, downloadTask, fileOffset, expectedTotalBytes);
@@ -1197,7 +1130,7 @@ expectedTotalBytes:(int64_t)expectedTotalBytes @@ -1197,7 +1130,7 @@ expectedTotalBytes:(int64_t)expectedTotalBytes
1197 return YES; 1130 return YES;
1198 } 1131 }
1199 1132
1200 -- (instancetype)initWithCoder:(NSCoder *)decoder { 1133 +- (id)initWithCoder:(NSCoder *)decoder {
1201 NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"]; 1134 NSURLSessionConfiguration *configuration = [decoder decodeObjectOfClass:[NSURLSessionConfiguration class] forKey:@"sessionConfiguration"];
1202 1135
1203 self = [self initWithSessionConfiguration:configuration]; 1136 self = [self initWithSessionConfiguration:configuration];
@@ -1214,8 +1147,10 @@ expectedTotalBytes:(int64_t)expectedTotalBytes @@ -1214,8 +1147,10 @@ expectedTotalBytes:(int64_t)expectedTotalBytes
1214 1147
1215 #pragma mark - NSCopying 1148 #pragma mark - NSCopying
1216 1149
1217 -- (instancetype)copyWithZone:(NSZone *)zone { 1150 +- (id)copyWithZone:(NSZone *)zone {
1218 return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration]; 1151 return [[[self class] allocWithZone:zone] initWithSessionConfiguration:self.session.configuration];
1219 } 1152 }
1220 1153
1221 @end 1154 @end
  1155 +
  1156 +#endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h
1 // AFNetworkActivityIndicatorManager.h 1 // AFNetworkActivityIndicatorManager.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,16 +21,14 @@ @@ -21,16 +21,14 @@
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 23
24 -#import <TargetConditionals.h> 24 +#import <Availability.h>
25 25
26 -#if TARGET_OS_IOS 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 #import <UIKit/UIKit.h> 28 #import <UIKit/UIKit.h>
29 29
30 -NS_ASSUME_NONNULL_BEGIN  
31 -  
32 /** 30 /**
33 - `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. 31 + `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a network request operation 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.
34 32
35 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: 33 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:
36 34
@@ -41,7 +39,6 @@ NS_ASSUME_NONNULL_BEGIN @@ -41,7 +39,6 @@ NS_ASSUME_NONNULL_BEGIN
41 See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: 39 See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information:
42 http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 40 http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44
43 */ 41 */
44 -NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.")  
45 @interface AFNetworkActivityIndicatorManager : NSObject 42 @interface AFNetworkActivityIndicatorManager : NSObject
46 43
47 /** 44 /**
@@ -52,25 +49,9 @@ NS_EXTENSION_UNAVAILABLE_IOS(&quot;Use view controller based solutions where appropri @@ -52,25 +49,9 @@ NS_EXTENSION_UNAVAILABLE_IOS(&quot;Use view controller based solutions where appropri
52 @property (nonatomic, assign, getter = isEnabled) BOOL enabled; 49 @property (nonatomic, assign, getter = isEnabled) BOOL enabled;
53 50
54 /** 51 /**
55 - A Boolean value indicating whether the network activity indicator manager is currently active.  
56 -*/  
57 -@property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;  
58 -  
59 -/**  
60 - 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.  
61 -  
62 - Apple's HIG describes the following:  
63 -  
64 - > 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.  
65 -  
66 - */  
67 -@property (nonatomic, assign) NSTimeInterval activationDelay;  
68 -  
69 -/**  
70 - 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. 52 + A Boolean value indicating whether the network activity indicator is currently displayed in the status bar.
71 */ 53 */
72 -  
73 -@property (nonatomic, assign) NSTimeInterval completionDelay; 54 +@property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible;
74 55
75 /** 56 /**
76 Returns the shared network activity indicator manager object for the system. 57 Returns the shared network activity indicator manager object for the system.
@@ -89,15 +70,6 @@ NS_EXTENSION_UNAVAILABLE_IOS(&quot;Use view controller based solutions where appropri @@ -89,15 +70,6 @@ NS_EXTENSION_UNAVAILABLE_IOS(&quot;Use view controller based solutions where appropri
89 */ 70 */
90 - (void)decrementActivityCount; 71 - (void)decrementActivityCount;
91 72
92 -/**  
93 - 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.  
94 -  
95 - @param block A block to be executed when the network activity indicator status changes.  
96 - */  
97 -- (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block;  
98 -  
99 @end 73 @end
100 74
101 -NS_ASSUME_NONNULL_END  
102 -  
103 #endif 75 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m
1 // AFNetworkActivityIndicatorManager.m 1 // AFNetworkActivityIndicatorManager.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,42 +21,41 @@ @@ -21,42 +21,41 @@
21 21
22 #import "AFNetworkActivityIndicatorManager.h" 22 #import "AFNetworkActivityIndicatorManager.h"
23 23
24 -#if TARGET_OS_IOS  
25 -#import "AFURLSessionManager.h" 24 +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
  25 +
  26 +#import "AFHTTPRequestOperation.h"
26 27
27 -typedef NS_ENUM(NSInteger, AFNetworkActivityManagerState) {  
28 - AFNetworkActivityManagerStateNotActive,  
29 - AFNetworkActivityManagerStateDelayingStart,  
30 - AFNetworkActivityManagerStateActive,  
31 - AFNetworkActivityManagerStateDelayingEnd  
32 -}; 28 +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
  29 +#import "AFURLSessionManager.h"
  30 +#endif
33 31
34 -static NSTimeInterval const kDefaultAFNetworkActivityManagerActivationDelay = 1.0;  
35 -static NSTimeInterval const kDefaultAFNetworkActivityManagerCompletionDelay = 0.17; 32 +static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17;
36 33
37 static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) { 34 static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) {
  35 + if ([[notification object] isKindOfClass:[AFURLConnectionOperation class]]) {
  36 + return [(AFURLConnectionOperation *)[notification object] request];
  37 + }
  38 +
  39 +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
38 if ([[notification object] respondsToSelector:@selector(originalRequest)]) { 40 if ([[notification object] respondsToSelector:@selector(originalRequest)]) {
39 return [(NSURLSessionTask *)[notification object] originalRequest]; 41 return [(NSURLSessionTask *)[notification object] originalRequest];
40 - } else {  
41 - return nil;  
42 } 42 }
43 -} 43 +#endif
44 44
45 -typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisible); 45 + return nil;
  46 +}
46 47
47 @interface AFNetworkActivityIndicatorManager () 48 @interface AFNetworkActivityIndicatorManager ()
48 @property (readwrite, nonatomic, assign) NSInteger activityCount; 49 @property (readwrite, nonatomic, assign) NSInteger activityCount;
49 -@property (readwrite, nonatomic, strong) NSTimer *activationDelayTimer;  
50 -@property (readwrite, nonatomic, strong) NSTimer *completionDelayTimer;  
51 -@property (readonly, nonatomic, getter = isNetworkActivityOccurring) BOOL networkActivityOccurring;  
52 -@property (nonatomic, copy) AFNetworkActivityActionBlock networkActivityActionBlock;  
53 -@property (nonatomic, assign) AFNetworkActivityManagerState currentState;  
54 -@property (nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;  
55 -  
56 -- (void)updateCurrentStateForNetworkActivityChange; 50 +@property (readwrite, nonatomic, strong) NSTimer *activityIndicatorVisibilityTimer;
  51 +@property (readonly, nonatomic, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
  52 +
  53 +- (void)updateNetworkActivityIndicatorVisibility;
  54 +- (void)updateNetworkActivityIndicatorVisibilityDelayed;
57 @end 55 @end
58 56
59 @implementation AFNetworkActivityIndicatorManager 57 @implementation AFNetworkActivityIndicatorManager
  58 +@dynamic networkActivityIndicatorVisible;
60 59
61 + (instancetype)sharedManager { 60 + (instancetype)sharedManager {
62 static AFNetworkActivityIndicatorManager *_sharedManager = nil; 61 static AFNetworkActivityIndicatorManager *_sharedManager = nil;
@@ -68,17 +67,24 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl @@ -68,17 +67,24 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
68 return _sharedManager; 67 return _sharedManager;
69 } 68 }
70 69
71 -- (instancetype)init { 70 ++ (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible {
  71 + return [NSSet setWithObject:@"activityCount"];
  72 +}
  73 +
  74 +- (id)init {
72 self = [super init]; 75 self = [super init];
73 if (!self) { 76 if (!self) {
74 return nil; 77 return nil;
75 } 78 }
76 - self.currentState = AFNetworkActivityManagerStateNotActive; 79 +
  80 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingOperationDidStartNotification object:nil];
  81 + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingOperationDidFinishNotification object:nil];
  82 +
  83 +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
77 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil]; 84 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil];
78 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil]; 85 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil];
79 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil]; 86 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil];
80 - self.activationDelay = kDefaultAFNetworkActivityManagerActivationDelay;  
81 - self.completionDelay = kDefaultAFNetworkActivityManagerCompletionDelay; 87 +#endif
82 88
83 return self; 89 return self;
84 } 90 }
@@ -86,40 +92,30 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl @@ -86,40 +92,30 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
86 - (void)dealloc { 92 - (void)dealloc {
87 [[NSNotificationCenter defaultCenter] removeObserver:self]; 93 [[NSNotificationCenter defaultCenter] removeObserver:self];
88 94
89 - [_activationDelayTimer invalidate];  
90 - [_completionDelayTimer invalidate]; 95 + [_activityIndicatorVisibilityTimer invalidate];
91 } 96 }
92 97
93 -- (void)setEnabled:(BOOL)enabled {  
94 - _enabled = enabled;  
95 - if (enabled == NO) {  
96 - [self setCurrentState:AFNetworkActivityManagerStateNotActive]; 98 +- (void)updateNetworkActivityIndicatorVisibilityDelayed {
  99 + if (self.enabled) {
  100 + // Delay hiding of activity indicator for a short interval, to avoid flickering
  101 + if (![self isNetworkActivityIndicatorVisible]) {
  102 + [self.activityIndicatorVisibilityTimer invalidate];
  103 + self.activityIndicatorVisibilityTimer = [NSTimer timerWithTimeInterval:kAFNetworkActivityIndicatorInvisibilityDelay target:self selector:@selector(updateNetworkActivityIndicatorVisibility) userInfo:nil repeats:NO];
  104 + [[NSRunLoop mainRunLoop] addTimer:self.activityIndicatorVisibilityTimer forMode:NSRunLoopCommonModes];
  105 + } else {
  106 + [self performSelectorOnMainThread:@selector(updateNetworkActivityIndicatorVisibility) withObject:nil waitUntilDone:NO modes:@[NSRunLoopCommonModes]];
  107 + }
97 } 108 }
98 } 109 }
99 110
100 -- (void)setNetworkingActivityActionWithBlock:(void (^)(BOOL networkActivityIndicatorVisible))block {  
101 - self.networkActivityActionBlock = block; 111 +- (BOOL)isNetworkActivityIndicatorVisible {
  112 + return self.activityCount > 0;
102 } 113 }
103 114
104 -- (BOOL)isNetworkActivityOccurring {  
105 - @synchronized(self) {  
106 - return self.activityCount > 0;  
107 - }  
108 -}  
109 -  
110 -- (void)setNetworkActivityIndicatorVisible:(BOOL)networkActivityIndicatorVisible {  
111 - if (_networkActivityIndicatorVisible != networkActivityIndicatorVisible) {  
112 - [self willChangeValueForKey:@"networkActivityIndicatorVisible"];  
113 - @synchronized(self) {  
114 - _networkActivityIndicatorVisible = networkActivityIndicatorVisible;  
115 - }  
116 - [self didChangeValueForKey:@"networkActivityIndicatorVisible"];  
117 - if (self.networkActivityActionBlock) {  
118 - self.networkActivityActionBlock(networkActivityIndicatorVisible);  
119 - } else {  
120 - [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:networkActivityIndicatorVisible];  
121 - }  
122 - } 115 +- (void)updateNetworkActivityIndicatorVisibility {
  116 +#if !defined(AF_APP_EXTENSIONS)
  117 + [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]];
  118 +#endif
123 } 119 }
124 120
125 - (void)setActivityCount:(NSInteger)activityCount { 121 - (void)setActivityCount:(NSInteger)activityCount {
@@ -128,7 +124,7 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl @@ -128,7 +124,7 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
128 } 124 }
129 125
130 dispatch_async(dispatch_get_main_queue(), ^{ 126 dispatch_async(dispatch_get_main_queue(), ^{
131 - [self updateCurrentStateForNetworkActivityChange]; 127 + [self updateNetworkActivityIndicatorVisibilityDelayed];
132 }); 128 });
133 } 129 }
134 130
@@ -140,19 +136,22 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl @@ -140,19 +136,22 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
140 [self didChangeValueForKey:@"activityCount"]; 136 [self didChangeValueForKey:@"activityCount"];
141 137
142 dispatch_async(dispatch_get_main_queue(), ^{ 138 dispatch_async(dispatch_get_main_queue(), ^{
143 - [self updateCurrentStateForNetworkActivityChange]; 139 + [self updateNetworkActivityIndicatorVisibilityDelayed];
144 }); 140 });
145 } 141 }
146 142
147 - (void)decrementActivityCount { 143 - (void)decrementActivityCount {
148 [self willChangeValueForKey:@"activityCount"]; 144 [self willChangeValueForKey:@"activityCount"];
149 @synchronized(self) { 145 @synchronized(self) {
  146 +#pragma clang diagnostic push
  147 +#pragma clang diagnostic ignored "-Wgnu"
150 _activityCount = MAX(_activityCount - 1, 0); 148 _activityCount = MAX(_activityCount - 1, 0);
  149 +#pragma clang diagnostic pop
151 } 150 }
152 [self didChangeValueForKey:@"activityCount"]; 151 [self didChangeValueForKey:@"activityCount"];
153 152
154 dispatch_async(dispatch_get_main_queue(), ^{ 153 dispatch_async(dispatch_get_main_queue(), ^{
155 - [self updateCurrentStateForNetworkActivityChange]; 154 + [self updateNetworkActivityIndicatorVisibilityDelayed];
156 }); 155 });
157 } 156 }
158 157
@@ -168,92 +167,6 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl @@ -168,92 +167,6 @@ typedef void (^AFNetworkActivityActionBlock)(BOOL networkActivityIndicatorVisibl
168 } 167 }
169 } 168 }
170 169
171 -#pragma mark - Internal State Management  
172 -- (void)setCurrentState:(AFNetworkActivityManagerState)currentState {  
173 - @synchronized(self) {  
174 - if (_currentState != currentState) {  
175 - [self willChangeValueForKey:@"currentState"];  
176 - _currentState = currentState;  
177 - switch (currentState) {  
178 - case AFNetworkActivityManagerStateNotActive:  
179 - [self cancelActivationDelayTimer];  
180 - [self cancelCompletionDelayTimer];  
181 - [self setNetworkActivityIndicatorVisible:NO];  
182 - break;  
183 - case AFNetworkActivityManagerStateDelayingStart:  
184 - [self startActivationDelayTimer];  
185 - break;  
186 - case AFNetworkActivityManagerStateActive:  
187 - [self cancelCompletionDelayTimer];  
188 - [self setNetworkActivityIndicatorVisible:YES];  
189 - break;  
190 - case AFNetworkActivityManagerStateDelayingEnd:  
191 - [self startCompletionDelayTimer];  
192 - break;  
193 - }  
194 - [self didChangeValueForKey:@"currentState"];  
195 - }  
196 -  
197 - }  
198 -}  
199 -  
200 -- (void)updateCurrentStateForNetworkActivityChange {  
201 - if (self.enabled) {  
202 - switch (self.currentState) {  
203 - case AFNetworkActivityManagerStateNotActive:  
204 - if (self.isNetworkActivityOccurring) {  
205 - [self setCurrentState:AFNetworkActivityManagerStateDelayingStart];  
206 - }  
207 - break;  
208 - case AFNetworkActivityManagerStateDelayingStart:  
209 - //No op. Let the delay timer finish out.  
210 - break;  
211 - case AFNetworkActivityManagerStateActive:  
212 - if (!self.isNetworkActivityOccurring) {  
213 - [self setCurrentState:AFNetworkActivityManagerStateDelayingEnd];  
214 - }  
215 - break;  
216 - case AFNetworkActivityManagerStateDelayingEnd:  
217 - if (self.isNetworkActivityOccurring) {  
218 - [self setCurrentState:AFNetworkActivityManagerStateActive];  
219 - }  
220 - break;  
221 - }  
222 - }  
223 -}  
224 -  
225 -- (void)startActivationDelayTimer {  
226 - self.activationDelayTimer = [NSTimer  
227 - timerWithTimeInterval:self.activationDelay target:self selector:@selector(activationDelayTimerFired) userInfo:nil repeats:NO];  
228 - [[NSRunLoop mainRunLoop] addTimer:self.activationDelayTimer forMode:NSRunLoopCommonModes];  
229 -}  
230 -  
231 -- (void)activationDelayTimerFired {  
232 - if (self.networkActivityOccurring) {  
233 - [self setCurrentState:AFNetworkActivityManagerStateActive];  
234 - } else {  
235 - [self setCurrentState:AFNetworkActivityManagerStateNotActive];  
236 - }  
237 -}  
238 -  
239 -- (void)startCompletionDelayTimer {  
240 - [self.completionDelayTimer invalidate];  
241 - self.completionDelayTimer = [NSTimer timerWithTimeInterval:self.completionDelay target:self selector:@selector(completionDelayTimerFired) userInfo:nil repeats:NO];  
242 - [[NSRunLoop mainRunLoop] addTimer:self.completionDelayTimer forMode:NSRunLoopCommonModes];  
243 -}  
244 -  
245 -- (void)completionDelayTimerFired {  
246 - [self setCurrentState:AFNetworkActivityManagerStateNotActive];  
247 -}  
248 -  
249 -- (void)cancelActivationDelayTimer {  
250 - [self.activationDelayTimer invalidate];  
251 -}  
252 -  
253 -- (void)cancelCompletionDelayTimer {  
254 - [self.completionDelayTimer invalidate];  
255 -}  
256 -  
257 @end 170 @end
258 171
259 #endif 172 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
1 // UIActivityIndicatorView+AFNetworking.h 1 // UIActivityIndicatorView+AFNetworking.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,14 +21,16 @@ @@ -21,14 +21,16 @@
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 23
24 -#import <TargetConditionals.h> 24 +#import <Availability.h>
25 25
26 -#if TARGET_OS_IOS || TARGET_OS_TV 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 #import <UIKit/UIKit.h> 28 #import <UIKit/UIKit.h>
29 29
  30 +@class AFURLConnectionOperation;
  31 +
30 /** 32 /**
31 - 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. 33 + 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 request operation or session task.
32 */ 34 */
33 @interface UIActivityIndicatorView (AFNetworking) 35 @interface UIActivityIndicatorView (AFNetworking)
34 36
@@ -41,7 +43,20 @@ @@ -41,7 +43,20 @@
41 43
42 @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 44 @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
43 */ 45 */
44 -- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; 46 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
  47 +- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task;
  48 +#endif
  49 +
  50 +///---------------------------------------
  51 +/// @name Animating for Request Operations
  52 +///---------------------------------------
  53 +
  54 +/**
  55 + Binds the animating state to the execution state of the specified operation.
  56 +
  57 + @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
  58 + */
  59 +- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation;
45 60
46 @end 61 @end
47 62
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m
1 // UIActivityIndicatorView+AFNetworking.m 1 // UIActivityIndicatorView+AFNetworking.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -20,62 +20,31 @@ @@ -20,62 +20,31 @@
20 // THE SOFTWARE. 20 // THE SOFTWARE.
21 21
22 #import "UIActivityIndicatorView+AFNetworking.h" 22 #import "UIActivityIndicatorView+AFNetworking.h"
23 -#import <objc/runtime.h>  
24 23
25 -#if TARGET_OS_IOS || TARGET_OS_TV 24 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
26 25
27 -#import "AFURLSessionManager.h"  
28 -  
29 -@interface AFActivityIndicatorViewNotificationObserver : NSObject  
30 -@property (readonly, nonatomic, weak) UIActivityIndicatorView *activityIndicatorView;  
31 -- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView;  
32 -  
33 -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task; 26 +#import "AFHTTPRequestOperation.h"
34 27
35 -@end 28 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
  29 +#import "AFURLSessionManager.h"
  30 +#endif
36 31
37 @implementation UIActivityIndicatorView (AFNetworking) 32 @implementation UIActivityIndicatorView (AFNetworking)
38 33
39 -- (AFActivityIndicatorViewNotificationObserver *)af_notificationObserver {  
40 - AFActivityIndicatorViewNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));  
41 - if (notificationObserver == nil) {  
42 - notificationObserver = [[AFActivityIndicatorViewNotificationObserver alloc] initWithActivityIndicatorView:self];  
43 - objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);  
44 - }  
45 - return notificationObserver;  
46 -}  
47 -  
48 -- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {  
49 - [[self af_notificationObserver] setAnimatingWithStateOfTask:task];  
50 -}  
51 -  
52 -@end  
53 -  
54 -@implementation AFActivityIndicatorViewNotificationObserver  
55 -  
56 -- (instancetype)initWithActivityIndicatorView:(UIActivityIndicatorView *)activityIndicatorView  
57 -{  
58 - self = [super init];  
59 - if (self) {  
60 - _activityIndicatorView = activityIndicatorView;  
61 - }  
62 - return self;  
63 -}  
64 - 34 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
65 - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task { 35 - (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
66 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 36 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
67 37
68 [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 38 [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
69 [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 39 [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
70 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 40 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
71 - 41 +
72 if (task) { 42 if (task) {
73 if (task.state != NSURLSessionTaskStateCompleted) { 43 if (task.state != NSURLSessionTaskStateCompleted) {
74 - UIActivityIndicatorView *activityIndicatorView = self.activityIndicatorView;  
75 if (task.state == NSURLSessionTaskStateRunning) { 44 if (task.state == NSURLSessionTaskStateRunning) {
76 - [activityIndicatorView startAnimating]; 45 + [self startAnimating];
77 } else { 46 } else {
78 - [activityIndicatorView stopAnimating]; 47 + [self stopAnimating];
79 } 48 }
80 49
81 [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task]; 50 [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task];
@@ -84,29 +53,61 @@ @@ -84,29 +53,61 @@
84 } 53 }
85 } 54 }
86 } 55 }
  56 +#endif
  57 +
  58 +#pragma mark -
  59 +
  60 +- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation {
  61 + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
  62 +
  63 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
  64 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
  65 +
  66 + if (operation) {
  67 + if (![operation isFinished]) {
  68 + if ([operation isExecuting]) {
  69 + [self startAnimating];
  70 + } else {
  71 + [self stopAnimating];
  72 + }
  73 +
  74 + [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingOperationDidStartNotification object:operation];
  75 + [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingOperationDidFinishNotification object:operation];
  76 + }
  77 + }
  78 +}
87 79
88 #pragma mark - 80 #pragma mark -
89 81
90 - (void)af_startAnimating { 82 - (void)af_startAnimating {
91 dispatch_async(dispatch_get_main_queue(), ^{ 83 dispatch_async(dispatch_get_main_queue(), ^{
92 - [self.activityIndicatorView startAnimating]; 84 + [self startAnimating];
93 }); 85 });
94 } 86 }
95 87
96 - (void)af_stopAnimating { 88 - (void)af_stopAnimating {
97 dispatch_async(dispatch_get_main_queue(), ^{ 89 dispatch_async(dispatch_get_main_queue(), ^{
98 - [self.activityIndicatorView stopAnimating]; 90 + [self stopAnimating];
99 }); 91 });
100 } 92 }
101 93
102 #pragma mark - 94 #pragma mark -
103 95
104 -- (void)dealloc { 96 +-(void)dealloc
  97 +{
105 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 98 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
106 99
  100 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
107 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 101 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
108 [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 102 [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
109 [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 103 [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
  104 +#endif
  105 +
  106 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
  107 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
  108 +
  109 + [notificationCenter removeObserver:self];//add by lc
  110 +
110 } 111 }
111 112
112 @end 113 @end
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h
1 // UIButton+AFNetworking.h 1 // UIButton+AFNetworking.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,15 +21,13 @@ @@ -21,15 +21,13 @@
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 23
24 -#import <TargetConditionals.h> 24 +#import <Availability.h>
25 25
26 -#if TARGET_OS_IOS || TARGET_OS_TV 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 #import <UIKit/UIKit.h> 28 #import <UIKit/UIKit.h>
29 29
30 -NS_ASSUME_NONNULL_BEGIN  
31 -  
32 -@class AFImageDownloader; 30 +@protocol AFURLResponseSerialization, AFImageCache;
33 31
34 /** 32 /**
35 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. 33 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.
@@ -38,21 +36,32 @@ NS_ASSUME_NONNULL_BEGIN @@ -38,21 +36,32 @@ NS_ASSUME_NONNULL_BEGIN
38 */ 36 */
39 @interface UIButton (AFNetworking) 37 @interface UIButton (AFNetworking)
40 38
41 -///------------------------------------  
42 -/// @name Accessing the Image Downloader  
43 -///------------------------------------ 39 +///----------------------------
  40 +/// @name Accessing Image Cache
  41 +///----------------------------
  42 +
  43 +/**
  44 + The image cache used to improve image loading performance on scroll views. By default, `UIButton` will use the `sharedImageCache` of `UIImageView`.
  45 + */
  46 ++ (id <AFImageCache>)sharedImageCache;
44 47
45 /** 48 /**
46 - Set the shared image downloader used to download images. 49 + Set the cache used for image loading.
47 50
48 - @param imageDownloader The shared image downloader used to download images.  
49 -*/  
50 -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; 51 + @param imageCache The image cache.
  52 + */
  53 ++ (void)setSharedImageCache:(id <AFImageCache>)imageCache;
  54 +
  55 +///------------------------------------
  56 +/// @name Accessing Response Serializer
  57 +///------------------------------------
51 58
52 /** 59 /**
53 - The shared image downloader used to download images. 60 + The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
  61 +
  62 + @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer
54 */ 63 */
55 -+ (AFImageDownloader *)sharedImageDownloader; 64 +@property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
56 65
57 ///-------------------- 66 ///--------------------
58 /// @name Setting Image 67 /// @name Setting Image
@@ -80,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -80,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN
80 */ 89 */
81 - (void)setImageForState:(UIControlState)state 90 - (void)setImageForState:(UIControlState)state
82 withURL:(NSURL *)url 91 withURL:(NSURL *)url
83 - placeholderImage:(nullable UIImage *)placeholderImage; 92 + placeholderImage:(UIImage *)placeholderImage;
84 93
85 /** 94 /**
86 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. 95 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.
@@ -92,14 +101,14 @@ NS_ASSUME_NONNULL_BEGIN @@ -92,14 +101,14 @@ NS_ASSUME_NONNULL_BEGIN
92 @param state The control state. 101 @param state The control state.
93 @param urlRequest The URL request used for the image request. 102 @param urlRequest The URL request used for the image request.
94 @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. 103 @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.
95 - @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`.  
96 - @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. 104 + @param success A block to be executed when the image request operation finishes successfully. This block has no return value and takes two arguments: the server response and the image. If the image was returned from cache, the request and response parameters will be `nil`.
  105 + @param failure A block object to be executed when the image request operation finishes unsuccessfully, or that finishes successfully. This block has no return value and takes a single argument: the error that occurred.
97 */ 106 */
98 - (void)setImageForState:(UIControlState)state 107 - (void)setImageForState:(UIControlState)state
99 withURLRequest:(NSURLRequest *)urlRequest 108 withURLRequest:(NSURLRequest *)urlRequest
100 - placeholderImage:(nullable UIImage *)placeholderImage  
101 - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success  
102 - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; 109 + placeholderImage:(UIImage *)placeholderImage
  110 + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
  111 + failure:(void (^)(NSError *error))failure;
103 112
104 113
105 ///------------------------------- 114 ///-------------------------------
@@ -128,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -128,7 +137,7 @@ NS_ASSUME_NONNULL_BEGIN
128 */ 137 */
129 - (void)setBackgroundImageForState:(UIControlState)state 138 - (void)setBackgroundImageForState:(UIControlState)state
130 withURL:(NSURL *)url 139 withURL:(NSURL *)url
131 - placeholderImage:(nullable UIImage *)placeholderImage; 140 + placeholderImage:(UIImage *)placeholderImage;
132 141
133 /** 142 /**
134 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. 143 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.
@@ -140,14 +149,12 @@ NS_ASSUME_NONNULL_BEGIN @@ -140,14 +149,12 @@ NS_ASSUME_NONNULL_BEGIN
140 @param state The control state. 149 @param state The control state.
141 @param urlRequest The URL request used for the image request. 150 @param urlRequest The URL request used for the image request.
142 @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. 151 @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.
143 - @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`.  
144 - @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.  
145 */ 152 */
146 - (void)setBackgroundImageForState:(UIControlState)state 153 - (void)setBackgroundImageForState:(UIControlState)state
147 withURLRequest:(NSURLRequest *)urlRequest 154 withURLRequest:(NSURLRequest *)urlRequest
148 - placeholderImage:(nullable UIImage *)placeholderImage  
149 - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success  
150 - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; 155 + placeholderImage:(UIImage *)placeholderImage
  156 + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
  157 + failure:(void (^)(NSError *error))failure;
151 158
152 159
153 ///------------------------------ 160 ///------------------------------
@@ -155,21 +162,19 @@ NS_ASSUME_NONNULL_BEGIN @@ -155,21 +162,19 @@ NS_ASSUME_NONNULL_BEGIN
155 ///------------------------------ 162 ///------------------------------
156 163
157 /** 164 /**
158 - Cancels any executing image task for the specified control state of the receiver, if one exists. 165 + Cancels any executing image operation for the specified control state of the receiver, if one exists.
159 166
160 @param state The control state. 167 @param state The control state.
161 */ 168 */
162 -- (void)cancelImageDownloadTaskForState:(UIControlState)state; 169 +- (void)cancelImageRequestOperationForState:(UIControlState)state;
163 170
164 /** 171 /**
165 - Cancels any executing background image task for the specified control state of the receiver, if one exists. 172 + Cancels any executing background image operation for the specified control state of the receiver, if one exists.
166 173
167 @param state The control state. 174 @param state The control state.
168 */ 175 */
169 -- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state; 176 +- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state;
170 177
171 @end 178 @end
172 179
173 -NS_ASSUME_NONNULL_END  
174 -  
175 #endif 180 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m
1 // UIButton+AFNetworking.m 1 // UIButton+AFNetworking.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -23,76 +23,89 @@ @@ -23,76 +23,89 @@
23 23
24 #import <objc/runtime.h> 24 #import <objc/runtime.h>
25 25
26 -#if TARGET_OS_IOS || TARGET_OS_TV 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
  27 +
  28 +#import "AFURLResponseSerialization.h"
  29 +#import "AFHTTPRequestOperation.h"
27 30
28 #import "UIImageView+AFNetworking.h" 31 #import "UIImageView+AFNetworking.h"
29 -#import "AFImageDownloader.h"  
30 32
31 @interface UIButton (_AFNetworking) 33 @interface UIButton (_AFNetworking)
32 @end 34 @end
33 35
34 @implementation UIButton (_AFNetworking) 36 @implementation UIButton (_AFNetworking)
35 37
  38 ++ (NSOperationQueue *)af_sharedImageRequestOperationQueue {
  39 + static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil;
  40 + static dispatch_once_t onceToken;
  41 + dispatch_once(&onceToken, ^{
  42 + _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init];
  43 + _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount;
  44 + });
  45 +
  46 + return _af_sharedImageRequestOperationQueue;
  47 +}
  48 +
36 #pragma mark - 49 #pragma mark -
37 50
38 -static char AFImageDownloadReceiptNormal;  
39 -static char AFImageDownloadReceiptHighlighted;  
40 -static char AFImageDownloadReceiptSelected;  
41 -static char AFImageDownloadReceiptDisabled; 51 +static char AFImageRequestOperationNormal;
  52 +static char AFImageRequestOperationHighlighted;
  53 +static char AFImageRequestOperationSelected;
  54 +static char AFImageRequestOperationDisabled;
42 55
43 -static const char * af_imageDownloadReceiptKeyForState(UIControlState state) { 56 +static const char * af_imageRequestOperationKeyForState(UIControlState state) {
44 switch (state) { 57 switch (state) {
45 case UIControlStateHighlighted: 58 case UIControlStateHighlighted:
46 - return &AFImageDownloadReceiptHighlighted; 59 + return &AFImageRequestOperationHighlighted;
47 case UIControlStateSelected: 60 case UIControlStateSelected:
48 - return &AFImageDownloadReceiptSelected; 61 + return &AFImageRequestOperationSelected;
49 case UIControlStateDisabled: 62 case UIControlStateDisabled:
50 - return &AFImageDownloadReceiptDisabled; 63 + return &AFImageRequestOperationDisabled;
51 case UIControlStateNormal: 64 case UIControlStateNormal:
52 default: 65 default:
53 - return &AFImageDownloadReceiptNormal; 66 + return &AFImageRequestOperationNormal;
54 } 67 }
55 } 68 }
56 69
57 -- (AFImageDownloadReceipt *)af_imageDownloadReceiptForState:(UIControlState)state {  
58 - return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_imageDownloadReceiptKeyForState(state)); 70 +- (AFHTTPRequestOperation *)af_imageRequestOperationForState:(UIControlState)state {
  71 + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_imageRequestOperationKeyForState(state));
59 } 72 }
60 73
61 -- (void)af_setImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt 74 +- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation
62 forState:(UIControlState)state 75 forState:(UIControlState)state
63 { 76 {
64 - objc_setAssociatedObject(self, af_imageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 77 + objc_setAssociatedObject(self, af_imageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
65 } 78 }
66 79
67 #pragma mark - 80 #pragma mark -
68 81
69 -static char AFBackgroundImageDownloadReceiptNormal;  
70 -static char AFBackgroundImageDownloadReceiptHighlighted;  
71 -static char AFBackgroundImageDownloadReceiptSelected;  
72 -static char AFBackgroundImageDownloadReceiptDisabled; 82 +static char AFBackgroundImageRequestOperationNormal;
  83 +static char AFBackgroundImageRequestOperationHighlighted;
  84 +static char AFBackgroundImageRequestOperationSelected;
  85 +static char AFBackgroundImageRequestOperationDisabled;
73 86
74 -static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState state) { 87 +static const char * af_backgroundImageRequestOperationKeyForState(UIControlState state) {
75 switch (state) { 88 switch (state) {
76 case UIControlStateHighlighted: 89 case UIControlStateHighlighted:
77 - return &AFBackgroundImageDownloadReceiptHighlighted; 90 + return &AFBackgroundImageRequestOperationHighlighted;
78 case UIControlStateSelected: 91 case UIControlStateSelected:
79 - return &AFBackgroundImageDownloadReceiptSelected; 92 + return &AFBackgroundImageRequestOperationSelected;
80 case UIControlStateDisabled: 93 case UIControlStateDisabled:
81 - return &AFBackgroundImageDownloadReceiptDisabled; 94 + return &AFBackgroundImageRequestOperationDisabled;
82 case UIControlStateNormal: 95 case UIControlStateNormal:
83 default: 96 default:
84 - return &AFBackgroundImageDownloadReceiptNormal; 97 + return &AFBackgroundImageRequestOperationNormal;
85 } 98 }
86 } 99 }
87 100
88 -- (AFImageDownloadReceipt *)af_backgroundImageDownloadReceiptForState:(UIControlState)state {  
89 - return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state)); 101 +- (AFHTTPRequestOperation *)af_backgroundImageRequestOperationForState:(UIControlState)state {
  102 + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state));
90 } 103 }
91 104
92 -- (void)af_setBackgroundImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt 105 +- (void)af_setBackgroundImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation
93 forState:(UIControlState)state 106 forState:(UIControlState)state
94 { 107 {
95 - objc_setAssociatedObject(self, af_backgroundImageDownloadReceiptKeyForState(state), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 108 + objc_setAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
96 } 109 }
97 110
98 @end 111 @end
@@ -101,13 +114,34 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState @@ -101,13 +114,34 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
101 114
102 @implementation UIButton (AFNetworking) 115 @implementation UIButton (AFNetworking)
103 116
104 -+ (AFImageDownloader *)sharedImageDownloader { 117 ++ (id <AFImageCache>)sharedImageCache {
  118 +#pragma clang diagnostic push
  119 +#pragma clang diagnostic ignored "-Wgnu"
  120 + return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: [UIImageView sharedImageCache];
  121 +#pragma clang diagnostic pop
  122 +}
105 123
106 - return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; 124 ++ (void)setSharedImageCache:(id <AFImageCache>)imageCache {
  125 + objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
107 } 126 }
108 127
109 -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {  
110 - objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 128 +#pragma mark -
  129 +
  130 +- (id <AFURLResponseSerialization>)imageResponseSerializer {
  131 + static id <AFURLResponseSerialization> _af_defaultImageResponseSerializer = nil;
  132 + static dispatch_once_t onceToken;
  133 + dispatch_once(&onceToken, ^{
  134 + _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer];
  135 + });
  136 +
  137 +#pragma clang diagnostic push
  138 +#pragma clang diagnostic ignored "-Wgnu"
  139 + return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer;
  140 +#pragma clang diagnostic pop
  141 +}
  142 +
  143 +- (void)setImageResponseSerializer:(id <AFURLResponseSerialization>)serializer {
  144 + objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
111 } 145 }
112 146
113 #pragma mark - 147 #pragma mark -
@@ -130,62 +164,49 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState @@ -130,62 +164,49 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
130 164
131 - (void)setImageForState:(UIControlState)state 165 - (void)setImageForState:(UIControlState)state
132 withURLRequest:(NSURLRequest *)urlRequest 166 withURLRequest:(NSURLRequest *)urlRequest
133 - placeholderImage:(nullable UIImage *)placeholderImage  
134 - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success  
135 - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure 167 + placeholderImage:(UIImage *)placeholderImage
  168 + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
  169 + failure:(void (^)(NSError *error))failure
136 { 170 {
137 - if ([self isActiveTaskURLEqualToURLRequest:urlRequest forState:state]) {  
138 - return;  
139 - }  
140 -  
141 - [self cancelImageDownloadTaskForState:state];  
142 -  
143 - AFImageDownloader *downloader = [[self class] sharedImageDownloader];  
144 - id <AFImageRequestCache> imageCache = downloader.imageCache; 171 + [self cancelImageRequestOperationForState:state];
145 172
146 - //Use the image from the image cache if it exists  
147 - UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; 173 + UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
148 if (cachedImage) { 174 if (cachedImage) {
149 if (success) { 175 if (success) {
150 - success(urlRequest, nil, cachedImage); 176 + success(nil, nil, cachedImage);
151 } else { 177 } else {
152 [self setImage:cachedImage forState:state]; 178 [self setImage:cachedImage forState:state];
153 } 179 }
154 - [self af_setImageDownloadReceipt:nil forState:state]; 180 +
  181 + [self af_setImageRequestOperation:nil forState:state];
155 } else { 182 } else {
156 if (placeholderImage) { 183 if (placeholderImage) {
157 [self setImage:placeholderImage forState:state]; 184 [self setImage:placeholderImage forState:state];
158 } 185 }
159 186
160 __weak __typeof(self)weakSelf = self; 187 __weak __typeof(self)weakSelf = self;
161 - NSUUID *downloadID = [NSUUID UUID];  
162 - AFImageDownloadReceipt *receipt;  
163 - receipt = [downloader  
164 - downloadImageForURLRequest:urlRequest  
165 - withReceiptID:downloadID  
166 - success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) {  
167 - __strong __typeof(weakSelf)strongSelf = weakSelf;  
168 - if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {  
169 - if (success) {  
170 - success(request, response, responseObject);  
171 - } else if(responseObject) {  
172 - [strongSelf setImage:responseObject forState:state];  
173 - }  
174 - [strongSelf af_setImageDownloadReceipt:nil forState:state];  
175 - }  
176 -  
177 - }  
178 - failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {  
179 - __strong __typeof(weakSelf)strongSelf = weakSelf;  
180 - if ([[strongSelf af_imageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {  
181 - if (failure) {  
182 - failure(request, response, error);  
183 - }  
184 - [strongSelf af_setImageDownloadReceipt:nil forState:state];  
185 - }  
186 - }];  
187 -  
188 - [self af_setImageDownloadReceipt:receipt forState:state]; 188 + AFHTTPRequestOperation *imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
  189 + imageRequestOperation.responseSerializer = self.imageResponseSerializer;
  190 + [imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
  191 + __strong __typeof(weakSelf)strongSelf = weakSelf;
  192 + if ([[urlRequest URL] isEqual:[operation.request URL]]) {
  193 + if (success) {
  194 + success(operation.request, operation.response, responseObject);
  195 + } else if (responseObject) {
  196 + [strongSelf setImage:responseObject forState:state];
  197 + }
  198 + }
  199 + [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
  200 + } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
  201 + if ([[urlRequest URL] isEqual:[operation.request URL]]) {
  202 + if (failure) {
  203 + failure(error);
  204 + }
  205 + }
  206 + }];
  207 +
  208 + [self af_setImageRequestOperation:imageRequestOperation forState:state];
  209 + [[[self class] af_sharedImageRequestOperationQueue] addOperation:imageRequestOperation];
189 } 210 }
190 } 211 }
191 212
@@ -199,7 +220,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState @@ -199,7 +220,7 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
199 220
200 - (void)setBackgroundImageForState:(UIControlState)state 221 - (void)setBackgroundImageForState:(UIControlState)state
201 withURL:(NSURL *)url 222 withURL:(NSURL *)url
202 - placeholderImage:(nullable UIImage *)placeholderImage 223 + placeholderImage:(UIImage *)placeholderImage
203 { 224 {
204 NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 225 NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
205 [request addValue:@"image/*" forHTTPHeaderField:@"Accept"]; 226 [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
@@ -209,94 +230,64 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState @@ -209,94 +230,64 @@ static const char * af_backgroundImageDownloadReceiptKeyForState(UIControlState
209 230
210 - (void)setBackgroundImageForState:(UIControlState)state 231 - (void)setBackgroundImageForState:(UIControlState)state
211 withURLRequest:(NSURLRequest *)urlRequest 232 withURLRequest:(NSURLRequest *)urlRequest
212 - placeholderImage:(nullable UIImage *)placeholderImage  
213 - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success  
214 - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure 233 + placeholderImage:(UIImage *)placeholderImage
  234 + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
  235 + failure:(void (^)(NSError *error))failure
215 { 236 {
216 - if ([self isActiveBackgroundTaskURLEqualToURLRequest:urlRequest forState:state]) {  
217 - return;  
218 - }  
219 -  
220 - [self cancelBackgroundImageDownloadTaskForState:state]; 237 + [self cancelBackgroundImageRequestOperationForState:state];
221 238
222 - AFImageDownloader *downloader = [[self class] sharedImageDownloader];  
223 - id <AFImageRequestCache> imageCache = downloader.imageCache;  
224 -  
225 - //Use the image from the image cache if it exists  
226 - UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; 239 + UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
227 if (cachedImage) { 240 if (cachedImage) {
228 if (success) { 241 if (success) {
229 - success(urlRequest, nil, cachedImage); 242 + success(nil, nil, cachedImage);
230 } else { 243 } else {
231 [self setBackgroundImage:cachedImage forState:state]; 244 [self setBackgroundImage:cachedImage forState:state];
232 } 245 }
233 - [self af_setBackgroundImageDownloadReceipt:nil forState:state]; 246 +
  247 + [self af_setBackgroundImageRequestOperation:nil forState:state];
234 } else { 248 } else {
235 if (placeholderImage) { 249 if (placeholderImage) {
236 [self setBackgroundImage:placeholderImage forState:state]; 250 [self setBackgroundImage:placeholderImage forState:state];
237 } 251 }
238 252
239 __weak __typeof(self)weakSelf = self; 253 __weak __typeof(self)weakSelf = self;
240 - NSUUID *downloadID = [NSUUID UUID];  
241 - AFImageDownloadReceipt *receipt;  
242 - receipt = [downloader  
243 - downloadImageForURLRequest:urlRequest  
244 - withReceiptID:downloadID  
245 - success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) {  
246 - __strong __typeof(weakSelf)strongSelf = weakSelf;  
247 - if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {  
248 - if (success) {  
249 - success(request, response, responseObject);  
250 - } else if(responseObject) {  
251 - [strongSelf setBackgroundImage:responseObject forState:state];  
252 - }  
253 - [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state];  
254 - }  
255 -  
256 - }  
257 - failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {  
258 - __strong __typeof(weakSelf)strongSelf = weakSelf;  
259 - if ([[strongSelf af_backgroundImageDownloadReceiptForState:state].receiptID isEqual:downloadID]) {  
260 - if (failure) {  
261 - failure(request, response, error);  
262 - }  
263 - [strongSelf af_setBackgroundImageDownloadReceipt:nil forState:state];  
264 - }  
265 - }];  
266 -  
267 - [self af_setBackgroundImageDownloadReceipt:receipt forState:state]; 254 + AFHTTPRequestOperation *backgroundImageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
  255 + backgroundImageRequestOperation.responseSerializer = self.imageResponseSerializer;
  256 + [backgroundImageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
  257 + __strong __typeof(weakSelf)strongSelf = weakSelf;
  258 + if ([[urlRequest URL] isEqual:[operation.request URL]]) {
  259 + if (success) {
  260 + success(operation.request, operation.response, responseObject);
  261 + } else if (responseObject) {
  262 + [strongSelf setBackgroundImage:responseObject forState:state];
  263 + }
  264 + }
  265 + [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
  266 + } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
  267 + if ([[urlRequest URL] isEqual:[operation.request URL]]) {
  268 + if (failure) {
  269 + failure(error);
  270 + }
  271 + }
  272 + }];
  273 +
  274 + [self af_setBackgroundImageRequestOperation:backgroundImageRequestOperation forState:state];
  275 + [[[self class] af_sharedImageRequestOperationQueue] addOperation:backgroundImageRequestOperation];
268 } 276 }
269 } 277 }
270 278
271 #pragma mark - 279 #pragma mark -
272 280
273 -- (void)cancelImageDownloadTaskForState:(UIControlState)state {  
274 - AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state];  
275 - if (receipt != nil) {  
276 - [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt];  
277 - [self af_setImageDownloadReceipt:nil forState:state];  
278 - }  
279 -}  
280 -  
281 -- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state {  
282 - AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state];  
283 - if (receipt != nil) {  
284 - [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:receipt];  
285 - [self af_setBackgroundImageDownloadReceipt:nil forState:state];  
286 - }  
287 -}  
288 -  
289 -- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state {  
290 - AFImageDownloadReceipt *receipt = [self af_imageDownloadReceiptForState:state];  
291 - return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; 281 +- (void)cancelImageRequestOperationForState:(UIControlState)state {
  282 + [[self af_imageRequestOperationForState:state] cancel];
  283 + [self af_setImageRequestOperation:nil forState:state];
292 } 284 }
293 285
294 -- (BOOL)isActiveBackgroundTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest forState:(UIControlState)state {  
295 - AFImageDownloadReceipt *receipt = [self af_backgroundImageDownloadReceiptForState:state];  
296 - return [receipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; 286 +- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state {
  287 + [[self af_backgroundImageRequestOperationForState:state] cancel];
  288 + [self af_setBackgroundImageRequestOperation:nil forState:state];
297 } 289 }
298 290
299 -  
300 @end 291 @end
301 292
302 #endif 293 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h
1 // UIImageView+AFNetworking.h 1 // UIImageView+AFNetworking.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,36 +21,45 @@ @@ -21,36 +21,45 @@
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 23
24 -#import <TargetConditionals.h> 24 +#import <Availability.h>
25 25
26 -#if TARGET_OS_IOS || TARGET_OS_TV 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 #import <UIKit/UIKit.h> 28 #import <UIKit/UIKit.h>
29 29
30 -NS_ASSUME_NONNULL_BEGIN  
31 -  
32 -@class AFImageDownloader; 30 +@protocol AFURLResponseSerialization, AFImageCache;
33 31
34 /** 32 /**
35 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. 33 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.
36 */ 34 */
37 @interface UIImageView (AFNetworking) 35 @interface UIImageView (AFNetworking)
38 36
39 -///------------------------------------  
40 -/// @name Accessing the Image Downloader  
41 -///------------------------------------ 37 +///----------------------------
  38 +/// @name Accessing Image Cache
  39 +///----------------------------
42 40
43 /** 41 /**
44 - Set the shared image downloader used to download images. 42 + The image cache used to improve image loading performance on scroll views. By default, this is an `NSCache` subclass conforming to the `AFImageCache` protocol, which listens for notification warnings and evicts objects accordingly.
  43 +*/
  44 ++ (id <AFImageCache>)sharedImageCache;
45 45
46 - @param imageDownloader The shared image downloader used to download images. 46 +/**
  47 + Set the cache used for image loading.
  48 +
  49 + @param imageCache The image cache.
47 */ 50 */
48 -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; 51 ++ (void)setSharedImageCache:(id <AFImageCache>)imageCache;
  52 +
  53 +///------------------------------------
  54 +/// @name Accessing Response Serializer
  55 +///------------------------------------
49 56
50 /** 57 /**
51 - The shared image downloader used to download images. 58 + The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
  59 +
  60 + @discussion Subclasses of `AFImageResponseSerializer` could be used to perform post-processing, such as color correction, face detection, or other effects. See https://github.com/AFNetworking/AFCoreImageSerializer
52 */ 61 */
53 -+ (AFImageDownloader *)sharedImageDownloader; 62 +@property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
54 63
55 ///-------------------- 64 ///--------------------
56 /// @name Setting Image 65 /// @name Setting Image
@@ -78,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN @@ -78,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN
78 @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. 87 @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.
79 */ 88 */
80 - (void)setImageWithURL:(NSURL *)url 89 - (void)setImageWithURL:(NSURL *)url
81 - placeholderImage:(nullable UIImage *)placeholderImage; 90 + placeholderImage:(UIImage *)placeholderImage;
82 91
83 /** 92 /**
84 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. 93 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.
@@ -89,21 +98,45 @@ NS_ASSUME_NONNULL_BEGIN @@ -89,21 +98,45 @@ NS_ASSUME_NONNULL_BEGIN
89 98
90 @param urlRequest The URL request used for the image request. 99 @param urlRequest The URL request used for the image request.
91 @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. 100 @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.
92 - @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`.  
93 - @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. 101 + @param success A block to be executed when the image request operation 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 request and response parameters will be `nil`.
  102 + @param failure A block object to be executed when the image request operation 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.
94 */ 103 */
95 - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 104 - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
96 - placeholderImage:(nullable UIImage *)placeholderImage  
97 - success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success  
98 - failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; 105 + placeholderImage:(UIImage *)placeholderImage
  106 + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
  107 + failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure;
99 108
100 /** 109 /**
101 Cancels any executing image operation for the receiver, if one exists. 110 Cancels any executing image operation for the receiver, if one exists.
102 */ 111 */
103 -- (void)cancelImageDownloadTask; 112 +- (void)cancelImageRequestOperation;
104 113
105 @end 114 @end
106 115
107 -NS_ASSUME_NONNULL_END 116 +#pragma mark -
  117 +
  118 +/**
  119 + The `AFImageCache` protocol is adopted by an object used to cache images loaded by the AFNetworking category on `UIImageView`.
  120 + */
  121 +@protocol AFImageCache <NSObject>
  122 +
  123 +/**
  124 + Returns a cached image for the specififed request, if available.
  125 +
  126 + @param request The image request.
  127 +
  128 + @return The cached image.
  129 + */
  130 +- (UIImage *)cachedImageForRequest:(NSURLRequest *)request;
  131 +
  132 +/**
  133 + Caches a particular image for the specified request.
  134 +
  135 + @param image The image to cache.
  136 + @param request The request to be used as a cache key.
  137 + */
  138 +- (void)cacheImage:(UIImage *)image
  139 + forRequest:(NSURLRequest *)request;
  140 +@end
108 141
109 #endif 142 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m
1 // UIImageView+AFNetworking.m 1 // UIImageView+AFNetworking.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -23,22 +23,38 @@ @@ -23,22 +23,38 @@
23 23
24 #import <objc/runtime.h> 24 #import <objc/runtime.h>
25 25
26 -#if TARGET_OS_IOS || TARGET_OS_TV 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 -#import "AFImageDownloader.h" 28 +#import "AFHTTPRequestOperation.h"
  29 +
  30 +@interface AFImageCache : NSCache <AFImageCache>
  31 +@end
  32 +
  33 +#pragma mark -
29 34
30 @interface UIImageView (_AFNetworking) 35 @interface UIImageView (_AFNetworking)
31 -@property (readwrite, nonatomic, strong, setter = af_setActiveImageDownloadReceipt:) AFImageDownloadReceipt *af_activeImageDownloadReceipt; 36 +@property (readwrite, nonatomic, strong, setter = af_setImageRequestOperation:) AFHTTPRequestOperation *af_imageRequestOperation;
32 @end 37 @end
33 38
34 @implementation UIImageView (_AFNetworking) 39 @implementation UIImageView (_AFNetworking)
35 40
36 -- (AFImageDownloadReceipt *)af_activeImageDownloadReceipt {  
37 - return (AFImageDownloadReceipt *)objc_getAssociatedObject(self, @selector(af_activeImageDownloadReceipt)); 41 ++ (NSOperationQueue *)af_sharedImageRequestOperationQueue {
  42 + static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil;
  43 + static dispatch_once_t onceToken;
  44 + dispatch_once(&onceToken, ^{
  45 + _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init];
  46 + _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount;
  47 + });
  48 +
  49 + return _af_sharedImageRequestOperationQueue;
  50 +}
  51 +
  52 +- (AFHTTPRequestOperation *)af_imageRequestOperation {
  53 + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_imageRequestOperation));
38 } 54 }
39 55
40 -- (void)af_setActiveImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt {  
41 - objc_setAssociatedObject(self, @selector(af_activeImageDownloadReceipt), imageDownloadReceipt, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 56 +- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation {
  57 + objc_setAssociatedObject(self, @selector(af_imageRequestOperation), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
42 } 58 }
43 59
44 @end 60 @end
@@ -46,13 +62,46 @@ @@ -46,13 +62,46 @@
46 #pragma mark - 62 #pragma mark -
47 63
48 @implementation UIImageView (AFNetworking) 64 @implementation UIImageView (AFNetworking)
  65 +@dynamic imageResponseSerializer;
  66 +
  67 ++ (id <AFImageCache>)sharedImageCache {
  68 + static AFImageCache *_af_defaultImageCache = nil;
  69 + static dispatch_once_t oncePredicate;
  70 + dispatch_once(&oncePredicate, ^{
  71 + _af_defaultImageCache = [[AFImageCache alloc] init];
  72 +
  73 + [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * __unused notification) {
  74 + [_af_defaultImageCache removeAllObjects];
  75 + }];
  76 + });
  77 +
  78 +#pragma clang diagnostic push
  79 +#pragma clang diagnostic ignored "-Wgnu"
  80 + return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: _af_defaultImageCache;
  81 +#pragma clang diagnostic pop
  82 +}
49 83
50 -+ (AFImageDownloader *)sharedImageDownloader {  
51 - return objc_getAssociatedObject(self, @selector(sharedImageDownloader)) ?: [AFImageDownloader defaultInstance]; 84 ++ (void)setSharedImageCache:(id <AFImageCache>)imageCache {
  85 + objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
52 } 86 }
53 87
54 -+ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader {  
55 - objc_setAssociatedObject(self, @selector(sharedImageDownloader), imageDownloader, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 88 +#pragma mark -
  89 +
  90 +- (id <AFURLResponseSerialization>)imageResponseSerializer {
  91 + static id <AFURLResponseSerialization> _af_defaultImageResponseSerializer = nil;
  92 + static dispatch_once_t onceToken;
  93 + dispatch_once(&onceToken, ^{
  94 + _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer];
  95 + });
  96 +
  97 +#pragma clang diagnostic push
  98 +#pragma clang diagnostic ignored "-Wgnu"
  99 + return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer;
  100 +#pragma clang diagnostic pop
  101 +}
  102 +
  103 +- (void)setImageResponseSerializer:(id <AFURLResponseSerialization>)serializer {
  104 + objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
56 } 105 }
57 106
58 #pragma mark - 107 #pragma mark -
@@ -72,84 +121,93 @@ @@ -72,84 +121,93 @@
72 121
73 - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest 122 - (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
74 placeholderImage:(UIImage *)placeholderImage 123 placeholderImage:(UIImage *)placeholderImage
75 - success:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success  
76 - failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure 124 + success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
  125 + failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
77 { 126 {
  127 + [self cancelImageRequestOperation];
78 128
79 - if ([urlRequest URL] == nil) {  
80 - [self cancelImageDownloadTask];  
81 - self.image = placeholderImage;  
82 - return;  
83 - }  
84 -  
85 - if ([self isActiveTaskURLEqualToURLRequest:urlRequest]){  
86 - return;  
87 - }  
88 -  
89 - [self cancelImageDownloadTask];  
90 -  
91 - AFImageDownloader *downloader = [[self class] sharedImageDownloader];  
92 - id <AFImageRequestCache> imageCache = downloader.imageCache;  
93 -  
94 - //Use the image from the image cache if it exists  
95 - UIImage *cachedImage = [imageCache imageforRequest:urlRequest withAdditionalIdentifier:nil]; 129 + UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
96 if (cachedImage) { 130 if (cachedImage) {
97 if (success) { 131 if (success) {
98 - success(urlRequest, nil, cachedImage); 132 + success(nil, nil, cachedImage);
99 } else { 133 } else {
100 self.image = cachedImage; 134 self.image = cachedImage;
101 } 135 }
102 - [self clearActiveDownloadInformation]; 136 +
  137 + self.af_imageRequestOperation = nil;
103 } else { 138 } else {
104 if (placeholderImage) { 139 if (placeholderImage) {
105 self.image = placeholderImage; 140 self.image = placeholderImage;
106 } 141 }
107 142
108 __weak __typeof(self)weakSelf = self; 143 __weak __typeof(self)weakSelf = self;
109 - NSUUID *downloadID = [NSUUID UUID];  
110 - AFImageDownloadReceipt *receipt;  
111 - receipt = [downloader  
112 - downloadImageForURLRequest:urlRequest  
113 - withReceiptID:downloadID  
114 - success:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, UIImage * _Nonnull responseObject) {  
115 - __strong __typeof(weakSelf)strongSelf = weakSelf;  
116 - if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {  
117 - if (success) {  
118 - success(request, response, responseObject);  
119 - } else if(responseObject) {  
120 - strongSelf.image = responseObject;  
121 - }  
122 - [strongSelf clearActiveDownloadInformation];  
123 - }  
124 -  
125 - }  
126 - failure:^(NSURLRequest * _Nonnull request, NSHTTPURLResponse * _Nullable response, NSError * _Nonnull error) {  
127 - __strong __typeof(weakSelf)strongSelf = weakSelf;  
128 - if ([strongSelf.af_activeImageDownloadReceipt.receiptID isEqual:downloadID]) {  
129 - if (failure) {  
130 - failure(request, response, error);  
131 - }  
132 - [strongSelf clearActiveDownloadInformation];  
133 - }  
134 - }];  
135 -  
136 - self.af_activeImageDownloadReceipt = receipt; 144 + self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
  145 + self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer;
  146 + [self.af_imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
  147 + __strong __typeof(weakSelf)strongSelf = weakSelf;
  148 + if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) {
  149 + if (success) {
  150 + success(urlRequest, operation.response, responseObject);
  151 + } else if (responseObject) {
  152 + strongSelf.image = responseObject;
  153 + }
  154 +
  155 + if (operation == strongSelf.af_imageRequestOperation){
  156 + strongSelf.af_imageRequestOperation = nil;
  157 + }
  158 + }
  159 +
  160 + [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
  161 + } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
  162 + __strong __typeof(weakSelf)strongSelf = weakSelf;
  163 + if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) {
  164 + if (failure) {
  165 + failure(urlRequest, operation.response, error);
  166 + }
  167 +
  168 + if (operation == strongSelf.af_imageRequestOperation){
  169 + strongSelf.af_imageRequestOperation = nil;
  170 + }
  171 + }
  172 + }];
  173 +
  174 + [[[self class] af_sharedImageRequestOperationQueue] addOperation:self.af_imageRequestOperation];
137 } 175 }
138 } 176 }
139 177
140 -- (void)cancelImageDownloadTask {  
141 - if (self.af_activeImageDownloadReceipt != nil) {  
142 - [[self.class sharedImageDownloader] cancelTaskForImageDownloadReceipt:self.af_activeImageDownloadReceipt];  
143 - [self clearActiveDownloadInformation];  
144 - } 178 +- (void)cancelImageRequestOperation {
  179 + [self.af_imageRequestOperation cancel];
  180 + self.af_imageRequestOperation = nil;
145 } 181 }
146 182
147 -- (void)clearActiveDownloadInformation {  
148 - self.af_activeImageDownloadReceipt = nil; 183 +@end
  184 +
  185 +#pragma mark -
  186 +
  187 +static inline NSString * AFImageCacheKeyFromURLRequest(NSURLRequest *request) {
  188 + return [[request URL] absoluteString];
149 } 189 }
150 190
151 -- (BOOL)isActiveTaskURLEqualToURLRequest:(NSURLRequest *)urlRequest {  
152 - return [self.af_activeImageDownloadReceipt.task.originalRequest.URL.absoluteString isEqualToString:urlRequest.URL.absoluteString]; 191 +@implementation AFImageCache
  192 +
  193 +- (UIImage *)cachedImageForRequest:(NSURLRequest *)request {
  194 + switch ([request cachePolicy]) {
  195 + case NSURLRequestReloadIgnoringCacheData:
  196 + case NSURLRequestReloadIgnoringLocalAndRemoteCacheData:
  197 + return nil;
  198 + default:
  199 + break;
  200 + }
  201 +
  202 + return [self objectForKey:AFImageCacheKeyFromURLRequest(request)];
  203 +}
  204 +
  205 +- (void)cacheImage:(UIImage *)image
  206 + forRequest:(NSURLRequest *)request
  207 +{
  208 + if (image && request) {
  209 + [self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)];
  210 + }
153 } 211 }
154 212
155 @end 213 @end
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h
1 // UIKit+AFNetworking.h 1 // UIKit+AFNetworking.h
2 // 2 //
3 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 +// Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
4 // 4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy 5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal 6 // of this software and associated documentation files (the "Software"), to deal
@@ -20,23 +20,19 @@ @@ -20,23 +20,19 @@
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE. 21 // THE SOFTWARE.
22 22
23 -#if TARGET_OS_IOS || TARGET_OS_TV  
24 #import <UIKit/UIKit.h> 23 #import <UIKit/UIKit.h>
25 24
26 #ifndef _UIKIT_AFNETWORKING_ 25 #ifndef _UIKIT_AFNETWORKING_
27 #define _UIKIT_AFNETWORKING_ 26 #define _UIKIT_AFNETWORKING_
28 27
29 -#if TARGET_OS_IOS  
30 - #import "AFAutoPurgingImageCache.h"  
31 - #import "AFImageDownloader.h"  
32 #import "AFNetworkActivityIndicatorManager.h" 28 #import "AFNetworkActivityIndicatorManager.h"
33 - #import "UIRefreshControl+AFNetworking.h"  
34 - #import "UIWebView+AFNetworking.h"  
35 -#endif  
36 29
37 #import "UIActivityIndicatorView+AFNetworking.h" 30 #import "UIActivityIndicatorView+AFNetworking.h"
  31 + #import "UIAlertView+AFNetworking.h"
38 #import "UIButton+AFNetworking.h" 32 #import "UIButton+AFNetworking.h"
39 #import "UIImageView+AFNetworking.h" 33 #import "UIImageView+AFNetworking.h"
  34 + #import "UIKit+AFNetworking.h"
40 #import "UIProgressView+AFNetworking.h" 35 #import "UIProgressView+AFNetworking.h"
  36 + #import "UIRefreshControl+AFNetworking.h"
  37 + #import "UIWebView+AFNetworking.h"
41 #endif /* _UIKIT_AFNETWORKING_ */ 38 #endif /* _UIKIT_AFNETWORKING_ */
42 -#endif  
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h
1 // UIProgressView+AFNetworking.h 1 // UIProgressView+AFNetworking.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,17 +21,16 @@ @@ -21,17 +21,16 @@
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 23
24 -#import <TargetConditionals.h> 24 +#import <Availability.h>
25 25
26 -#if TARGET_OS_IOS || TARGET_OS_TV 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 #import <UIKit/UIKit.h> 28 #import <UIKit/UIKit.h>
29 29
30 -NS_ASSUME_NONNULL_BEGIN  
31 - 30 +@class AFURLConnectionOperation;
32 31
33 /** 32 /**
34 - 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. 33 + 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 or request operation.
35 */ 34 */
36 @interface UIProgressView (AFNetworking) 35 @interface UIProgressView (AFNetworking)
37 36
@@ -45,8 +44,10 @@ NS_ASSUME_NONNULL_BEGIN @@ -45,8 +44,10 @@ NS_ASSUME_NONNULL_BEGIN
45 @param task The session task. 44 @param task The session task.
46 @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 45 @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
47 */ 46 */
  47 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
48 - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 48 - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
49 animated:(BOOL)animated; 49 animated:(BOOL)animated;
  50 +#endif
50 51
51 /** 52 /**
52 Binds the progress to the download progress of the specified session task. 53 Binds the progress to the download progress of the specified session task.
@@ -54,11 +55,33 @@ NS_ASSUME_NONNULL_BEGIN @@ -54,11 +55,33 @@ NS_ASSUME_NONNULL_BEGIN
54 @param task The session task. 55 @param task The session task.
55 @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. 56 @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
56 */ 57 */
  58 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
57 - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 59 - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
58 animated:(BOOL)animated; 60 animated:(BOOL)animated;
  61 +#endif
59 62
60 -@end 63 +///------------------------------------
  64 +/// @name Setting Session Task Progress
  65 +///------------------------------------
  66 +
  67 +/**
  68 + Binds the progress to the upload progress of the specified request operation.
61 69
62 -NS_ASSUME_NONNULL_END 70 + @param operation The request operation.
  71 + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
  72 + */
  73 +- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation
  74 + animated:(BOOL)animated;
  75 +
  76 +/**
  77 + Binds the progress to the download progress of the specified request operation.
  78 +
  79 + @param operation The request operation.
  80 + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
  81 + */
  82 +- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation
  83 + animated:(BOOL)animated;
  84 +
  85 +@end
63 86
64 #endif 87 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m
1 // UIProgressView+AFNetworking.m 1 // UIProgressView+AFNetworking.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -23,13 +23,33 @@ @@ -23,13 +23,33 @@
23 23
24 #import <objc/runtime.h> 24 #import <objc/runtime.h>
25 25
26 -#if TARGET_OS_IOS || TARGET_OS_TV 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
  28 +#import "AFURLConnectionOperation.h"
  29 +
  30 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
28 #import "AFURLSessionManager.h" 31 #import "AFURLSessionManager.h"
  32 +#endif
29 33
30 static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext; 34 static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext;
31 static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext; 35 static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext;
32 36
  37 +@interface AFURLConnectionOperation (_UIProgressView)
  38 +@property (readwrite, nonatomic, copy) void (^uploadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected);
  39 +@property (readwrite, nonatomic, assign, setter = af_setUploadProgressAnimated:) BOOL af_uploadProgressAnimated;
  40 +
  41 +@property (readwrite, nonatomic, copy) void (^downloadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected);
  42 +@property (readwrite, nonatomic, assign, setter = af_setDownloadProgressAnimated:) BOOL af_downloadProgressAnimated;
  43 +@end
  44 +
  45 +@implementation AFURLConnectionOperation (_UIProgressView)
  46 +@dynamic uploadProgress; // Implemented in AFURLConnectionOperation
  47 +@dynamic af_uploadProgressAnimated;
  48 +
  49 +@dynamic downloadProgress; // Implemented in AFURLConnectionOperation
  50 +@dynamic af_downloadProgressAnimated;
  51 +@end
  52 +
33 #pragma mark - 53 #pragma mark -
34 54
35 @implementation UIProgressView (AFNetworking) 55 @implementation UIProgressView (AFNetworking)
@@ -52,13 +72,10 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon @@ -52,13 +72,10 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon
52 72
53 #pragma mark - 73 #pragma mark -
54 74
  75 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
55 - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task 76 - (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
56 animated:(BOOL)animated 77 animated:(BOOL)animated
57 { 78 {
58 - if (task.state == NSURLSessionTaskStateCompleted) {  
59 - return;  
60 - }  
61 -  
62 [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 79 [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
63 [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext]; 80 [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
64 81
@@ -68,15 +85,52 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon @@ -68,15 +85,52 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon
68 - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task 85 - (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
69 animated:(BOOL)animated 86 animated:(BOOL)animated
70 { 87 {
71 - if (task.state == NSURLSessionTaskStateCompleted) {  
72 - return;  
73 - }  
74 -  
75 [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 88 [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
76 [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext]; 89 [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
77 90
78 [self af_setDownloadProgressAnimated:animated]; 91 [self af_setDownloadProgressAnimated:animated];
79 } 92 }
  93 +#endif
  94 +
  95 +#pragma mark -
  96 +
  97 +- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation
  98 + animated:(BOOL)animated
  99 +{
  100 + __weak __typeof(self)weakSelf = self;
  101 + void (^original)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) = [operation.uploadProgress copy];
  102 + [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
  103 + if (original) {
  104 + original(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
  105 + }
  106 +
  107 + dispatch_async(dispatch_get_main_queue(), ^{
  108 + if (totalBytesExpectedToWrite > 0) {
  109 + __strong __typeof(weakSelf)strongSelf = weakSelf;
  110 + [strongSelf setProgress:(totalBytesWritten / (totalBytesExpectedToWrite * 1.0f)) animated:animated];
  111 + }
  112 + });
  113 + }];
  114 +}
  115 +
  116 +- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation
  117 + animated:(BOOL)animated
  118 +{
  119 + __weak __typeof(self)weakSelf = self;
  120 + void (^original)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) = [operation.downloadProgress copy];
  121 + [operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
  122 + if (original) {
  123 + original(bytesRead, totalBytesRead, totalBytesExpectedToRead);
  124 + }
  125 +
  126 + dispatch_async(dispatch_get_main_queue(), ^{
  127 + if (totalBytesExpectedToRead > 0) {
  128 + __strong __typeof(weakSelf)strongSelf = weakSelf;
  129 + [strongSelf setProgress:(totalBytesRead / (totalBytesExpectedToRead * 1.0f)) animated:animated];
  130 + }
  131 + });
  132 + }];
  133 +}
80 134
81 #pragma mark - NSKeyValueObserving 135 #pragma mark - NSKeyValueObserving
82 136
@@ -85,6 +139,7 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon @@ -85,6 +139,7 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon
85 change:(__unused NSDictionary *)change 139 change:(__unused NSDictionary *)change
86 context:(void *)context 140 context:(void *)context
87 { 141 {
  142 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
88 if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) { 143 if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) {
89 if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) { 144 if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) {
90 if ([object countOfBytesExpectedToSend] > 0) { 145 if ([object countOfBytesExpectedToSend] > 0) {
@@ -119,6 +174,7 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon @@ -119,6 +174,7 @@ static void * AFTaskCountOfBytesReceivedContext = &amp;AFTaskCountOfBytesReceivedCon
119 } 174 }
120 } 175 }
121 } 176 }
  177 +#endif
122 } 178 }
123 179
124 @end 180 @end
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h
1 // UIRefreshControl+AFNetworking.m 1 // UIRefreshControl+AFNetworking.m
2 // 2 //
3 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 +// Copyright (c) 2014 AFNetworking (http://afnetworking.com)
4 // 4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy 5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal 6 // of this software and associated documentation files (the "Software"), to deal
@@ -22,16 +22,16 @@ @@ -22,16 +22,16 @@
22 22
23 #import <Foundation/Foundation.h> 23 #import <Foundation/Foundation.h>
24 24
25 -#import <TargetConditionals.h> 25 +#import <Availability.h>
26 26
27 -#if TARGET_OS_IOS 27 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
28 28
29 #import <UIKit/UIKit.h> 29 #import <UIKit/UIKit.h>
30 30
31 -NS_ASSUME_NONNULL_BEGIN 31 +@class AFURLConnectionOperation;
32 32
33 /** 33 /**
34 - 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. 34 + This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically begining and ending refreshing depending on the loading state of a request operation or session task.
35 */ 35 */
36 @interface UIRefreshControl (AFNetworking) 36 @interface UIRefreshControl (AFNetworking)
37 37
@@ -44,10 +44,21 @@ NS_ASSUME_NONNULL_BEGIN @@ -44,10 +44,21 @@ NS_ASSUME_NONNULL_BEGIN
44 44
45 @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. 45 @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
46 */ 46 */
  47 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
47 - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; 48 - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
  49 +#endif
48 50
49 -@end 51 +///----------------------------------------
  52 +/// @name Refreshing for Request Operations
  53 +///----------------------------------------
  54 +
  55 +/**
  56 + Binds the refreshing state to the execution state of the specified operation.
50 57
51 -NS_ASSUME_NONNULL_END 58 + @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
  59 + */
  60 +- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation;
  61 +
  62 +@end
52 63
53 #endif 64 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m
1 // UIRefreshControl+AFNetworking.m 1 // UIRefreshControl+AFNetworking.m
2 // 2 //
3 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 3 +// Copyright (c) 2014 AFNetworking (http://afnetworking.com)
4 // 4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy 5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal 6 // of this software and associated documentation files (the "Software"), to deal
@@ -21,48 +21,18 @@ @@ -21,48 +21,18 @@
21 // THE SOFTWARE. 21 // THE SOFTWARE.
22 22
23 #import "UIRefreshControl+AFNetworking.h" 23 #import "UIRefreshControl+AFNetworking.h"
24 -#import <objc/runtime.h>  
25 24
26 -#if TARGET_OS_IOS 25 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 26
28 -#import "AFURLSessionManager.h"  
29 -  
30 -@interface AFRefreshControlNotificationObserver : NSObject  
31 -@property (readonly, nonatomic, weak) UIRefreshControl *refreshControl;  
32 -- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl; 27 +#import "AFHTTPRequestOperation.h"
33 28
34 -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;  
35 -  
36 -@end 29 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
  30 +#import "AFURLSessionManager.h"
  31 +#endif
37 32
38 @implementation UIRefreshControl (AFNetworking) 33 @implementation UIRefreshControl (AFNetworking)
39 34
40 -- (AFRefreshControlNotificationObserver *)af_notificationObserver {  
41 - AFRefreshControlNotificationObserver *notificationObserver = objc_getAssociatedObject(self, @selector(af_notificationObserver));  
42 - if (notificationObserver == nil) {  
43 - notificationObserver = [[AFRefreshControlNotificationObserver alloc] initWithActivityRefreshControl:self];  
44 - objc_setAssociatedObject(self, @selector(af_notificationObserver), notificationObserver, OBJC_ASSOCIATION_RETAIN_NONATOMIC);  
45 - }  
46 - return notificationObserver;  
47 -}  
48 -  
49 -- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {  
50 - [[self af_notificationObserver] setRefreshingWithStateOfTask:task];  
51 -}  
52 -  
53 -@end  
54 -  
55 -@implementation AFRefreshControlNotificationObserver  
56 -  
57 -- (instancetype)initWithActivityRefreshControl:(UIRefreshControl *)refreshControl  
58 -{  
59 - self = [super init];  
60 - if (self) {  
61 - _refreshControl = refreshControl;  
62 - }  
63 - return self;  
64 -}  
65 - 35 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
66 - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task { 36 - (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
67 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 37 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
68 38
@@ -71,15 +41,35 @@ @@ -71,15 +41,35 @@
71 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 41 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
72 42
73 if (task) { 43 if (task) {
74 - UIRefreshControl *refreshControl = self.refreshControl;  
75 if (task.state == NSURLSessionTaskStateRunning) { 44 if (task.state == NSURLSessionTaskStateRunning) {
76 - [refreshControl beginRefreshing]; 45 + [self beginRefreshing];
77 46
78 [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task]; 47 [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task];
79 [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task]; 48 [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task];
80 [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task]; 49 [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task];
81 } else { 50 } else {
82 - [refreshControl endRefreshing]; 51 + [self endRefreshing];
  52 + }
  53 + }
  54 +}
  55 +#endif
  56 +
  57 +- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation {
  58 + NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
  59 +
  60 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
  61 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
  62 +
  63 + if (operation) {
  64 + if (![operation isFinished]) {
  65 + if ([operation isExecuting]) {
  66 + [self beginRefreshing];
  67 + } else {
  68 + [self endRefreshing];
  69 + }
  70 +
  71 + [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingOperationDidStartNotification object:operation];
  72 + [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingOperationDidFinishNotification object:operation];
83 } 73 }
84 } 74 }
85 } 75 }
@@ -88,24 +78,29 @@ @@ -88,24 +78,29 @@
88 78
89 - (void)af_beginRefreshing { 79 - (void)af_beginRefreshing {
90 dispatch_async(dispatch_get_main_queue(), ^{ 80 dispatch_async(dispatch_get_main_queue(), ^{
91 - [self.refreshControl beginRefreshing]; 81 + [self beginRefreshing];
92 }); 82 });
93 } 83 }
94 84
95 - (void)af_endRefreshing { 85 - (void)af_endRefreshing {
96 dispatch_async(dispatch_get_main_queue(), ^{ 86 dispatch_async(dispatch_get_main_queue(), ^{
97 - [self.refreshControl endRefreshing]; 87 + [self endRefreshing];
98 }); 88 });
99 } 89 }
100 90
101 #pragma mark - 91 #pragma mark -
102 92
103 -- (void)dealloc { 93 +-(void)dealloc
  94 +{
104 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; 95 NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
105 - 96 +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
106 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil]; 97 [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
107 [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil]; 98 [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
108 [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil]; 99 [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
  100 +#endif
  101 +
  102 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
  103 + [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
109 } 104 }
110 105
111 @end 106 @end
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h
1 // UIWebView+AFNetworking.h 1 // UIWebView+AFNetworking.h
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -21,15 +21,14 @@ @@ -21,15 +21,14 @@
21 21
22 #import <Foundation/Foundation.h> 22 #import <Foundation/Foundation.h>
23 23
24 -#import <TargetConditionals.h> 24 +#import <Availability.h>
25 25
26 -#if TARGET_OS_IOS 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 #import <UIKit/UIKit.h> 28 #import <UIKit/UIKit.h>
29 29
30 -NS_ASSUME_NONNULL_BEGIN  
31 -  
32 -@class AFHTTPSessionManager; 30 +@class AFHTTPRequestSerializer, AFHTTPResponseSerializer;
  31 +@protocol AFURLRequestSerialization, AFURLResponseSerialization;
33 32
34 /** 33 /**
35 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. 34 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.
@@ -39,22 +38,27 @@ NS_ASSUME_NONNULL_BEGIN @@ -39,22 +38,27 @@ NS_ASSUME_NONNULL_BEGIN
39 @interface UIWebView (AFNetworking) 38 @interface UIWebView (AFNetworking)
40 39
41 /** 40 /**
42 - The session manager used to download all requests. 41 + The request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPRequestSerializer`.
43 */ 42 */
44 -@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; 43 +@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
  44 +
  45 +/**
  46 + The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPResponseSerializer`.
  47 + */
  48 +@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
45 49
46 /** 50 /**
47 Asynchronously loads the specified request. 51 Asynchronously loads the specified request.
48 52
49 @param request A URL request identifying the location of the content to load. This must not be `nil`. 53 @param request A URL request identifying the location of the content to load. This must not be `nil`.
50 - @param progress A progress object monitoring the current download progress. 54 + @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread.
51 @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. 55 @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.
52 - @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. 56 + @param failure A block object to be executed when the request operation 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.
53 */ 57 */
54 - (void)loadRequest:(NSURLRequest *)request 58 - (void)loadRequest:(NSURLRequest *)request
55 - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress  
56 - success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success  
57 - failure:(nullable void (^)(NSError *error))failure; 59 + progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
  60 + success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
  61 + failure:(void (^)(NSError *error))failure;
58 62
59 /** 63 /**
60 Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. 64 Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding.
@@ -62,19 +66,17 @@ NS_ASSUME_NONNULL_BEGIN @@ -62,19 +66,17 @@ NS_ASSUME_NONNULL_BEGIN
62 @param request A URL request identifying the location of the content to load. This must not be `nil`. 66 @param request A URL request identifying the location of the content to load. This must not be `nil`.
63 @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. 67 @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified.
64 @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. 68 @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified.
65 -@param progress A progress object monitoring the current download progress. 69 + @param progress A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the main thread.
66 @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. 70 @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.
67 - @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. 71 + @param failure A block object to be executed when the request operation 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.
68 */ 72 */
69 - (void)loadRequest:(NSURLRequest *)request 73 - (void)loadRequest:(NSURLRequest *)request
70 - MIMEType:(nullable NSString *)MIMEType  
71 - textEncodingName:(nullable NSString *)textEncodingName  
72 - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress  
73 - success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success  
74 - failure:(nullable void (^)(NSError *error))failure; 74 + MIMEType:(NSString *)MIMEType
  75 + textEncodingName:(NSString *)textEncodingName
  76 + progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
  77 + success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
  78 + failure:(void (^)(NSError *error))failure;
75 79
76 @end 80 @end
77 81
78 -NS_ASSUME_NONNULL_END  
79 -  
80 #endif 82 #endif
LiveVideoCloud/LiveVideoCloud/Classes/SDK/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m
1 // UIWebView+AFNetworking.m 1 // UIWebView+AFNetworking.m
2 -// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) 2 +// Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/)
3 // 3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy 4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal 5 // of this software and associated documentation files (the "Software"), to deal
@@ -23,24 +23,24 @@ @@ -23,24 +23,24 @@
23 23
24 #import <objc/runtime.h> 24 #import <objc/runtime.h>
25 25
26 -#if TARGET_OS_IOS 26 +#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
27 27
28 -#import "AFHTTPSessionManager.h" 28 +#import "AFHTTPRequestOperation.h"
29 #import "AFURLResponseSerialization.h" 29 #import "AFURLResponseSerialization.h"
30 #import "AFURLRequestSerialization.h" 30 #import "AFURLRequestSerialization.h"
31 31
32 @interface UIWebView (_AFNetworking) 32 @interface UIWebView (_AFNetworking)
33 -@property (readwrite, nonatomic, strong, setter = af_setURLSessionTask:) NSURLSessionDataTask *af_URLSessionTask; 33 +@property (readwrite, nonatomic, strong, setter = af_setHTTPRequestOperation:) AFHTTPRequestOperation *af_HTTPRequestOperation;
34 @end 34 @end
35 35
36 @implementation UIWebView (_AFNetworking) 36 @implementation UIWebView (_AFNetworking)
37 37
38 -- (NSURLSessionDataTask *)af_URLSessionTask {  
39 - return (NSURLSessionDataTask *)objc_getAssociatedObject(self, @selector(af_URLSessionTask)); 38 +- (AFHTTPRequestOperation *)af_HTTPRequestOperation {
  39 + return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_HTTPRequestOperation));
40 } 40 }
41 41
42 -- (void)af_setURLSessionTask:(NSURLSessionDataTask *)af_URLSessionTask {  
43 - objc_setAssociatedObject(self, @selector(af_URLSessionTask), af_URLSessionTask, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 42 +- (void)af_setHTTPRequestOperation:(AFHTTPRequestOperation *)operation {
  43 + objc_setAssociatedObject(self, @selector(af_HTTPRequestOperation), operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
44 } 44 }
45 45
46 @end 46 @end
@@ -49,20 +49,21 @@ @@ -49,20 +49,21 @@
49 49
50 @implementation UIWebView (AFNetworking) 50 @implementation UIWebView (AFNetworking)
51 51
52 -- (AFHTTPSessionManager *)sessionManager {  
53 - static AFHTTPSessionManager *_af_defaultHTTPSessionManager = nil; 52 +- (AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
  53 + static AFHTTPRequestSerializer <AFURLRequestSerialization> *_af_defaultRequestSerializer = nil;
54 static dispatch_once_t onceToken; 54 static dispatch_once_t onceToken;
55 dispatch_once(&onceToken, ^{ 55 dispatch_once(&onceToken, ^{
56 - _af_defaultHTTPSessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];  
57 - _af_defaultHTTPSessionManager.requestSerializer = [AFHTTPRequestSerializer serializer];  
58 - _af_defaultHTTPSessionManager.responseSerializer = [AFHTTPResponseSerializer serializer]; 56 + _af_defaultRequestSerializer = [AFHTTPRequestSerializer serializer];
59 }); 57 });
60 58
61 - return objc_getAssociatedObject(self, @selector(sessionManager)) ?: _af_defaultHTTPSessionManager; 59 +#pragma clang diagnostic push
  60 +#pragma clang diagnostic ignored "-Wgnu"
  61 + return objc_getAssociatedObject(self, @selector(requestSerializer)) ?: _af_defaultRequestSerializer;
  62 +#pragma clang diagnostic pop
62 } 63 }
63 64
64 -- (void)setSessionManager:(AFHTTPSessionManager *)sessionManager {  
65 - objc_setAssociatedObject(self, @selector(sessionManager), sessionManager, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 65 +- (void)setRequestSerializer:(AFHTTPRequestSerializer<AFURLRequestSerialization> *)requestSerializer {
  66 + objc_setAssociatedObject(self, @selector(requestSerializer), requestSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
66 } 67 }
67 68
68 - (AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer { 69 - (AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
@@ -72,7 +73,10 @@ @@ -72,7 +73,10 @@
72 _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer]; 73 _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer];
73 }); 74 });
74 75
  76 +#pragma clang diagnostic push
  77 +#pragma clang diagnostic ignored "-Wgnu"
75 return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer; 78 return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer;
  79 +#pragma clang diagnostic pop
76 } 80 }
77 81
78 - (void)setResponseSerializer:(AFHTTPResponseSerializer<AFURLResponseSerialization> *)responseSerializer { 82 - (void)setResponseSerializer:(AFHTTPResponseSerializer<AFURLResponseSerialization> *)responseSerializer {
@@ -82,7 +86,7 @@ @@ -82,7 +86,7 @@
82 #pragma mark - 86 #pragma mark -
83 87
84 - (void)loadRequest:(NSURLRequest *)request 88 - (void)loadRequest:(NSURLRequest *)request
85 - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 89 + progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
86 success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success 90 success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
87 failure:(void (^)(NSError *error))failure 91 failure:(void (^)(NSError *error))failure
88 { 92 {
@@ -107,45 +111,43 @@ @@ -107,45 +111,43 @@
107 - (void)loadRequest:(NSURLRequest *)request 111 - (void)loadRequest:(NSURLRequest *)request
108 MIMEType:(NSString *)MIMEType 112 MIMEType:(NSString *)MIMEType
109 textEncodingName:(NSString *)textEncodingName 113 textEncodingName:(NSString *)textEncodingName
110 - progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress 114 + progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
111 success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success 115 success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
112 failure:(void (^)(NSError *error))failure 116 failure:(void (^)(NSError *error))failure
113 { 117 {
114 NSParameterAssert(request); 118 NSParameterAssert(request);
115 119
116 - if (self.af_URLSessionTask.state == NSURLSessionTaskStateRunning || self.af_URLSessionTask.state == NSURLSessionTaskStateSuspended) {  
117 - [self.af_URLSessionTask cancel]; 120 + if (self.af_HTTPRequestOperation) {
  121 + [self.af_HTTPRequestOperation cancel];
118 } 122 }
119 - self.af_URLSessionTask = nil; 123 +
  124 + request = [self.requestSerializer requestBySerializingRequest:request withParameters:nil error:nil];
  125 +
  126 + self.af_HTTPRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
  127 + self.af_HTTPRequestOperation.responseSerializer = self.responseSerializer;
120 128
121 __weak __typeof(self)weakSelf = self; 129 __weak __typeof(self)weakSelf = self;
122 - __block NSURLSessionDataTask *dataTask;  
123 - dataTask = [self.sessionManager  
124 - dataTaskWithRequest:request  
125 - uploadProgress:nil  
126 - downloadProgress:nil  
127 - completionHandler:^(NSURLResponse * _Nonnull response, id _Nonnull responseObject, NSError * _Nullable error) {  
128 - __strong __typeof(weakSelf) strongSelf = weakSelf;  
129 - if (error) {  
130 - if (failure) {  
131 - failure(error);  
132 - }  
133 - } else {  
134 - if (success) {  
135 - success((NSHTTPURLResponse *)response, responseObject);  
136 - }  
137 - [strongSelf loadData:responseObject MIMEType:MIMEType textEncodingName:textEncodingName baseURL:[dataTask.currentRequest URL]];  
138 -  
139 - if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {  
140 - [strongSelf.delegate webViewDidFinishLoad:strongSelf];  
141 - }  
142 - }  
143 - }];  
144 - self.af_URLSessionTask = dataTask;  
145 - if (progress != nil) {  
146 - *progress = [self.sessionManager downloadProgressForTask:dataTask];  
147 - }  
148 - [self.af_URLSessionTask resume]; 130 + [self.af_HTTPRequestOperation setDownloadProgressBlock:progress];
  131 + [self.af_HTTPRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id __unused responseObject) {
  132 + NSData *data = success ? success(operation.response, operation.responseData) : operation.responseData;
  133 +
  134 +#pragma clang diagnostic push
  135 +#pragma clang diagnostic ignored "-Wgnu"
  136 + __strong __typeof(weakSelf) strongSelf = weakSelf;
  137 + [strongSelf loadData:data MIMEType:(MIMEType ?: [operation.response MIMEType]) textEncodingName:(textEncodingName ?: [operation.response textEncodingName]) baseURL:[operation.response URL]];
  138 +
  139 + if ([strongSelf.delegate respondsToSelector:@selector(webViewDidFinishLoad:)]) {
  140 + [strongSelf.delegate webViewDidFinishLoad:strongSelf];
  141 + }
  142 +
  143 +#pragma clang diagnostic pop
  144 + } failure:^(AFHTTPRequestOperation * __unused operation, NSError *error) {
  145 + if (failure) {
  146 + failure(error);
  147 + }
  148 + }];
  149 +
  150 + [self.af_HTTPRequestOperation start];
149 151
150 if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) { 152 if ([self.delegate respondsToSelector:@selector(webViewDidStartLoad:)]) {
151 [self.delegate webViewDidStartLoad:self]; 153 [self.delegate webViewDidStartLoad:self];
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCMoreProgramViewController.m
@@ -44,8 +44,7 @@ @@ -44,8 +44,7 @@
44 @"cid": self.cid ? self.cid : @"", 44 @"cid": self.cid ? self.cid : @"",
45 @"type": @"live", 45 @"type": @"live",
46 @"version": @"5.3", @"appid": @"spzg", @"plat": @"a"}; 46 @"version": @"5.3", @"appid": @"spzg", @"plat": @"a"};
47 - [[AFHTTPSessionManager manager] GET:@"http://app.jczb.cnlive.com/api/catprogramlist" parameters:parameters progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {  
48 - 47 + [[AFHTTPSessionManager manager] GET:@"http://app.jczb.cnlive.com/api/catprogramlist" parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
49 if (refresh) { 48 if (refresh) {
50 _page = 1; 49 _page = 1;
51 [_tableView.header endRefreshing]; 50 [_tableView.header endRefreshing];
@@ -61,18 +60,19 @@ @@ -61,18 +60,19 @@
61 } 60 }
62 61
63 [_tableView reloadData]; 62 [_tableView reloadData];
64 -  
65 - } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { 63 + } failure:^(NSURLSessionDataTask *task, NSError *error) {
66 if (refresh) { 64 if (refresh) {
67 [_tableView.header endRefreshing]; 65 [_tableView.header endRefreshing];
68 } else { 66 } else {
69 _page -= 1; 67 _page -= 1;
70 [_tableView.footer endRefreshing]; 68 [_tableView.footer endRefreshing];
71 } 69 }
72 - 70 +
73 NSLog(@"电视台更多节目列表获取失败"); 71 NSLog(@"电视台更多节目列表获取失败");
74 72
75 }]; 73 }];
  74 +
  75 +
76 } 76 }
77 77
78 - (void)refreshAction 78 - (void)refreshAction
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LiveLIstService.m
@@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
17 NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time]; 17 NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time];
18 NSMutableDictionary *parameter=[@{@"platform_id": [NSBundle mainBundle].bundleIdentifier, 18 NSMutableDictionary *parameter=[@{@"platform_id": [NSBundle mainBundle].bundleIdentifier,
19 @"timestamp": timeString, 19 @"timestamp": timeString,
20 - @"appId": AppId} mutableCopy];  
21 - NSString *string = [NSString stringWithFormat:@"%@&key=%@", [self sortParameters:parameter], AppKey]; 20 + @"appId": UserAppId} mutableCopy];
  21 + NSString *string = [NSString stringWithFormat:@"%@&key=%@", [self sortParameters:parameter], UserAppKey];
22 NSString *signString = [[self sha1:string] uppercaseString]; 22 NSString *signString = [[self sha1:string] uppercaseString];
23 [parameter setObject:signString forKey:@"sign"]; 23 [parameter setObject:signString forKey:@"sign"];
24 24
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCTelevisionView.m
@@ -175,7 +175,7 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;; @@ -175,7 +175,7 @@ static NSString *otherHeaderId = @&quot;LVCOtherHeaderReusableView&quot;;
175 @"appid":@"spzg", 175 @"appid":@"spzg",
176 @"version":@"1"}; 176 @"version":@"1"};
177 177
178 - [[AFHTTPSessionManager manager] GET:@"http://app.jczb.cnlive.com/api/appindex?appid=spzg&cid=zb%2F&plat=i&version=1" parameters:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { 178 + [[AFHTTPSessionManager manager] GET:@"http://app.jczb.cnlive.com/api/appindex?appid=spzg&cid=zb%2F&plat=i&version=1" parameters:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
179 _timestamp = [[self timestamp] longLongValue]; 179 _timestamp = [[self timestamp] longLongValue];
180 180
181 [self.collectionView.header endRefreshing]; 181 [self.collectionView.header endRefreshing];
LiveVideoCloud/LiveVideoCloud/HttpService/HttpService.m
@@ -52,8 +52,7 @@ static HttpService * __singleton__; @@ -52,8 +52,7 @@ static HttpService * __singleton__;
52 NSString *methodStr = [self stringWithMethod:method]; 52 NSString *methodStr = [self stringWithMethod:method];
53 NSMutableURLRequest *request = [_dataSessionManager.requestSerializer requestWithMethod:methodStr URLString:urlStr parameters:parameters error:nil]; 53 NSMutableURLRequest *request = [_dataSessionManager.requestSerializer requestWithMethod:methodStr URLString:urlStr parameters:parameters error:nil];
54 __block NSURLSessionDataTask *task = nil; 54 __block NSURLSessionDataTask *task = nil;
55 - task = [_dataSessionManager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {  
56 - 55 + task = [_dataSessionManager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
57 [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 56 [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
58 NSError *err = nil; 57 NSError *err = nil;
59 id data = nil; 58 id data = nil;
@@ -71,7 +70,9 @@ static HttpService * __singleton__; @@ -71,7 +70,9 @@ static HttpService * __singleton__;
71 dispatch_async(dispatch_get_main_queue(), ^{ 70 dispatch_async(dispatch_get_main_queue(), ^{
72 completionHandler(data, err); 71 completionHandler(data, err);
73 }); 72 });
  73 +
74 }]; 74 }];
  75 +
75 76
76 [task resume]; 77 [task resume];
77 return task; 78 return task;
LiveVideoCloud/LiveVideoCloud/PrefixHeader.pch
@@ -30,6 +30,38 @@ @@ -30,6 +30,38 @@
30 #import <CNLiveMsgTools/CNLiveMsgManager.h> 30 #import <CNLiveMsgTools/CNLiveMsgManager.h>
31 #import <CNLiveChatManager/CNLiveChatManager.h> 31 #import <CNLiveChatManager/CNLiveChatManager.h>
32 32
  33 +#import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h>
  34 +
  35 +#import "Common.h"
  36 +#import "MJExtension.h"//
  37 +#import "CNLiveMacro.h"//
  38 +#import "NSNumber+ScaleHeight.h"//高度适配
  39 +#import "AFNetworking.h"
  40 +#import "UIImageView+WebCache.h"
  41 +//#import "NSDictionary+Safety.h"
  42 +#import "Tools.h"
  43 +#import "MJRefresh.h"
  44 +#import <ImageIO/ImageIO.h>//
  45 +#import "UIImage+ScaleImageSize.h"//
  46 +//#import "CNRefreshHeader.h"//
  47 +#import "UIView+ViewController.h"
  48 +//#import "MBProgressHUD.h"
  49 +#import "SevenSwitch.h"
  50 +#import "DESUtility.h"
  51 +//#import "CNLiveXMPPMessage.h"
  52 +#import "UserInformationModel.h"
  53 +//#import "EncryptAndDecrypt.h"
  54 +//#import "Utility.h"
  55 +//#import "CNLiveShare.h"
  56 +//#import "ShareObject.h"
  57 +#import "NSString+UrlEncode.h"
  58 +#import "NSDictionary+Safety.h"
  59 +#import "UserTools.h"
  60 +#import "UIImage+GIF.h"
  61 +#import "ZXUIKit.h"//
  62 +#import "UIButton+createButton.h"//
  63 +#import "ProgramModel.h"
  64 +
33 #if TARGET_OS_IPHONE 65 #if TARGET_OS_IPHONE
34 66
35 #endif 67 #endif
@@ -46,6 +78,23 @@ @@ -46,6 +78,23 @@
46 #define NSLog(s, ... ) 78 #define NSLog(s, ... )
47 #endif 79 #endif
48 80
  81 +//com.cnlive.shipinzhongguo
  82 +#define UserAppId @"82_iunnscwp07"
  83 +#define UserAppKey @"13c6f0ad6f459cd479834b0b39cff99c6cf20c970815bb"
  84 +#define UserAppSceret @"14c887b76ec2ecdf7083fb4c62808f13f6ab77a0f9dfec"
  85 +
  86 +//#define UserAppId @"60_itax25eq82"
  87 +//#define UserAppKey @"55a25a7f7e1124937fba06c82999d9a7c18379e2d24784"
  88 +//#define UserAppSceret @"29798eea30388f71d4a33b75d308c3cbb47077d56ce680"
  89 +
  90 +
  91 +//com.cnlive.shixunyun
  92 +//#define UserAppId @"60_j0uqrv0u11"
  93 +//#define UserAppKey @"876c5efece0fc9c98c51ff2180ee1bcfa5c5b5af202c78"
  94 +//#define UserAppSceret @"ee844ea67b6be7303b6f5d9365af10ac09933c0828aba7"
  95 +
  96 +#define PlaceholderImage @"placehodler"
  97 +
49 98
50 #endif 99 #endif
51 #endif /* PrefixHeader_pch */ 100 #endif /* PrefixHeader_pch */
LiveVideoCloud/LiveVideoCloud/UtilKits/Category/UIColor+HexString.h
@@ -27,4 +27,22 @@ @@ -27,4 +27,22 @@
27 + (UIColor *)blueColorZX; 27 + (UIColor *)blueColorZX;
28 28
29 + (UIColor *)cellLineColorZX; 29 + (UIColor *)cellLineColorZX;
  30 +
  31 +
  32 +
  33 ++ (UIColor *)yellowColorCNLive;
  34 +
  35 ++ (UIColor *)redColorCNLive;
  36 +
  37 ++ (UIColor *)backgroundColor;
  38 +
  39 ++ (UIColor *)blackColorCNLive;
  40 +
  41 ++ (UIColor *)grayColorCNLive;
  42 +
  43 ++ (UIColor *)navigationLineColor;
  44 +
  45 ++ (UIColor *)blueColorCNLive;
  46 +
  47 ++ (UIColor *)cellLineColorCNLive;
30 @end 48 @end
LiveVideoCloud/LiveVideoCloud/UtilKits/Category/UIColor+HexString.m
@@ -90,4 +90,44 @@ @@ -90,4 +90,44 @@
90 { 90 {
91 return [self colorWithHexString:@"#e3e1e1"]; 91 return [self colorWithHexString:@"#e3e1e1"];
92 } 92 }
  93 +
  94 +
  95 ++ (UIColor *)yellowColorCNLive//后期全部要修改
  96 +{
  97 + return [self colorWithHexString:@"#BDFCC9"];//
  98 +}
  99 +
  100 ++ (UIColor *)redColorCNLive
  101 +{
  102 + return [self colorWithHexString:@"#ff4e51"];
  103 +}
  104 +
  105 ++ (UIColor *)backgroundColor
  106 +{
  107 + return [self colorWithHexString:@"#eeeeee"];
  108 +}
  109 +
  110 ++ (UIColor *)blackColorCNLive
  111 +{
  112 + return [self colorWithHexString:@"#323333"];
  113 +}
  114 +
  115 ++ (UIColor *)grayColorCNLive
  116 +{
  117 + return [self colorWithHexString:@"#969797"];
  118 +}
  119 +
  120 ++ (UIColor *)navigationLineColor
  121 +{
  122 + return [self colorWithHexString:@"#d0d0d0"];
  123 +}
  124 ++ (UIColor *)blueColorCNLive
  125 +{
  126 + return [self colorWithHexString:@"#177bdf"];
  127 +}
  128 +
  129 ++ (UIColor *)cellLineColorCNLive
  130 +{
  131 + return [self colorWithHexString:@"#e3e1e1"];
  132 +}
93 @end 133 @end
LiveVideoCloud/LiveVideoCloud/UtilKits/Macro/Macros/AppMacro.h
@@ -13,8 +13,8 @@ @@ -13,8 +13,8 @@
13 #ifndef AppMacro_h 13 #ifndef AppMacro_h
14 #define AppMacro_h 14 #define AppMacro_h
15 15
16 -#define AppId @"60_j0uqrv0u11"  
17 -#define AppKey @"876c5efece0fc9c98c51ff2180ee1bcfa5c5b5af202c78"  
18 -#define AppSceret @"ee844ea67b6be7303b6f5d9365af10ac09933c0828aba7" 16 +//#define AppId @"60_j0uqrv0u11"
  17 +//#define AppKey @"876c5efece0fc9c98c51ff2180ee1bcfa5c5b5af202c78"
  18 +//#define AppSceret @"ee844ea67b6be7303b6f5d9365af10ac09933c0828aba7"
19 19
20 #endif /* AppMacro_h */ 20 #endif /* AppMacro_h */
LiveVideoCloud/LiveVideoCloud/UtilKits/UtilKits.h
@@ -28,3 +28,21 @@ @@ -28,3 +28,21 @@
28 28
29 29
30 #endif /* UtilKits_h */ 30 #endif /* UtilKits_h */
  31 +
  32 +
  33 +
  34 +#define SCREEN_W [UIScreen mainScreen].bounds.size.width
  35 +#define SCREEN_H [UIScreen mainScreen].bounds.size.height
  36 +
  37 +#define CURRENT_WINDOW [[UIApplication sharedApplication].windows lastObject]
  38 +
  39 +#define LoginViewHeight 209
  40 +#define SMALL_MARGIN 5
  41 +#define CURRENT_WINDOW [[UIApplication sharedApplication].windows lastObject]
  42 +
  43 +/*** 颜色***/
  44 +#define ColorA(r ,g ,b ,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]
  45 +#define Color(r ,g ,b) ColorA((r),(g),(b),255)
  46 +#define RandomColor Color(arc4random_uniform(255) ,arc4random_uniform(255) ,arc4random_uniform(255))
  47 +#define GrayColor(v) Color((v), (v), (v))
  48 +#define CommonBgColor [UIColor colorWithHexString:@"eeeeee"];