|
//
// Remote.h
// codeChallengeDemo
//
// Created by Scar on 14-8-21.
// Copyright (c) 2014年 scar1900. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SCGIFImageView.h"
#import "ASINetworkQueue.h"
@protocol RemoteDelegate<NSObject>
@optional
- (void) startWaitCursor:(int)actionTag;
- (void) stopWaitCursor:(int)actionTag;
- (void) remoteResponsSuccess:(int)actionTag withResponsData:(id)responsData;
- (void) remoteResponsFailed:(int)actionTag withMessage:(NSString*)message resultCode:(NSString*)code;
@end
@interface Remote : NSObject <NSURLSessionDelegate,NSURLSessionTaskDelegate>{
}
+ (Remote *)instance;
+ (BOOL) IsEnable3G;
+ (BOOL) IsEnableWIFI;
+ (BOOL)IsEableNetwork;
+ (void)resetRemoteQueue; //初始化下载序列
+ (void)pauseQueue;
+ (NSURLSession *)session; //创建NSURLSession
+ (void)pauseUrlSessionURLDownload; //暂停urlsession下载
+ (BOOL)clearPartialDataCache;//清除断点续传缓存
- (BOOL) connectedToNetwork;
-(BOOL) copyTempFileAtURL:(NSURL *)location toDestination:(NSURL *)destination;
@property(nonatomic, strong)SCGIFImageView *waitCursor;
/**
* asi方式下载队列
*/
@property(nonatomic, strong)ASINetworkQueue *remoteQueue;
/**
* URlSession下载方式信息存放队列
*/
@property(nonatomic, strong)NSMutableArray *sessionTaskList;
@property(nonatomic, strong)NSMutableDictionary *xmlDic;
@property(nonatomic, strong)NSString *lastXMLStr;
@property (copy) void (^downloadFinishHanlder)(BOOL success,NSString *message,id responseData);
@property (copy) void (^xmlFinishHandler)(BOOL success,id responseData);
@end
|