Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change the default initialiser to take a URLRequest

  • Loading branch information...
commit 8c832fcd9ed4b6c312be59662f86e25f09b0e397 1 parent 43c0a9c
@danielctull authored
View
3  DCTConnectionController.xcodeproj/project.pbxproj
@@ -22,6 +22,7 @@
2437B66D15B97B4400750117 /* DCTConnectionController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F6EC68158A2C3000CEDD41 /* DCTConnectionController.m */; };
247CBC941598FD960006A011 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 247CBC921598FD960006A011 /* ViewController.m */; };
247CBC951598FD960006A011 /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 247CBC931598FD960006A011 /* ViewController.xib */; };
+ 248DBAC915D51FE700710CB0 /* libDCTConnectionController.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2437B5DC15B9771F00750117 /* libDCTConnectionController.a */; };
249D6E3C159890F300FE9A23 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F6EC4F158A2BD200CEDD41 /* UIKit.framework */; };
249D6E3D159890F300FE9A23 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 24F6EC3F158A2BD100CEDD41 /* Foundation.framework */; };
249D6E3F159890F300FE9A23 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 249D6E3E159890F300FE9A23 /* CoreGraphics.framework */; };
@@ -122,6 +123,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 248DBAC915D51FE700710CB0 /* libDCTConnectionController.a in Frameworks */,
249D6E3C159890F300FE9A23 /* UIKit.framework in Frameworks */,
249D6E3D159890F300FE9A23 /* Foundation.framework in Frameworks */,
249D6E3F159890F300FE9A23 /* CoreGraphics.framework in Frameworks */,
@@ -727,6 +729,7 @@
2437B5E715B9771F00750117 /* Release */,
);
defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
};
249D6E4E159890F300FE9A23 /* Build configuration list for PBXNativeTarget "iPhone Demo" */ = {
isa = XCConfigurationList;
View
2  DCTConnectionController/DCTConnectionController.h
@@ -107,7 +107,7 @@ extern NSString *const DCTConnectionControllerTypeString[];
@property (nonatomic, assign) DCTConnectionControllerPriority priority;
@property (nonatomic, strong) NSURLRequest *URLRequest;
-- (id)initWithURL:(NSURL *)URL;
+- (id)initWithURLRequest:(NSURLRequest *)URLRequest;
- (void)performBlock:(void(^)())block;
View
7 DCTConnectionController/DCTConnectionController.m
@@ -165,13 +165,10 @@ - (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeInteger:self.priority forKey:NSStringFromSelector(@selector(priority))];
}
-- (id)initWithURL:(NSURL *)URL {
+- (id)initWithURLRequest:(NSURLRequest *)URLRequest {
self = [self init];
if (!self) return nil;
- NSMutableURLRequest *request = [NSMutableURLRequest new];
- [request setURL:URL];
- [request setHTTPMethod:DCTInternalConnectionControllerTypeString[self.type]];
- _URLRequest = request;
+ _URLRequest = [URLRequest copy];
return self;
}
View
3  Mac Demo/AppDelegate.m
@@ -35,7 +35,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
for (NSString *s in urls) {
NSURL *URL = [NSURL URLWithString:s];
- DCTConnectionController *connectionController = [[DCTConnectionController alloc] initWithURL:URL];
+ NSURLRequest *URLRequest = [[NSURLRequest alloc] initWithURL:URL];
+ DCTConnectionController *connectionController = [[DCTConnectionController alloc] initWithURLRequest:URLRequest];
NSString *domain = [self _domainStringFromURL:connectionController.URLRequest.URL];
[connectionController addStatusChangeHandler:^(DCTConnectionControllerStatus status) {
View
3  iPhone Demo/ViewController.m
@@ -43,7 +43,8 @@ - (void)viewDidLoad {
for (NSString *s in urls) {
NSURL *URL = [NSURL URLWithString:s];
- DCTConnectionController *connectionController = [[DCTConnectionController alloc] initWithURL:URL];
+ NSURLRequest *URLRequest = [[NSURLRequest alloc] initWithURL:URL];
+ DCTConnectionController *connectionController = [[DCTConnectionController alloc] initWithURLRequest:URLRequest];
NSString *domain = [self _domainStringFromURL:connectionController.URLRequest.URL];
[connectionController addStatusChangeHandler:^(DCTConnectionControllerStatus status) {
Please sign in to comment.
Something went wrong with that request. Please try again.