Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated AppleDoc documentation

  • Loading branch information...
commit 06d77093723184753e18a32ea5da6353d26060ef 1 parent 2dc8476
@Cocoanetics authored
View
96 Core/Source/DTDownload.h
@@ -10,15 +10,53 @@
@class DTDownload;
+/**
+ Methods that a delegate of a download object is being queried with.
+ */
+
@protocol DTDownloadDelegate <NSObject>
@optional
+
+/**
+ Sent by the download object to the delegate to inquire if a download that can be resumed should continue. Return `NO` if the download should start from the beginning.
+
+ @param download A download object.
+ */
- (BOOL)shouldResumeDownload:(DTDownload *)download;
+
+/**
+ Sent by the download object to inform the delegate about its progress.
+
+ @param download A download object.
+ @param downloadedBytes The number of bytes that were downloaded so far.
+ @param totalBytes The number of total bytes to be downloaded.
+ @param speed A rough estimate of the current download speed.
+ */
- (void)download:(DTDownload *)download downloadedBytes:(long long)downloadedBytes ofTotalBytes:(long long)totalBytes withSpeed:(float)speed;
+/**
+ Sent by the download object to the delegate when only a HEAD was requested and the request is done.
+
+ @param download A download object.
+ */
- (void)downloadDidFinishHEAD:(DTDownload *)download;
+
+/**
+ Sent by the download object to the delegate when the download was been aborted due to failure.
+
+ @param download A download object.
+ @param error An error object that contains information about what caused the failure.
+ */
- (void)download:(DTDownload *)download didFailWithError:(NSError *)error;
+
+/**
+ Sent by the download object to the delegate when the download as completed successfully.
+
+ @param download A download object.
+ @param path The file path to the downloaded file
+ */
- (void)download:(DTDownload *)download didFinishWithFile:(NSString *)path;
@end
@@ -26,28 +64,78 @@
/**
- A Class that represents a download of a file from a remote server.
+ A Class that represents a download of a file from a remote server. It also supports only getting a HEAD on the given URL and optionally resume an interrupted download
*/
@interface DTDownload : NSObject
-
-
+/**
+ Returns the URL that is being downloaded by the receiver.
+ */
@property (nonatomic, strong, readonly) NSURL *url;
+/**
+ Returns the entity tag of the downloading file.
+ */
@property (nonatomic, strong, readonly) NSString *downloadEntityTag;
+
+/**
+ Returns the last modified date of the downloading file.
+ */
@property (nonatomic, strong, readonly) NSDate *lastModifiedDate;
-@property (nonatomic, strong, readonly) NSString *downloadEntryIdentifier;
+/**
+ Use to set or retrieve the folder where the downloaded file should be copied to.
+
+ Changing this only has an effect if the download has not yet completed.
+ */
@property (nonatomic, strong) NSString *folderForDownloading;
+/**
+ Use to set or retrieve an object that provides a context for the download.
+ */
@property (nonatomic, strong) id context;
+/**
+ Returns the receiver’s delegate.
+
+ @see delegate
+ */
@property (nonatomic, assign) id <DTDownloadDelegate> delegate;
+/**-------------------------------------------------------------------------------------
+ @name Initializing a Download Object
+ ---------------------------------------------------------------------------------------
+ */
+
+/** Creates a download for a given URL.
+
+ @param url A remote URL
+ @returns An initialized download object
+ */
- (id)initWithURL:(NSURL *)url;
+
+/**-------------------------------------------------------------------------------------
+ @name Starting the Download
+ ---------------------------------------------------------------------------------------
+ */
+
+/**
+ Starts or Resumes a download for a given URL.
+
+ @param shouldResume Specifies if the download should be resumed if possible
+ @returns An initialized download object
+ */
- (void)startWithResume:(BOOL)shouldResume;
+
+/**
+ Starts a HEAD request for the given URL. This retrieves the headers and not the body of the document.
+ */
- (void)startHEAD;
+
+/**
+ Cancels a download in progress
+ */
- (void)cancel;
@end
View
2  Core/Source/DTDownload.m
@@ -48,7 +48,7 @@ @implementation DTDownload
BOOL headOnly;
}
-@synthesize url = _url, internalDownloadFolder, downloadEntityTag, downloadEntryIdentifier, folderForDownloading, lastPaketTimestamp, delegate, lastModifiedDate;
+@synthesize url = _url, internalDownloadFolder, downloadEntityTag, folderForDownloading, lastPaketTimestamp, delegate, lastModifiedDate;
@synthesize context;
#pragma mark Downloading
View
17 Core/Source/UIImage+DTFoundation.h
@@ -52,11 +52,22 @@
/**
Cuts out a tile at the given row and column
+
+ @param column The index of the column
+ @param columns The total number of columns
+ @param row The index of the row
+ @param rows The total number of rows
+ @returns The resulting image
*/
- (UIImage *)tileImageAtColumn:(NSUInteger)column ofColumns:(NSUInteger)columns row:(NSUInteger)row ofRows:(NSUInteger)rows;
/**
Cuts out a tile at the given clip rect relative to the bounds
+
+ @param clipRect The clipping rect to extract
+ @param bounds The bounds to which the clipRect is relative to
+ @param scale The image scale
+ @returns The resulting image
*/
- (UIImage *)tileImageInClipRect:(CGRect)clipRect inBounds:(CGRect)bounds scale:(CGFloat)scale;
@@ -65,6 +76,12 @@
@name Modifying Images
*/
+/**
+ Resizes the receiver to the given size.
+
+ @param newSize The target image size
+ @returns The resulting image
+ */
- (UIImage *)imageScaledToSize:(CGSize)newSize;
@end
Please sign in to comment.
Something went wrong with that request. Please try again.