diff --git a/MKNetworkKit/MKNetworkOperation.h b/MKNetworkKit/MKNetworkOperation.h index 427b78d..4ccfef7 100644 --- a/MKNetworkKit/MKNetworkOperation.h +++ b/MKNetworkKit/MKNetworkOperation.h @@ -262,6 +262,15 @@ typedef enum { */ @property (strong, nonatomic) NSMutableDictionary *cacheHeaders; +/*! + * @abstract Custom Timeout interval + * @property timeoutInterval + * + * @discussion + * Allows the app to set custom network timeout intervals + */ +@property (nonatomic) NSTimeInterval timeoutInterval; + /*! * @abstract Authentication methods * diff --git a/MKNetworkKit/MKNetworkOperation.m b/MKNetworkKit/MKNetworkOperation.m index 4932304..c9fb31c 100644 --- a/MKNetworkKit/MKNetworkOperation.m +++ b/MKNetworkKit/MKNetworkOperation.m @@ -347,6 +347,13 @@ -(void) setState:(MKNetworkOperationState)newState { } } +-(void)setTimeoutInterval:(NSTimeInterval)timeoutInterval{ + _request.timeoutInterval = timeoutInterval; +} +-(NSTimeInterval)timeoutInterval{ + return _request.timeoutInterval; +} + - (void)encodeWithCoder:(NSCoder *)encoder { [encoder encodeInteger:(NSInteger)self.stringEncoding forKey:@"stringEncoding"];