Skip to content

Commit

Permalink
调整import为@module模式
Browse files Browse the repository at this point in the history
  • Loading branch information
songwentong committed Aug 31, 2015
1 parent f968819 commit 771f3ce
Show file tree
Hide file tree
Showing 34 changed files with 120 additions and 32 deletions.
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIAlertView+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface UIAlertView (WTRequestCenter)
+(void)showAlertWithMessage:(NSString*)message;
Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIButton+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

#import <UIKit/UIKit.h>
@import UIKit;
@class WTURLRequestOperation;


Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIColor+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface UIColor (WTRequestCenter)

Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIDevice+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// site:https://github.com/swtlovewtt/WTRequestCenter
// install
// git clone https://github.com/swtlovewtt/WTRequestCenter
#import <UIKit/UIKit.h>
@import UIKit;

@interface UIDevice (WTRequestCenter)

Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIImage+WTRequestCenter.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import <UIKit/UIKit.h>
@import UIKit;


@interface UIImage (WTRequestCenter)
Expand Down
4 changes: 2 additions & 2 deletions UIKit+WTRequestCenter/UIImage+WTRequestCenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


#import "UIImage+WTRequestCenter.h"
#import <ImageIO/ImageIO.h>

//#import <ImageIO/ImageIO.h>
@import ImageIO;
#if __has_feature(objc_arc)
#define toCF (__bridge CFTypeRef)
#define fromCF (__bridge id)
Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIImageView+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

#import <UIKit/UIKit.h>
@import UIKit;
#import "WTRequestCenter.h"
/*
方便的图片缓存功能
Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIKit+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
使用注意
使用gif图的时候需要import一个ImageIO.framework
*/
#import <UIKit/UIKit.h>
@import UIKit;

#ifndef WTRequestCenter_UIKit_WTRequestCenter_h
#define WTRequestCenter_UIKit_WTRequestCenter_h
Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIScreen+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface UIScreen (WTRequestCenter)
//屏幕宽度
Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/UIWebView+WTRequestCenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;
#import "WTRequestCenter.h"
@interface UIWebView (WTRequestCenter)

Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/WTCycleScrollView.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by SongWentong on 15/2/3.
// Copyright (c) 2015年 Spritekit. All rights reserved.
//
#import <UIKit/UIKit.h>
@import UIKit;
@class WTCycleScrollView;
//数据源
@protocol WTCycleScrollViewDataSource <NSObject>
Expand Down
3 changes: 2 additions & 1 deletion UIKit+WTRequestCenter/WTDataSaver.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
Mike
*/
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@import UIKit;
@import <#module#>
@interface WTDataSaver : NSObject

