Skip to content

Instantly share code, notes, and snippets.

@sag333ar
Created March 3, 2014 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sag333ar/9319492 to your computer and use it in GitHub Desktop.
Save sag333ar/9319492 to your computer and use it in GitHub Desktop.
// ------------------------------------------------------------------------
// newSessionConfig.h
#import <Foundation/Foundation.h>
@interface SessionConfiguration : NSObject
@end
// ------------------------------------------------------------------------
static NSURLSessionConfiguration *sharedSessionConfig;
@interface SessionConfiguration ()
+ (NSURLSessionConfiguration*)sessionConfig;
@end
@implementation SessionConfiguration
+ (void)initialize {
sharedSessionConfig = [NSURLSessionConfiguration defaultSessionConfiguration];
sharedSessionConfig.timeoutIntervalForRequest = API_RQST_TIME_OUT;
sharedSessionConfig.allowsCellularAccess = YES;
sharedSessionConfig.requestCachePolicy = NSURLRequestReloadIgnoringCacheData;
}
+ (NSURLSessionConfiguration*)sessionConfig {
return sharedSessionConfig;
}
@end
// ------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment