Skip to content

Commit

Permalink
Merge branch 'release-1.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Nov 6, 2017
2 parents ffc6215 + d1bd72d commit 1445c1f
Show file tree
Hide file tree
Showing 23 changed files with 1,108 additions and 439 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
language: objective-c
osx_image: xcode7

before_install:
# - brew update
Expand Down
18 changes: 18 additions & 0 deletions Core/DTDownload-Umbrella.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// DTDownload-Umbrella.h
// DTDownload
//
// Created by Oliver Drobnik on 12/11/15.
// Copyright © 2015 Drobnik KG. All rights reserved.
//

#ifndef DTDownload_Umbrella_h
#define DTDownload_Umbrella_h

#import "DTDownload.h"
#import "DTDownloadCache.h"
#import "DTCachedFile.h"
#import "DTDownloadQueue.h"
#import "DTDownloadItem.h"

#endif /* DTDownload_Umbrella_h */
6 changes: 6 additions & 0 deletions Core/DTDownload.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module DTDownload {
umbrella header "DTDownload-Umbrella.h"

export *
module * { export * }
}
26 changes: 26 additions & 0 deletions Core/Framework-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
25 changes: 19 additions & 6 deletions Core/Source/Cache/DTDownloadCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,30 @@

#import "DTDownload.h"

extern NSString *DTDownloadCacheDidCacheFileNotification;
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#endif

extern NSString *DTDownloadCacheDidCacheFileNotification;

enum {
// Error code used when a download was cancelled
typedef NS_ENUM(NSUInteger, DTDownloadCacheOption)
{
DTDownloadCacheOptionNeverLoad = 0,
DTDownloadCacheOptionLoadIfNotCached,
DTDownloadCacheOptionReturnCacheAndLoadAlways,
DTDownloadCacheOptionReturnCacheAndLoadIfChanged,
DTDownloadCacheOptionReturnCacheAndLoadIfChanged
};
typedef NSUInteger DTDownloadCacheOption;

enum {

typedef NS_ENUM(NSUInteger, DTDownloadCachePriority)
{
DTDownloadCachePriorityVeryHigh = 0,
DTDownloadCachePriorityHigh,
DTDownloadCachePriorityNormal,
DTDownloadCachePriorityLow,
DTDownloadCachePriorityVeryLow
};
typedef NSUInteger DTDownloadCachePriority;


// when download succeedes or fails the blocks are called, passing URL. If there was an error then data/image is nil and the NSError holds the reason
Expand Down Expand Up @@ -93,6 +98,14 @@ typedef void (^DTDownloadCacheImageCompletionBlock)(NSURL *URL, UIImage *image,
*/
- (NSData *)cachedDataForURL:(NSURL *)URL option:(DTDownloadCacheOption)option priority:(DTDownloadCachePriority)priority completion:(DTDownloadCacheDataCompletionBlock)completion;

/**
Cancels download from list of upcoming downloads (If URL was found)
@param URL The URL of the download to be cancelled
*/
- (void)cancelDownloadForURL:(NSURL *)URL;


/**-------------------------------------------------------------------------------------
@name Retrieving Information about the Cache
---------------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 1445c1f

Please sign in to comment.