Move the SQRLDownload initialiser into a class extension

Document the `SQRLDownload` class.
This commit is contained in:
Keith Duncan
2014-01-21 11:23:58 -08:00
parent 40cf893899
commit 8a3bb3d896
5 changed files with 33 additions and 8 deletions
+4
View File
@@ -10,6 +10,7 @@
5316AF7A188EFC1800C070DF /* RACSignal+SQRLFileManagerExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5316AF78188EFC1800C070DF /* RACSignal+SQRLFileManagerExtensions.h */; };
5316AF7B188EFC1800C070DF /* RACSignal+SQRLFileManagerExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5316AF79188EFC1800C070DF /* RACSignal+SQRLFileManagerExtensions.m */; };
5316AF95188EFFA100C070DF /* RACSignal+SQRLFileManagerExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5316AF79188EFC1800C070DF /* RACSignal+SQRLFileManagerExtensions.m */; };
5316AFA8188F002100C070DF /* SQRLDownload+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5316AFA6188F002100C070DF /* SQRLDownload+Private.h */; };
533076EB17EB688300BDCCE0 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D097B9BC17BB4777006C3FEB /* IOKit.framework */; };
53390936184F6219009FA41F /* NSHTTPURLResponse+SQRLExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 53390934184F6219009FA41F /* NSHTTPURLResponse+SQRLExtensions.h */; };
53390937184F6219009FA41F /* NSHTTPURLResponse+SQRLExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 53390935184F6219009FA41F /* NSHTTPURLResponse+SQRLExtensions.m */; };
@@ -431,6 +432,7 @@
/* Begin PBXFileReference section */
5316AF78188EFC1800C070DF /* RACSignal+SQRLFileManagerExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RACSignal+SQRLFileManagerExtensions.h"; sourceTree = "<group>"; };
5316AF79188EFC1800C070DF /* RACSignal+SQRLFileManagerExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "RACSignal+SQRLFileManagerExtensions.m"; sourceTree = "<group>"; };
5316AFA6188F002100C070DF /* SQRLDownload+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SQRLDownload+Private.h"; sourceTree = "<group>"; };
53390934184F6219009FA41F /* NSHTTPURLResponse+SQRLExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSHTTPURLResponse+SQRLExtensions.h"; sourceTree = "<group>"; };
53390935184F6219009FA41F /* NSHTTPURLResponse+SQRLExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSHTTPURLResponse+SQRLExtensions.m"; sourceTree = "<group>"; };
53390949184F6322009FA41F /* NSHTTPURLResponseExtensionsSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSHTTPURLResponseExtensionsSpec.m; sourceTree = "<group>"; };
@@ -681,6 +683,7 @@
53C3186A1816C38A0074B481 /* SQRLDownloadManager.m */,
536CD4E0183E5D7F000C0FD1 /* SQRLDownload.h */,
536CD4E1183E5D7F000C0FD1 /* SQRLDownload.m */,
5316AFA6188F002100C070DF /* SQRLDownload+Private.h */,
53C3186D1816C38A0074B481 /* SQRLResumableDownload.h */,
53C3186E1816C38A0074B481 /* SQRLResumableDownload.m */,
53C3186B1816C38A0074B481 /* SQRLURLConnection.h */,
@@ -1089,6 +1092,7 @@
D0964B3C17F2E20B00D88BF7 /* NSBundle+SQRLVersionExtensions.h in Headers */,
D0C22C4C179CC15100158214 /* SQRLUpdater.h in Headers */,
D0C22C52179CC23900158214 /* Squirrel.h in Headers */,
5316AFA8188F002100C070DF /* SQRLDownload+Private.h in Headers */,
53390936184F6219009FA41F /* NSHTTPURLResponse+SQRLExtensions.h in Headers */,
D0964B3817F2E01500D88BF7 /* SQRLDownloadedUpdate.h in Headers */,
53AACF4B17E9CA0500B41027 /* SQRLUpdate.h in Headers */,
+21
View File
@@ -0,0 +1,21 @@
//
// SQRLDownload+Private.h
// Squirrel
//
// Created by Keith Duncan on 21/01/2014.
// Copyright (c) 2014 GitHub. All rights reserved.
//
#import "SQRLDownload.h"
@interface SQRLDownload ()
// Designated initialiser.
//
// request - Must not be nil. The request this download is for.
// fileURL - Must not be nil. The file location to save received data to.
//
// Returns an initialised download suitable for saving response data.
- (instancetype)initWithRequest:(NSURLRequest *)request fileURL:(NSURL *)fileURL;
@end
+5 -8
View File
@@ -10,16 +10,13 @@
@class RACSignal;
// A download is a file which holds the response body for a request and can be
// resumed by a subsequent request if the initial transfer is interrupted.
//
// Don't create a download directly, instead retrieve one from
// `SQRLDownloadManager`.
@interface SQRLDownload : MTLModel
// Designated initialiser.
//
// request - Must not be nil. The request this download is for.
// fileURL - Must not be nil. The file location to save received data to.
//
// Returns an initialised download suitable for saving response data.
- (instancetype)initWithRequest:(NSURLRequest *)request fileURL:(NSURL *)fileURL;
// The `request` the receiver was initialised with.
@property (readonly, copy, nonatomic) NSURLRequest *request;
+1
View File
@@ -7,6 +7,7 @@
//
#import "SQRLDownload.h"
#import "SQRLDownload+Private.h"
#import <ReactiveCocoa/ReactiveCocoa.h>
+2
View File
@@ -12,6 +12,8 @@
#import <CommonCrypto/CommonCrypto.h>
#import "SQRLDirectoryManager.h"
#import "SQRLDownload.h"
#import "SQRLDownload+Private.h"
#import "SQRLResumableDownload.h"
@interface SQRLDownloadManager ()