标签:style http color io ar art div sp log
#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
@interface AFAppDotNetAPIClient : AFHTTPSessionManager
+ (instancetype)sharedClient;
@end
#import "AFAppDotNetAPIClient.h"
static NSString * const AFAppDotNetAPIBaseURLString = @"https://api.app.net/";
@implementation AFAppDotNetAPIClient
+ (instancetype)sharedClient {
static AFAppDotNetAPIClient *_sharedClient = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedClient = [[AFAppDotNetAPIClient alloc] initWithBaseURL:[NSURL URLWithString:AFAppDotNetAPIBaseURLString]];
_sharedClient.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
[_sharedClient.reachabilityManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
switch (status) {
case AFNetworkReachabilityStatusReachableViaWWAN:
NSLog(@"-------AFNetworkReachabilityStatusReachableViaWWAN------");
break;
case AFNetworkReachabilityStatusReachableViaWiFi:
NSLog(@"-------AFNetworkReachabilityStatusReachableViaWiFi------");
break;
case AFNetworkReachabilityStatusNotReachable:
NSLog(@"-------AFNetworkReachabilityStatusNotReachable------");
break;
default:
break;
}
}];
[_sharedClient.reachabilityManager startMonitoring];
});
return _sharedClient;
}
@end
标签:style http color io ar art div sp log
原文地址:http://blog.csdn.net/majiakun1/article/details/39176967