Inherits from NSObject
Declared in MKNetworkEngine.h
MKNetworkEngine.m

Overview

@class MKNetworkEngine

Properties

apiPath

Sets an api path if it is different from root URL @property apiPath

@property (copy, nonatomic) NSString *apiPath

Declared In

MKNetworkEngine.h

portNumber

Port Number that should be used by URL creating factory methods @property portNumber

@property (assign, nonatomic) int portNumber

Declared In

MKNetworkEngine.h

reachabilityChangedHandler

Handler that you implement to monitor reachability changes @property reachabilityChangedHandler

@property (copy, nonatomic) void ( ^ ) ( NetworkStatus ns ) reachabilityChangedHandler

Declared In

MKNetworkEngine.h

readonlyHostName

HostName of the engine @property readonlyHostName

@property (readonly, copy, nonatomic) NSString *readonlyHostName

Declared In

MKNetworkEngine.h

shouldSendAcceptLanguageHeader

Boolean variable that states whether the request should automatically include an Accept-Language header. @property shouldSendAcceptLanguageHeader

@property (nonatomic, assign) BOOL shouldSendAcceptLanguageHeader

Declared In

MKNetworkEngine.h

wifiOnlyMode

WiFi only mode @property wifiOnlyMode

@property (assign, nonatomic) BOOL wifiOnlyMode

Declared In

MKNetworkEngine.h

Class Methods

cancelOperationsContainingURLString:

Cancels operations matching a given string

+ (void)cancelOperationsContainingURLString:(NSString *)string

Declared In

MKNetworkEngine.h

cancelOperationsMatchingBlock:

Cancels operations matching the given block.

+ (void)cancelOperationsMatchingBlock:(BOOL ( ^ ) ( MKNetworkOperation *))block

Declared In

MKNetworkEngine.h

Instance Methods

cacheDirectoryName

Cache Directory Name

- (NSString *)cacheDirectoryName

Declared In

MKNetworkEngine.h

cacheMemoryCost

Cache Directory In Memory Cost

- (int)cacheMemoryCost

Declared In

MKNetworkEngine.h

cancelAllOperations

Cancels all operations created by this engine

- (void)cancelAllOperations

Declared In

MKNetworkEngine.h

emptyCache

Empties previously cached data

- (void)emptyCache

Declared In

MKNetworkEngine.h

enqueueOperation:

Enqueues your operation into the shared queue

- (void)enqueueOperation:(MKNetworkOperation *)request

Declared In

MKNetworkEngine.h

enqueueOperation:forceReload:

Enqueues your operation into the shared queue.

- (void)enqueueOperation:(MKNetworkOperation *)operation forceReload:(BOOL)forceReload

Declared In

MKNetworkEngine.h

imageAtURL:completionHandler:errorHandler:

Handy helper method for fetching images in the background

- (MKNetworkOperation *)imageAtURL:(NSURL *)url completionHandler:(MKNKImageBlock)imageFetchedBlock errorHandler:(MKNKResponseErrorBlock)errorBlock

Declared In

MKNetworkEngine.h

imageAtURL:onCompletion:

Handy helper method for fetching images

- (MKNetworkOperation *)imageAtURL:(NSURL *)url onCompletion:(MKNKImageBlock)imageFetchedBlock

Declared In

MKNetworkEngine.h

imageAtURL:size:completionHandler:errorHandler:

Handy helper method for fetching images asynchronously in the background

- (MKNetworkOperation *)imageAtURL:(NSURL *)url size:(CGSize)size completionHandler:(MKNKImageBlock)imageFetchedBlock errorHandler:(MKNKResponseErrorBlock)errorBlock

Declared In

MKNetworkEngine.h

imageAtURL:size:onCompletion:

Handy helper method for fetching images asynchronously in the background

- (MKNetworkOperation *)imageAtURL:(NSURL *)url size:(CGSize)size onCompletion:(MKNKImageBlock)imageFetchedBlock

Declared In

MKNetworkEngine.h

initWithHostName:

Initializes your network engine with a hostname

- (id)initWithHostName:(NSString *)hostName

Declared In

MKNetworkEngine.h

initWithHostName:apiPath:customHeaderFields:

Initializes your network engine with a hostname

- (id)initWithHostName:(NSString *)hostName apiPath:(NSString *)apiPath customHeaderFields:(NSDictionary *)headers

Declared In

MKNetworkEngine.h

initWithHostName:customHeaderFields:

Initializes your network engine with a hostname and custom header fields

- (id)initWithHostName:(NSString *)hostName customHeaderFields:(NSDictionary *)headers

Declared In

MKNetworkEngine.h

initWithHostName:portNumber:apiPath:customHeaderFields:

Initializes your network engine with a hostname, port, path, and headers.

- (id)initWithHostName:(NSString *)hostName portNumber:(int)portNumber apiPath:(NSString *)apiPath customHeaderFields:(NSDictionary *)headers

Declared In

MKNetworkEngine.h

isReachable

Checks current reachable status

- (BOOL)isReachable

Declared In

MKNetworkEngine.h

operationWithPath:

Creates a simple GET Operation with a request URL

- (MKNetworkOperation *)operationWithPath:(NSString *)path

Declared In

MKNetworkEngine.h

operationWithPath:params:

Creates a simple GET Operation with a request URL and parameters

- (MKNetworkOperation *)operationWithPath:(NSString *)path params:(NSDictionary *)body

Declared In

MKNetworkEngine.h

operationWithPath:params:httpMethod:

Creates a simple GET Operation with a request URL, parameters and HTTP Method

- (MKNetworkOperation *)operationWithPath:(NSString *)path params:(NSDictionary *)body httpMethod:(NSString *)method

Declared In

MKNetworkEngine.h

operationWithPath:params:httpMethod:ssl:

Creates a simple GET Operation with a request URL, parameters, HTTP Method and the SSL switch

- (MKNetworkOperation *)operationWithPath:(NSString *)path params:(NSDictionary *)body httpMethod:(NSString *)method ssl:(BOOL)useSSL

Declared In

MKNetworkEngine.h

operationWithURLString:

Creates a simple GET Operation with a request URL

- (MKNetworkOperation *)operationWithURLString:(NSString *)urlString

Declared In

MKNetworkEngine.h

operationWithURLString:params:

Creates a simple GET Operation with a request URL and parameters

- (MKNetworkOperation *)operationWithURLString:(NSString *)urlString params:(NSDictionary *)body

Declared In

MKNetworkEngine.h

operationWithURLString:params:httpMethod:

Creates a simple Operation with a request URL, parameters and HTTP Method

- (MKNetworkOperation *)operationWithURLString:(NSString *)urlString params:(NSDictionary *)body httpMethod:(NSString *)method

Declared In

MKNetworkEngine.h

prepareHeaders:

adds the custom default headers

- (void)prepareHeaders:(MKNetworkOperation *)operation

Declared In

MKNetworkEngine.h

registerOperationSubclass:

Registers an associated operation subclass

- (void)registerOperationSubclass:(Class)aClass

Declared In

MKNetworkEngine.h

useCache

Enable Caching

- (void)useCache

Declared In

MKNetworkEngine.h