summaryrefslogtreecommitdiff
path: root/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking')
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h76
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m171
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h64
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m97
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h96
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m111
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h181
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m293
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h143
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m216
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h38
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h88
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m183
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h64
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m93
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h83
-rw-r--r--platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m151
17 files changed, 2148 insertions, 0 deletions
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h
new file mode 100644
index 0000000000..312d680e0d
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.h
@@ -0,0 +1,76 @@
+// AFNetworkActivityIndicatorManager.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+/**
+ `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.
+
+ You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code:
+
+ [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
+
+ By setting `isNetworkActivityIndicatorVisible` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself.
+
+ See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information:
+ http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44
+ */
+@interface AFNetworkActivityIndicatorManager : NSObject
+
+/**
+ A Boolean value indicating whether the manager is enabled.
+
+ If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO.
+ */
+@property (nonatomic, assign, getter = isEnabled) BOOL enabled;
+
+/**
+ A Boolean value indicating whether the network activity indicator is currently displayed in the status bar.
+ */
+@property (readonly, nonatomic, assign) BOOL isNetworkActivityIndicatorVisible;
+
+/**
+ Returns the shared network activity indicator manager object for the system.
+
+ @return The systemwide network activity indicator manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator.
+ */
+- (void)incrementActivityCount;
+
+/**
+ Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator.
+ */
+- (void)decrementActivityCount;
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m
new file mode 100644
index 0000000000..c2d855a59c
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/AFNetworkActivityIndicatorManager.m
@@ -0,0 +1,171 @@
+// AFNetworkActivityIndicatorManager.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "AFNetworkActivityIndicatorManager.h"
+
+#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
+
+#import "AFHTTPRequestOperation.h"
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+static NSTimeInterval const kAFNetworkActivityIndicatorInvisibilityDelay = 0.17;
+
+static NSURLRequest * AFNetworkRequestFromNotification(NSNotification *notification) {
+ if ([[notification object] isKindOfClass:[AFURLConnectionOperation class]]) {
+ return [(AFURLConnectionOperation *)[notification object] request];
+ }
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
+ if ([[notification object] respondsToSelector:@selector(originalRequest)]) {
+ return [(NSURLSessionTask *)[notification object] originalRequest];
+ }
+#endif
+
+ return nil;
+}
+
+@interface AFNetworkActivityIndicatorManager ()
+@property (readwrite, nonatomic, assign) NSInteger activityCount;
+@property (readwrite, nonatomic, strong) NSTimer *activityIndicatorVisibilityTimer;
+@property (readonly, nonatomic, getter = isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
+
+- (void)updateNetworkActivityIndicatorVisibility;
+- (void)updateNetworkActivityIndicatorVisibilityDelayed;
+@end
+
+@implementation AFNetworkActivityIndicatorManager
+@dynamic networkActivityIndicatorVisible;
+
++ (instancetype)sharedManager {
+ static AFNetworkActivityIndicatorManager *_sharedManager = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _sharedManager = [[self alloc] init];
+ });
+
+ return _sharedManager;
+}
+
++ (NSSet *)keyPathsForValuesAffectingIsNetworkActivityIndicatorVisible {
+ return [NSSet setWithObject:@"activityCount"];
+}
+
+- (id)init {
+ self = [super init];
+ if (!self) {
+ return nil;
+ }
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingOperationDidStartNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingOperationDidFinishNotification object:nil];
+
+#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidStart:) name:AFNetworkingTaskDidResumeNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidSuspendNotification object:nil];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkRequestDidFinish:) name:AFNetworkingTaskDidCompleteNotification object:nil];
+#endif
+
+ return self;
+}
+
+- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [_activityIndicatorVisibilityTimer invalidate];
+}
+
+- (void)updateNetworkActivityIndicatorVisibilityDelayed {
+ if (self.enabled) {
+ // Delay hiding of activity indicator for a short interval, to avoid flickering
+ if (![self isNetworkActivityIndicatorVisible]) {
+ [self.activityIndicatorVisibilityTimer invalidate];
+ self.activityIndicatorVisibilityTimer = [NSTimer timerWithTimeInterval:kAFNetworkActivityIndicatorInvisibilityDelay target:self selector:@selector(updateNetworkActivityIndicatorVisibility) userInfo:nil repeats:NO];
+ [[NSRunLoop mainRunLoop] addTimer:self.activityIndicatorVisibilityTimer forMode:NSRunLoopCommonModes];
+ } else {
+ [self performSelectorOnMainThread:@selector(updateNetworkActivityIndicatorVisibility) withObject:nil waitUntilDone:NO modes:@[NSRunLoopCommonModes]];
+ }
+ }
+}
+
+- (BOOL)isNetworkActivityIndicatorVisible {
+ return self.activityCount > 0;
+}
+
+- (void)updateNetworkActivityIndicatorVisibility {
+ [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]];
+}
+
+- (void)setActivityCount:(NSInteger)activityCount {
+ @synchronized(self) {
+ _activityCount = activityCount;
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self updateNetworkActivityIndicatorVisibilityDelayed];
+ });
+}
+
+- (void)incrementActivityCount {
+ [self willChangeValueForKey:@"activityCount"];
+ @synchronized(self) {
+ _activityCount++;
+ }
+ [self didChangeValueForKey:@"activityCount"];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self updateNetworkActivityIndicatorVisibilityDelayed];
+ });
+}
+
+- (void)decrementActivityCount {
+ [self willChangeValueForKey:@"activityCount"];
+ @synchronized(self) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ _activityCount = MAX(_activityCount - 1, 0);
+#pragma clang diagnostic pop
+ }
+ [self didChangeValueForKey:@"activityCount"];
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self updateNetworkActivityIndicatorVisibilityDelayed];
+ });
+}
+
+- (void)networkRequestDidStart:(NSNotification *)notification {
+ if ([AFNetworkRequestFromNotification(notification) URL]) {
+ [self incrementActivityCount];
+ }
+}
+
+- (void)networkRequestDidFinish:(NSNotification *)notification {
+ if ([AFNetworkRequestFromNotification(notification) URL]) {
+ [self decrementActivityCount];
+ }
+}
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
new file mode 100644
index 0000000000..1c1f8dd6f8
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.h
@@ -0,0 +1,64 @@
+// UIActivityIndicatorView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ 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.
+ */
+@interface UIActivityIndicatorView (AFNetworking)
+
+///----------------------------------
+/// @name Animating for Session Tasks
+///----------------------------------
+
+/**
+ Binds the animating state to the state of the specified task.
+
+ @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task;
+#endif
+
+///---------------------------------------
+/// @name Animating for Request Operations
+///---------------------------------------
+
+/**
+ Binds the animating state to the execution state of the specified operation.
+
+ @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation;
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m
new file mode 100644
index 0000000000..6627dbb1b8
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIActivityIndicatorView+AFNetworking.m
@@ -0,0 +1,97 @@
+// UIActivityIndicatorView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIActivityIndicatorView+AFNetworking.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+@implementation UIActivityIndicatorView (AFNetworking)
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setAnimatingWithStateOfTask:(NSURLSessionTask *)task {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+
+ if (task) {
+ if (task.state != NSURLSessionTaskStateCompleted) {
+ if (task.state == NSURLSessionTaskStateRunning) {
+ [self startAnimating];
+ } else {
+ [self stopAnimating];
+ }
+
+ [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingTaskDidResumeNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidCompleteNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingTaskDidSuspendNotification object:task];
+ }
+ }
+}
+#endif
+
+#pragma mark -
+
+- (void)setAnimatingWithStateOfOperation:(AFURLConnectionOperation *)operation {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
+
+ if (operation) {
+ if (![operation isFinished]) {
+ if ([operation isExecuting]) {
+ [self startAnimating];
+ } else {
+ [self stopAnimating];
+ }
+
+ [notificationCenter addObserver:self selector:@selector(af_startAnimating) name:AFNetworkingOperationDidStartNotification object:operation];
+ [notificationCenter addObserver:self selector:@selector(af_stopAnimating) name:AFNetworkingOperationDidFinishNotification object:operation];
+ }
+ }
+}
+
+#pragma mark -
+
+- (void)af_startAnimating {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self startAnimating];
+ });
+}
+
+- (void)af_stopAnimating {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self stopAnimating];
+ });
+}
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h
new file mode 100644
index 0000000000..b94f1cb8e0
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.h
@@ -0,0 +1,96 @@
+// UIAlertView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ This category adds methods to the UIKit framework's `UIAlertView` class. The methods in this category provide support for automatically showing an alert if a session task or request operation finishes with an error. Alert title and message are filled from the corresponding `localizedDescription` & `localizedRecoverySuggestion` or `localizedFailureReason` of the error.
+ */
+@interface UIAlertView (AFNetworking)
+
+///-------------------------------------
+/// @name Showing Alert for Session Task
+///-------------------------------------
+
+/**
+ Shows an alert view with the error of the specified session task, if any.
+
+ @param task The session task.
+ @param delegate The alert view delegate.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate;
+#endif
+
+/**
+ Shows an alert view with the error of the specified session task, if any, with a custom cancel button title and other button titles.
+
+ @param task The session task.
+ @param delegate The alert view delegate.
+ @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.
+ @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
+#endif
+
+///------------------------------------------
+/// @name Showing Alert for Request Operation
+///------------------------------------------
+
+/**
+ Shows an alert view with the error of the specified request operation, if any.
+
+ @param operation The request operation.
+ @param delegate The alert view delegate.
+ */
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate;
+
+/**
+ Shows an alert view with the error of the specified request operation, if any, with a custom cancel button title and other button titles.
+
+ @param operation The request operation.
+ @param delegate The alert view delegate.
+ @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button. Using this argument is equivalent to setting the cancel button index to the value returned by invoking addButtonWithTitle: specifying this title.
+ @param otherButtonTitles The title of another button. Using this argument is equivalent to invoking addButtonWithTitle: with this title to add more buttons. Too many buttons can cause the alert view to scroll. For guidelines on the best ways to use an alert in an app, see "Temporary Views". Titles of additional buttons to add to the receiver, terminated with `nil`.
+ */
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m
new file mode 100644
index 0000000000..b7e2a26cb2
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIAlertView+AFNetworking.m
@@ -0,0 +1,111 @@
+// UIAlertView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIAlertView+AFNetworking.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFURLConnectionOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+static void AFGetAlertViewTitleAndMessageFromError(NSError *error, NSString * __autoreleasing *title, NSString * __autoreleasing *message) {
+ if (error.localizedDescription && (error.localizedRecoverySuggestion || error.localizedFailureReason)) {
+ *title = error.localizedDescription;
+
+ if (error.localizedRecoverySuggestion) {
+ *message = error.localizedRecoverySuggestion;
+ } else {
+ *message = error.localizedFailureReason;
+ }
+ } else if (error.localizedDescription) {
+ *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description");
+ *message = error.localizedDescription;
+ } else {
+ *title = NSLocalizedStringFromTable(@"Error", @"AFNetworking", @"Fallback Error Description");
+ *message = [NSString stringWithFormat:NSLocalizedStringFromTable(@"%@ Error: %ld", @"AFNetworking", @"Fallback Error Failure Reason Format"), error.domain, (long)error.code];
+ }
+}
+
+@implementation UIAlertView (AFNetworking)
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate
+{
+ [self showAlertViewForTaskWithErrorOnCompletion:task delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlertView Cancel Button Title") otherButtonTitles:nil, nil];
+}
+
++ (void)showAlertViewForTaskWithErrorOnCompletion:(NSURLSessionTask *)task
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION
+{
+ __block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingTaskDidCompleteNotification object:task queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
+
+ NSError *error = notification.userInfo[AFNetworkingTaskDidCompleteErrorKey];
+ if (error) {
+ NSString *title, *message;
+ AFGetAlertViewTitleAndMessageFromError(error, &title, &message);
+
+ [[[UIAlertView alloc] initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles, nil] show];
+ }
+
+ [[NSNotificationCenter defaultCenter] removeObserver:observer name:AFNetworkingTaskDidCompleteNotification object:notification.object];
+ }];
+}
+#endif
+
+#pragma mark -
+
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate
+{
+ [self showAlertViewForRequestOperationWithErrorOnCompletion:operation delegate:delegate cancelButtonTitle:NSLocalizedStringFromTable(@"Dismiss", @"AFNetworking", @"UIAlert View Cancel Button Title") otherButtonTitles:nil, nil];
+}
+
++ (void)showAlertViewForRequestOperationWithErrorOnCompletion:(AFURLConnectionOperation *)operation
+ delegate:(id)delegate
+ cancelButtonTitle:(NSString *)cancelButtonTitle
+ otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION
+{
+ __block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:AFNetworkingOperationDidFinishNotification object:operation queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification) {
+
+ if (notification.object && [notification.object isKindOfClass:[AFURLConnectionOperation class]]) {
+ NSError *error = [(AFURLConnectionOperation *)notification.object error];
+ if (error) {
+ NSString *title, *message;
+ AFGetAlertViewTitleAndMessageFromError(error, &title, &message);
+
+ [[[UIAlertView alloc] initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:otherButtonTitles, nil] show];
+ }
+ }
+
+ [[NSNotificationCenter defaultCenter] removeObserver:observer name:AFNetworkingOperationDidFinishNotification object:notification.object];
+ }];
+}
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h
new file mode 100644
index 0000000000..e6ed6de04c
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.h
@@ -0,0 +1,181 @@
+// UIButton+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@protocol AFURLResponseSerialization, AFImageCache;
+
+/**
+ This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL.
+
+ @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported.
+ */
+@interface UIButton (AFNetworking)
+
+///----------------------------
+/// @name Accessing Image Cache
+///----------------------------
+
+/**
+ The image cache used to improve image loadiing performance on scroll views. By default, `UIButton` will use the `sharedImageCache` of `UIImageView`.
+ */
++ (id <AFImageCache>)sharedImageCache;
+
+/**
+ Set the cache used for image loading.
+
+ @param imageCache The image cache.
+ */
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache;
+
+///------------------------------------
+/// @name Accessing Response Serializer
+///------------------------------------
+
+/**
+ The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
+
+ @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
+ */
+@property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
+
+///--------------------
+/// @name Setting Image
+///--------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the image request.
+ */
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
+ */
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied.
+
+ @param state The control state.
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes.
+ @param success A block to be executed when the image 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`.
+ @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.
+ */
+- (void)setImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure;
+
+
+///-------------------------------
+/// @name Setting Background Image
+///-------------------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled.
+
+ If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the background image request.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ @param state The control state.
+ @param url The URL used for the background image request.
+ @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied.
+
+ @param state The control state.
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes.
+ */
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure;
+
+
+///------------------------------
+/// @name Canceling Image Loading
+///------------------------------
+
+/**
+ Cancels any executing image operation for the specified control state of the receiver, if one exists.
+
+ @param state The control state.
+ */
+- (void)cancelImageRequestOperationForState:(UIControlState)state;
+
+/**
+ Cancels any executing background image operation for the specified control state of the receiver, if one exists.
+
+ @param state The control state.
+ */
+- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state;
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m
new file mode 100644
index 0000000000..a225290a25
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIButton+AFNetworking.m
@@ -0,0 +1,293 @@
+// UIButton+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIButton+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFURLResponseSerialization.h"
+#import "AFHTTPRequestOperation.h"
+
+#import "UIImageView+AFNetworking.h"
+
+@interface UIButton (_AFNetworking)
+@end
+
+@implementation UIButton (_AFNetworking)
+
++ (NSOperationQueue *)af_sharedImageRequestOperationQueue {
+ static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init];
+ _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount;
+ });
+
+ return _af_sharedImageRequestOperationQueue;
+}
+
+#pragma mark -
+
+static char AFImageRequestOperationNormal;
+static char AFImageRequestOperationHighlighted;
+static char AFImageRequestOperationSelected;
+static char AFImageRequestOperationDisabled;
+
+static const char * af_imageRequestOperationKeyForState(UIControlState state) {
+ switch (state) {
+ case UIControlStateHighlighted:
+ return &AFImageRequestOperationHighlighted;
+ case UIControlStateSelected:
+ return &AFImageRequestOperationSelected;
+ case UIControlStateDisabled:
+ return &AFImageRequestOperationDisabled;
+ case UIControlStateNormal:
+ default:
+ return &AFImageRequestOperationNormal;
+ }
+}
+
+- (AFHTTPRequestOperation *)af_imageRequestOperationForState:(UIControlState)state {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_imageRequestOperationKeyForState(state));
+}
+
+- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation
+ forState:(UIControlState)state
+{
+ objc_setAssociatedObject(self, af_imageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+static char AFBackgroundImageRequestOperationNormal;
+static char AFBackgroundImageRequestOperationHighlighted;
+static char AFBackgroundImageRequestOperationSelected;
+static char AFBackgroundImageRequestOperationDisabled;
+
+static const char * af_backgroundImageRequestOperationKeyForState(UIControlState state) {
+ switch (state) {
+ case UIControlStateHighlighted:
+ return &AFBackgroundImageRequestOperationHighlighted;
+ case UIControlStateSelected:
+ return &AFBackgroundImageRequestOperationSelected;
+ case UIControlStateDisabled:
+ return &AFBackgroundImageRequestOperationDisabled;
+ case UIControlStateNormal:
+ default:
+ return &AFBackgroundImageRequestOperationNormal;
+ }
+}
+
+- (AFHTTPRequestOperation *)af_backgroundImageRequestOperationForState:(UIControlState)state {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state));
+}
+
+- (void)af_setBackgroundImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation
+ forState:(UIControlState)state
+{
+ objc_setAssociatedObject(self, af_backgroundImageRequestOperationKeyForState(state), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIButton (AFNetworking)
+
++ (id <AFImageCache>)sharedImageCache {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: [UIImageView sharedImageCache];
+#pragma clang diagnostic pop
+}
+
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache {
+ objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (id <AFURLResponseSerialization>)imageResponseSerializer {
+ static id <AFURLResponseSerialization> _af_defaultImageResponseSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setImageResponseSerializer:(id <AFURLResponseSerialization>)serializer {
+ objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+{
+ [self setImageForState:state withURL:url placeholderImage:nil];
+}
+
+- (void)setImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage
+{
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+ [self setImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure
+{
+ [self cancelImageRequestOperationForState:state];
+
+ UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
+ if (cachedImage) {
+ if (success) {
+ success(nil, nil, cachedImage);
+ } else {
+ [self setImage:cachedImage forState:state];
+ }
+
+ [self af_setImageRequestOperation:nil forState:state];
+ } else {
+ if (placeholderImage) {
+ [self setImage:placeholderImage forState:state];
+ }
+
+ __weak __typeof(self)weakSelf = self;
+ AFHTTPRequestOperation *imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
+ imageRequestOperation.responseSerializer = self.imageResponseSerializer;
+ [imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[operation.request URL]]) {
+ if (success) {
+ success(operation.request, operation.response, responseObject);
+ } else if (responseObject) {
+ [strongSelf setImage:responseObject forState:state];
+ }
+ }
+ [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ if ([[urlRequest URL] isEqual:[operation.response URL]]) {
+ if (failure) {
+ failure(error);
+ }
+ }
+ }];
+
+ [self af_setImageRequestOperation:imageRequestOperation forState:state];
+ [[[self class] af_sharedImageRequestOperationQueue] addOperation:imageRequestOperation];
+ }
+}
+
+#pragma mark -
+
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+{
+ [self setBackgroundImageForState:state withURL:url placeholderImage:nil];
+}
+
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage
+{
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+ [self setBackgroundImageForState:state withURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setBackgroundImageForState:(UIControlState)state
+ withURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSError *error))failure
+{
+ [self cancelBackgroundImageRequestOperationForState:state];
+
+ UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
+ if (cachedImage) {
+ if (success) {
+ success(nil, nil, cachedImage);
+ } else {
+ [self setBackgroundImage:cachedImage forState:state];
+ }
+
+ [self af_setBackgroundImageRequestOperation:nil forState:state];
+ } else {
+ if (placeholderImage) {
+ [self setBackgroundImage:placeholderImage forState:state];
+ }
+
+ __weak __typeof(self)weakSelf = self;
+ AFHTTPRequestOperation *backgroundImageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
+ backgroundImageRequestOperation.responseSerializer = self.imageResponseSerializer;
+ [backgroundImageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[operation.request URL]]) {
+ if (success) {
+ success(operation.request, operation.response, responseObject);
+ } else if (responseObject) {
+ [strongSelf setBackgroundImage:responseObject forState:state];
+ }
+ }
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ if ([[urlRequest URL] isEqual:[operation.response URL]]) {
+ if (failure) {
+ failure(error);
+ }
+ }
+ }];
+
+ [self af_setBackgroundImageRequestOperation:backgroundImageRequestOperation forState:state];
+ [[[self class] af_sharedImageRequestOperationQueue] addOperation:backgroundImageRequestOperation];
+ }
+}
+
+#pragma mark -
+
+- (void)cancelImageRequestOperationForState:(UIControlState)state {
+ [[self af_imageRequestOperationForState:state] cancel];
+ [self af_setImageRequestOperation:nil forState:state];
+}
+
+- (void)cancelBackgroundImageRequestOperationForState:(UIControlState)state {
+ [[self af_backgroundImageRequestOperationForState:state] cancel];
+ [self af_setBackgroundImageRequestOperation:nil forState:state];
+}
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h
new file mode 100644
index 0000000000..5d523636e8
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.h
@@ -0,0 +1,143 @@
+// UIImageView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@protocol AFURLResponseSerialization, AFImageCache;
+
+/**
+ This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL.
+ */
+@interface UIImageView (AFNetworking)
+
+///----------------------------
+/// @name Accessing Image Cache
+///----------------------------
+
+/**
+ The image cache used to improve image loadiing 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.
+*/
++ (id <AFImageCache>)sharedImageCache;
+
+/**
+ Set the cache used for image loading.
+
+ @param imageCache The image cache.
+ */
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache;
+
+///------------------------------------
+/// @name Accessing Response Serializer
+///------------------------------------
+
+/**
+ The response serializer used to create an image representation from the server response and response data. By default, this is an instance of `AFImageResponseSerializer`.
+
+ @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
+ */
+@property (nonatomic, strong) id <AFURLResponseSerialization> imageResponseSerializer;
+
+///--------------------
+/// @name Setting Image
+///--------------------
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
+
+ @param url The URL used for the image request.
+ */
+- (void)setImageWithURL:(NSURL *)url;
+
+/**
+ Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:`
+
+ @param url The URL used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
+ */
+- (void)setImageWithURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage;
+
+/**
+ Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled.
+
+ If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished.
+
+ If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied.
+
+ @param urlRequest The URL request used for the image request.
+ @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes.
+ @param success A block to be executed when the image 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`.
+ @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.
+ */
+- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure;
+
+/**
+ Cancels any executing image operation for the receiver, if one exists.
+ */
+- (void)cancelImageRequestOperation;
+
+@end
+
+#pragma mark -
+
+/**
+ The `AFImageCache` protocol is adopted by an object used to cache images loaded by the AFNetworking category on `UIImageView`.
+ */
+@protocol AFImageCache <NSObject>
+
+/**
+ Returns a cached image for the specififed request, if available.
+
+ @param request The image request.
+
+ @return The cached image.
+ */
+- (UIImage *)cachedImageForRequest:(NSURLRequest *)request;
+
+/**
+ Caches a particular image for the specified request.
+
+ @param image The image to cache.
+ @param request The request to be used as a cache key.
+ */
+- (void)cacheImage:(UIImage *)image
+ forRequest:(NSURLRequest *)request;
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m
new file mode 100644
index 0000000000..c06aa9ca4c
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIImageView+AFNetworking.m
@@ -0,0 +1,216 @@
+// UIImageView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIImageView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+
+@interface AFImageCache : NSCache <AFImageCache>
+@end
+
+#pragma mark -
+
+@interface UIImageView (_AFNetworking)
+@property (readwrite, nonatomic, strong, setter = af_setImageRequestOperation:) AFHTTPRequestOperation *af_imageRequestOperation;
+@end
+
+@implementation UIImageView (_AFNetworking)
+
++ (NSOperationQueue *)af_sharedImageRequestOperationQueue {
+ static NSOperationQueue *_af_sharedImageRequestOperationQueue = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_sharedImageRequestOperationQueue = [[NSOperationQueue alloc] init];
+ _af_sharedImageRequestOperationQueue.maxConcurrentOperationCount = NSOperationQueueDefaultMaxConcurrentOperationCount;
+ });
+
+ return _af_sharedImageRequestOperationQueue;
+}
+
+- (AFHTTPRequestOperation *)af_imageRequestOperation {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_imageRequestOperation));
+}
+
+- (void)af_setImageRequestOperation:(AFHTTPRequestOperation *)imageRequestOperation {
+ objc_setAssociatedObject(self, @selector(af_imageRequestOperation), imageRequestOperation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIImageView (AFNetworking)
+@dynamic imageResponseSerializer;
+
++ (id <AFImageCache>)sharedImageCache {
+ static AFImageCache *_af_defaultImageCache = nil;
+ static dispatch_once_t oncePredicate;
+ dispatch_once(&oncePredicate, ^{
+ _af_defaultImageCache = [[AFImageCache alloc] init];
+
+ [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * __unused notification) {
+ [_af_defaultImageCache removeAllObjects];
+ }];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(sharedImageCache)) ?: _af_defaultImageCache;
+#pragma clang diagnostic pop
+}
+
++ (void)setSharedImageCache:(id <AFImageCache>)imageCache {
+ objc_setAssociatedObject(self, @selector(sharedImageCache), imageCache, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (id <AFURLResponseSerialization>)imageResponseSerializer {
+ static id <AFURLResponseSerialization> _af_defaultImageResponseSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultImageResponseSerializer = [AFImageResponseSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(imageResponseSerializer)) ?: _af_defaultImageResponseSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setImageResponseSerializer:(id <AFURLResponseSerialization>)serializer {
+ objc_setAssociatedObject(self, @selector(imageResponseSerializer), serializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)setImageWithURL:(NSURL *)url {
+ [self setImageWithURL:url placeholderImage:nil];
+}
+
+- (void)setImageWithURL:(NSURL *)url
+ placeholderImage:(UIImage *)placeholderImage
+{
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
+ [request addValue:@"image/*" forHTTPHeaderField:@"Accept"];
+
+ [self setImageWithURLRequest:request placeholderImage:placeholderImage success:nil failure:nil];
+}
+
+- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest
+ placeholderImage:(UIImage *)placeholderImage
+ success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success
+ failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure
+{
+ [self cancelImageRequestOperation];
+
+ UIImage *cachedImage = [[[self class] sharedImageCache] cachedImageForRequest:urlRequest];
+ if (cachedImage) {
+ if (success) {
+ success(nil, nil, cachedImage);
+ } else {
+ self.image = cachedImage;
+ }
+
+ self.af_imageRequestOperation = nil;
+ } else {
+ if (placeholderImage) {
+ self.image = placeholderImage;
+ }
+
+ __weak __typeof(self)weakSelf = self;
+ self.af_imageRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:urlRequest];
+ self.af_imageRequestOperation.responseSerializer = self.imageResponseSerializer;
+ [self.af_imageRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) {
+ if (success) {
+ success(urlRequest, operation.response, responseObject);
+ } else if (responseObject) {
+ strongSelf.image = responseObject;
+ }
+
+ if (operation == strongSelf.af_imageRequestOperation){
+ strongSelf.af_imageRequestOperation = nil;
+ }
+ }
+
+ [[[strongSelf class] sharedImageCache] cacheImage:responseObject forRequest:urlRequest];
+ } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ if ([[urlRequest URL] isEqual:[strongSelf.af_imageRequestOperation.request URL]]) {
+ if (failure) {
+ failure(urlRequest, operation.response, error);
+ }
+
+ if (operation == strongSelf.af_imageRequestOperation){
+ strongSelf.af_imageRequestOperation = nil;
+ }
+ }
+ }];
+
+ [[[self class] af_sharedImageRequestOperationQueue] addOperation:self.af_imageRequestOperation];
+ }
+}
+
+- (void)cancelImageRequestOperation {
+ [self.af_imageRequestOperation cancel];
+ self.af_imageRequestOperation = nil;
+}
+
+@end
+
+#pragma mark -
+
+static inline NSString * AFImageCacheKeyFromURLRequest(NSURLRequest *request) {
+ return [[request URL] absoluteString];
+}
+
+@implementation AFImageCache
+
+- (UIImage *)cachedImageForRequest:(NSURLRequest *)request {
+ switch ([request cachePolicy]) {
+ case NSURLRequestReloadIgnoringCacheData:
+ case NSURLRequestReloadIgnoringLocalAndRemoteCacheData:
+ return nil;
+ default:
+ break;
+ }
+
+ return [self objectForKey:AFImageCacheKeyFromURLRequest(request)];
+}
+
+- (void)cacheImage:(UIImage *)image
+ forRequest:(NSURLRequest *)request
+{
+ if (image && request) {
+ [self setObject:image forKey:AFImageCacheKeyFromURLRequest(request)];
+ }
+}
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h
new file mode 100644
index 0000000000..94082f6cb5
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIKit+AFNetworking.h
@@ -0,0 +1,38 @@
+// UIKit+AFNetworking.h
+//
+// Copyright (c) 2013 AFNetworking (http://afnetworking.com/)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <UIKit/UIKit.h>
+
+#ifndef _UIKIT_AFNETWORKING_
+ #define _UIKIT_AFNETWORKING_
+
+ #import "AFNetworkActivityIndicatorManager.h"
+
+ #import "UIActivityIndicatorView+AFNetworking.h"
+ #import "UIAlertView+AFNetworking.h"
+ #import "UIButton+AFNetworking.h"
+ #import "UIImageView+AFNetworking.h"
+ #import "UIKit+AFNetworking.h"
+ #import "UIProgressView+AFNetworking.h"
+ #import "UIRefreshControl+AFNetworking.h"
+ #import "UIWebView+AFNetworking.h"
+#endif /* _UIKIT_AFNETWORKING_ */
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h
new file mode 100644
index 0000000000..3f1bc086f5
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.h
@@ -0,0 +1,88 @@
+// UIProgressView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ 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.
+ */
+@interface UIProgressView (AFNetworking)
+
+///------------------------------------
+/// @name Setting Session Task Progress
+///------------------------------------
+
+/**
+ Binds the progress to the upload progress of the specified session task.
+
+ @param task The session task.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
+ animated:(BOOL)animated;
+#endif
+
+/**
+ Binds the progress to the download progress of the specified session task.
+
+ @param task The session task.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
+ animated:(BOOL)animated;
+#endif
+
+///------------------------------------
+/// @name Setting Session Task Progress
+///------------------------------------
+
+/**
+ Binds the progress to the upload progress of the specified request operation.
+
+ @param operation The request operation.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated;
+
+/**
+ Binds the progress to the download progress of the specified request operation.
+
+ @param operation The request operation.
+ @param animated `YES` if the change should be animated, `NO` if the change should happen immediately.
+ */
+- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated;
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m
new file mode 100644
index 0000000000..927f56d843
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIProgressView+AFNetworking.m
@@ -0,0 +1,183 @@
+// UIProgressView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIProgressView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFURLConnectionOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+static void * AFTaskCountOfBytesSentContext = &AFTaskCountOfBytesSentContext;
+static void * AFTaskCountOfBytesReceivedContext = &AFTaskCountOfBytesReceivedContext;
+
+@interface AFURLConnectionOperation (_UIProgressView)
+@property (readwrite, nonatomic, copy) void (^uploadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected);
+@property (readwrite, nonatomic, assign, setter = af_setUploadProgressAnimated:) BOOL af_uploadProgressAnimated;
+
+@property (readwrite, nonatomic, copy) void (^downloadProgress)(NSUInteger bytes, long long totalBytes, long long totalBytesExpected);
+@property (readwrite, nonatomic, assign, setter = af_setDownloadProgressAnimated:) BOOL af_downloadProgressAnimated;
+@end
+
+@implementation AFURLConnectionOperation (_UIProgressView)
+@dynamic uploadProgress; // Implemented in AFURLConnectionOperation
+@dynamic af_uploadProgressAnimated;
+
+@dynamic downloadProgress; // Implemented in AFURLConnectionOperation
+@dynamic af_downloadProgressAnimated;
+@end
+
+#pragma mark -
+
+@implementation UIProgressView (AFNetworking)
+
+- (BOOL)af_uploadProgressAnimated {
+ return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_uploadProgressAnimated)) boolValue];
+}
+
+- (void)af_setUploadProgressAnimated:(BOOL)animated {
+ objc_setAssociatedObject(self, @selector(af_uploadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (BOOL)af_downloadProgressAnimated {
+ return [(NSNumber *)objc_getAssociatedObject(self, @selector(af_downloadProgressAnimated)) boolValue];
+}
+
+- (void)af_setDownloadProgressAnimated:(BOOL)animated {
+ objc_setAssociatedObject(self, @selector(af_downloadProgressAnimated), @(animated), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task
+ animated:(BOOL)animated
+{
+ [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
+ [task addObserver:self forKeyPath:@"countOfBytesSent" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesSentContext];
+
+ [self af_setUploadProgressAnimated:animated];
+}
+
+- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task
+ animated:(BOOL)animated
+{
+ [task addObserver:self forKeyPath:@"state" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
+ [task addObserver:self forKeyPath:@"countOfBytesReceived" options:(NSKeyValueObservingOptions)0 context:AFTaskCountOfBytesReceivedContext];
+
+ [self af_setDownloadProgressAnimated:animated];
+}
+#endif
+
+#pragma mark -
+
+- (void)setProgressWithUploadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated
+{
+ __weak __typeof(self)weakSelf = self;
+ void (^original)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) = [operation.uploadProgress copy];
+ [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
+ if (original) {
+ original(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite);
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (totalBytesExpectedToWrite > 0) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ [strongSelf setProgress:(totalBytesWritten / (totalBytesExpectedToWrite * 1.0f)) animated:animated];
+ }
+ });
+ }];
+}
+
+- (void)setProgressWithDownloadProgressOfOperation:(AFURLConnectionOperation *)operation
+ animated:(BOOL)animated
+{
+ __weak __typeof(self)weakSelf = self;
+ void (^original)(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) = [operation.downloadProgress copy];
+ [operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
+ if (original) {
+ original(bytesRead, totalBytesRead, totalBytesExpectedToRead);
+ }
+
+ dispatch_async(dispatch_get_main_queue(), ^{
+ if (totalBytesExpectedToRead > 0) {
+ __strong __typeof(weakSelf)strongSelf = weakSelf;
+ [strongSelf setProgress:(totalBytesRead / (totalBytesExpectedToRead * 1.0f)) animated:animated];
+ }
+ });
+ }];
+}
+
+#pragma mark - NSKeyValueObserving
+
+- (void)observeValueForKeyPath:(NSString *)keyPath
+ ofObject:(id)object
+ change:(__unused NSDictionary *)change
+ context:(void *)context
+{
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+ if (context == AFTaskCountOfBytesSentContext || context == AFTaskCountOfBytesReceivedContext) {
+ if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesSent))]) {
+ if ([object countOfBytesExpectedToSend] > 0) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self setProgress:[object countOfBytesSent] / ([object countOfBytesExpectedToSend] * 1.0f) animated:self.af_uploadProgressAnimated];
+ });
+ }
+ }
+
+ if ([keyPath isEqualToString:NSStringFromSelector(@selector(countOfBytesReceived))]) {
+ if ([object countOfBytesExpectedToReceive] > 0) {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self setProgress:[object countOfBytesReceived] / ([object countOfBytesExpectedToReceive] * 1.0f) animated:self.af_downloadProgressAnimated];
+ });
+ }
+ }
+
+ if ([keyPath isEqualToString:NSStringFromSelector(@selector(state))]) {
+ if ([(NSURLSessionTask *)object state] == NSURLSessionTaskStateCompleted) {
+ @try {
+ [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(state))];
+
+ if (context == AFTaskCountOfBytesSentContext) {
+ [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesSent))];
+ }
+
+ if (context == AFTaskCountOfBytesReceivedContext) {
+ [object removeObserver:self forKeyPath:NSStringFromSelector(@selector(countOfBytesReceived))];
+ }
+ }
+ @catch (NSException * __unused exception) {}
+ }
+ }
+ }
+#endif
+}
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h
new file mode 100644
index 0000000000..37ce772de0
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.h
@@ -0,0 +1,64 @@
+// UIRefreshControl+AFNetworking.m
+//
+// Copyright (c) 2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFURLConnectionOperation;
+
+/**
+ 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.
+ */
+@interface UIRefreshControl (AFNetworking)
+
+///-----------------------------------
+/// @name Refreshing for Session Tasks
+///-----------------------------------
+
+/**
+ Binds the refreshing state to the state of the specified task.
+
+ @param task The task. If `nil`, automatic updating from any previously specified operation will be diabled.
+ */
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task;
+#endif
+
+///----------------------------------------
+/// @name Refreshing for Request Operations
+///----------------------------------------
+
+/**
+ Binds the refreshing state to the execution state of the specified operation.
+
+ @param operation The operation. If `nil`, automatic updating from any previously specified operation will be disabled.
+ */
+- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation;
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m
new file mode 100644
index 0000000000..e266451fe5
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIRefreshControl+AFNetworking.m
@@ -0,0 +1,93 @@
+// UIRefreshControl+AFNetworking.m
+//
+// Copyright (c) 2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIRefreshControl+AFNetworking.h"
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+#import "AFURLSessionManager.h"
+#endif
+
+@implementation UIRefreshControl (AFNetworking)
+
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
+- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidResumeNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidSuspendNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingTaskDidCompleteNotification object:nil];
+
+ if (task) {
+ if (task.state == NSURLSessionTaskStateRunning) {
+ [self beginRefreshing];
+
+ [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingTaskDidResumeNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidCompleteNotification object:task];
+ [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingTaskDidSuspendNotification object:task];
+ } else {
+ [self endRefreshing];
+ }
+ }
+}
+#endif
+
+- (void)setRefreshingWithStateOfOperation:(AFURLConnectionOperation *)operation {
+ NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidStartNotification object:nil];
+ [notificationCenter removeObserver:self name:AFNetworkingOperationDidFinishNotification object:nil];
+
+ if (operation) {
+ if (![operation isFinished]) {
+ if ([operation isExecuting]) {
+ [self beginRefreshing];
+ } else {
+ [self endRefreshing];
+ }
+
+ [notificationCenter addObserver:self selector:@selector(af_beginRefreshing) name:AFNetworkingOperationDidStartNotification object:operation];
+ [notificationCenter addObserver:self selector:@selector(af_endRefreshing) name:AFNetworkingOperationDidFinishNotification object:operation];
+ }
+ }
+}
+
+#pragma mark -
+
+- (void)af_beginRefreshing {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self beginRefreshing];
+ });
+}
+
+- (void)af_endRefreshing {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [self endRefreshing];
+ });
+}
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h
new file mode 100644
index 0000000000..202e8f4ea2
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.h
@@ -0,0 +1,83 @@
+// UIWebView+AFNetworking.h
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <Availability.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import <UIKit/UIKit.h>
+
+@class AFHTTPRequestSerializer, AFHTTPResponseSerializer;
+@protocol AFURLRequestSerialization, AFURLResponseSerialization;
+
+/**
+ This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling.
+
+ @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly.
+ */
+@interface UIWebView (AFNetworking)
+
+/**
+ The request serializer used to serialize requests made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPRequestSerializer`.
+ */
+@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
+
+/**
+ The response serializer used to serialize responses made with the `-loadRequest:...` category methods. By default, this is an instance of `AFHTTPResponseSerializer`.
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+/**
+ Asynchronously loads the specified request.
+
+ @param request A URL request identifying the location of the content to load. This must not be `nil`.
+ @param progress A 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.
+ @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string.
+ @param failure A block object to be executed when the 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.
+ */
+- (void)loadRequest:(NSURLRequest *)request
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
+ failure:(void (^)(NSError *error))failure;
+
+/**
+ Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding.
+
+ @param request A URL request identifying the location of the content to load. This must not be `nil`.
+ @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified.
+ @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified.
+ @param progress A 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.
+ @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data.
+ @param failure A block object to be executed when the 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.
+ */
+- (void)loadRequest:(NSURLRequest *)request
+ MIMEType:(NSString *)MIMEType
+ textEncodingName:(NSString *)textEncodingName
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
+ failure:(void (^)(NSError *error))failure;
+
+@end
+
+#endif
diff --git a/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m
new file mode 100644
index 0000000000..525d02aead
--- /dev/null
+++ b/platform/ios/test/OHHTTPStubs/OHHTTPStubs/Pods/AFNetworking/UIKit+AFNetworking/UIWebView+AFNetworking.m
@@ -0,0 +1,151 @@
+// UIWebView+AFNetworking.m
+//
+// Copyright (c) 2013-2014 AFNetworking (http://afnetworking.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import "UIWebView+AFNetworking.h"
+
+#import <objc/runtime.h>
+
+#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
+
+#import "AFHTTPRequestOperation.h"
+#import "AFURLResponseSerialization.h"
+#import "AFURLRequestSerialization.h"
+
+@interface UIWebView (_AFNetworking)
+@property (readwrite, nonatomic, strong, setter = af_setHTTPRequestOperation:) AFHTTPRequestOperation *af_HTTPRequestOperation;
+@end
+
+@implementation UIWebView (_AFNetworking)
+
+- (AFHTTPRequestOperation *)af_HTTPRequestOperation {
+ return (AFHTTPRequestOperation *)objc_getAssociatedObject(self, @selector(af_HTTPRequestOperation));
+}
+
+- (void)af_setHTTPRequestOperation:(AFHTTPRequestOperation *)operation {
+ objc_setAssociatedObject(self, @selector(af_HTTPRequestOperation), operation, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+@end
+
+#pragma mark -
+
+@implementation UIWebView (AFNetworking)
+
+- (AFHTTPRequestSerializer <AFURLRequestSerialization> *)requestSerializer {
+ static AFHTTPRequestSerializer <AFURLRequestSerialization> *_af_defaultRequestSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultRequestSerializer = [AFHTTPRequestSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(requestSerializer)) ?: _af_defaultRequestSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setRequestSerializer:(AFHTTPRequestSerializer<AFURLRequestSerialization> *)requestSerializer {
+ objc_setAssociatedObject(self, @selector(requestSerializer), requestSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+- (AFHTTPResponseSerializer <AFURLResponseSerialization> *)responseSerializer {
+ static AFHTTPResponseSerializer <AFURLResponseSerialization> *_af_defaultResponseSerializer = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ _af_defaultResponseSerializer = [AFHTTPResponseSerializer serializer];
+ });
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ return objc_getAssociatedObject(self, @selector(responseSerializer)) ?: _af_defaultResponseSerializer;
+#pragma clang diagnostic pop
+}
+
+- (void)setResponseSerializer:(AFHTTPResponseSerializer<AFURLResponseSerialization> *)responseSerializer {
+ objc_setAssociatedObject(self, @selector(responseSerializer), responseSerializer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
+#pragma mark -
+
+- (void)loadRequest:(NSURLRequest *)request
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success
+ failure:(void (^)(NSError *error))failure
+{
+ [self loadRequest:request MIMEType:nil textEncodingName:nil progress:progress success:^NSData *(NSHTTPURLResponse *response, NSData *data) {
+ NSStringEncoding stringEncoding = NSUTF8StringEncoding;
+ if (response.textEncodingName) {
+ CFStringEncoding encoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef)response.textEncodingName);
+ if (encoding != kCFStringEncodingInvalidId) {
+ stringEncoding = CFStringConvertEncodingToNSStringEncoding(encoding);
+ }
+ }
+
+ NSString *string = [[NSString alloc] initWithData:data encoding:stringEncoding];
+ if (success) {
+ string = success(response, string);
+ }
+
+ return [string dataUsingEncoding:stringEncoding];
+ } failure:failure];
+}
+
+- (void)loadRequest:(NSURLRequest *)request
+ MIMEType:(NSString *)MIMEType
+ textEncodingName:(NSString *)textEncodingName
+ progress:(void (^)(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite))progress
+ success:(NSData * (^)(NSHTTPURLResponse *response, NSData *data))success
+ failure:(void (^)(NSError *error))failure
+{
+ NSParameterAssert(request);
+
+ if (self.af_HTTPRequestOperation) {
+ [self.af_HTTPRequestOperation cancel];
+ }
+
+ request = [self.requestSerializer requestBySerializingRequest:request withParameters:nil error:nil];
+
+ self.af_HTTPRequestOperation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
+ self.af_HTTPRequestOperation.responseSerializer = self.responseSerializer;
+
+ __weak __typeof(self)weakSelf = self;
+ [self.af_HTTPRequestOperation setDownloadProgressBlock:progress];
+ [self.af_HTTPRequestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id __unused responseObject) {
+ NSData *data = success ? success(operation.response, operation.responseData) : operation.responseData;
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wgnu"
+ __strong __typeof(weakSelf) strongSelf = weakSelf;
+ [strongSelf loadData:data MIMEType:(MIMEType ?: [operation.response MIMEType]) textEncodingName:(textEncodingName ?: [operation.response textEncodingName]) baseURL:[operation.response URL]];
+#pragma clang diagnostic pop
+ } failure:^(AFHTTPRequestOperation * __unused operation, NSError *error) {
+ if (failure) {
+ failure(error);
+ }
+ }];
+
+ [self.af_HTTPRequestOperation start];
+}
+
+@end
+
+#endif