#pragma mark - 存数据 Save Data
Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/WTImageViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;
@interface WTImageScrollView : UIScrollView
{

Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/WTNetworkActivityIndicatorManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@import UIKit;


// 网络访问指示器,enable设置为YES后网络访问在状态栏有提示
Expand Down
2 changes: 1 addition & 1 deletion UIKit+WTRequestCenter/WTNumberLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2015年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;


@class WTNumberLabel;
Expand Down
3 changes: 2 additions & 1 deletion UIKit+WTRequestCenter/WTNumberLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
//

#import "WTNumberLabel.h"
#import <CoreGraphics/CoreGraphics.h>
@import CoreGraphics;
//#import <CoreGraphics/CoreGraphics.h>
@interface WTNumberLabel()
{
NSTimer *_myTimer;
Expand Down
2 changes: 1 addition & 1 deletion WTNetWork/WTNetWork.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#import "WTURLRequestSerialization.h"
#import "WTNetworkReachabilityManager.h"
#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)

#import "WTURLSessionManager.h"
#endif

#endif
2 changes: 1 addition & 1 deletion WTNetWork/WTRequestCenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import "WTURLRequestSerialization.h"
#import "WTNetworkReachabilityManager.h"
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
@import UIKit;
#endif
//请求开始的消息
NSString * const WTNetworkingOperationDidStartNotification = @"WT Networking Operation Did Start Notification";
Expand Down
2 changes: 1 addition & 1 deletion WTNetWork/WTURLRequestSerialization.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import "WTURLRequestSerialization.h"
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
@import UIKit;
#endif

//超时时间
Expand Down
19 changes: 19 additions & 0 deletions WTNetWork/WTURLSessionManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// WTURLSessionManager.h
// WTRequestCenter
//
// Created by SongWentong on 8/31/15.
// Copyright (c) 2015 song. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface WTURLSessionManager : NSObject
@property (readonly, nonatomic, strong) NSURLSession *session;


-(instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration;

- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
@end
54 changes: 54 additions & 0 deletions WTNetWork/WTURLSessionManager.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// WTURLSessionManager.m
// WTRequestCenter
//
// Created by SongWentong on 8/31/15.
// Copyright (c) 2015 song. All rights reserved.
//

#import "WTURLSessionManager.h"
@interface WTURLSessionManager()

@property (readwrite, nonatomic, strong) NSURLSession *session;

@end
@implementation WTURLSessionManager

static NSOperationQueue *sessionCreationQueue = nil;
+(NSOperationQueue*)sessionCreationQueue{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sessionCreationQueue = [NSOperationQueue new];
[sessionCreationQueue setSuspended:NO];
});
return sessionCreationQueue;
}


-(instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration {
self = [super init];
if (self) {

}

if (!configuration) {
configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
}
self.session = [NSURLSession sessionWithConfiguration:configuration delegate:nil delegateQueue:sessionCreationQueue];


return self;
}

- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request
completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler
{
__block NSURLSessionDataTask *dataTask = nil;
// [[WTURLSessionManager sessionCreationQueue] addOperationWithBlock:^{
dataTask = [self.session dataTaskWithRequest:request completionHandler:completionHandler];
// }];

return dataTask;
}

@end
6 changes: 6 additions & 0 deletions WTRequestCenter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
27FB3FCC1B93FB1100F5CC7C /* WTURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 27FB3FCB1B93FB1100F5CC7C /* WTURLSessionManager.m */; };
A3B4A7C2199AF60C00A8BAF0 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = A3B4A7C1199AF60C00A8BAF0 /* [email protected] */; };
A3B4A7C9199AF92000A8BAF0 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3B4A7C8199AF92000A8BAF0 /* ImageIO.framework */; };
A3B70F591988BDFA002776F4 /* image.jpg in Resources */ = {isa = PBXBuildFile; fileRef = A3B70F581988BDFA002776F4 /* image.jpg */; };
Expand Down Expand Up @@ -66,6 +67,8 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
27FB3FCA1B93FB1100F5CC7C /* WTURLSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WTURLSessionManager.h; path = WTNetWork/WTURLSessionManager.h; sourceTree = SOURCE_ROOT; };
27FB3FCB1B93FB1100F5CC7C /* WTURLSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WTURLSessionManager.m; path = WTNetWork/WTURLSessionManager.m; sourceTree = SOURCE_ROOT; };
A3B4A7C1199AF60C00A8BAF0 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = "[email protected]"; path = "WTRequestCenter/[email protected]"; sourceTree = "<group>"; };
A3B4A7C8199AF92000A8BAF0 /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; };
A3B70F581988BDFA002776F4 /* image.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = image.jpg; path = WTRequestCenter/image.jpg; sourceTree = "<group>"; };
Expand Down Expand Up @@ -320,6 +323,8 @@
E162A4741A6A167300CBC2C5 /* WTURLRequestSerialization.m */,
E1B954C31B60F2E700F206C5 /* WTNetworkReachabilityManager.h */,
E1B954C41B60F2E700F206C5 /* WTNetworkReachabilityManager.m */,
27FB3FCA1B93FB1100F5CC7C /* WTURLSessionManager.h */,
27FB3FCB1B93FB1100F5CC7C /* WTURLSessionManager.m */,
);
name = WTRequestCenter;
path = WTRequestCenter/WTRequestCenter;
Expand Down Expand Up @@ -440,6 +445,7 @@
E162A49F1A6A168900CBC2C5 /* WTImageViewer.m in Sources */,
E161B2881A8DA37A00A69C09 /* SingleRequestViewController.m in Sources */,
E19F0C2A1A0201460049C1A2 /* RulerView.m in Sources */,
27FB3FCC1B93FB1100F5CC7C /* WTURLSessionManager.m in Sources */,
E181F7761A81138700832D0B /* WTNumberLabel.m in Sources */,
E162A4991A6A168900CBC2C5 /* UIDevice+WTRequestCenter.m in Sources */,
E162A4A01A6A168900CBC2C5 /* WTNetworkActivityIndicatorManager.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/RulerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface RulerView : UIView
{
Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/SingleRequestViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2015年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface SingleRequestViewController : UIViewController

Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/ViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;
@interface ViewController : UIViewController <UITableViewDataSource,UITableViewDelegate,UIViewControllerTransitioningDelegate,UIViewControllerAnimatedTransitioning>
{
UITableView *wtTableView;
Expand Down
9 changes: 8 additions & 1 deletion WTRequestCenter/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ - (void)viewDidLoad




/*
WTURLSessionManager *manager = [[WTURLSessionManager alloc] initWithSessionConfiguration:nil];
NSURLRequest *request = [[WTURLRequestSerialization sharedRequestSerialization] requestWithMethod:@"GET" URLString:@"http://www.baidu.com" parameters:nil error:nil];
[[manager dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSLog(@"finish");
}] resume];
*/

_relerView = [[RulerView alloc] initWithFrame:self.view.bounds];
_relerView.userInteractionEnabled = NO;
[self.view addSubview:_relerView];
Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/WTImageViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface WTImageViewController : UIViewController
{
Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/WTRequestCenter-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
#endif

#ifdef __OBJC__
// #import <UIKit/UIKit.h>
// @import UIKit;
// #import <Foundation/Foundation.h>
#endif
2 changes: 1 addition & 1 deletion WTRequestCenter/WTRequestViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface WTRequestViewController : UIViewController
@property (nonatomic,copy) NSIndexPath *indexPath;
Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/WTWebViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

@interface WTWebViewController : UIViewController

Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenter/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;

#import "AppDelegate.h"

Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenterTests/UIImageViewCacheTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright (c) 2014年 song. All rights reserved.
//

#import <UIKit/UIKit.h>
@import UIKit;
#import <XCTest/XCTest.h>
#import "WTRequestCenter.h"
#import "UIKit+WTRequestCenter.h"
Expand Down
2 changes: 1 addition & 1 deletion WTRequestCenterTests/WTRequestCenterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import <XCTest/XCTest.h>
#import <UIKit/UIKit.h>
@import UIKit;
@interface WTRequestCenterTests : XCTestCase
{
UIApplication *app;
Expand Down

0 comments on commit 771f3ce

Please sign in to comment.