Skip to content

Commit

Permalink
Preparing 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultcha committed Feb 28, 2014
1 parent b5913a2 commit f9724a9
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 36 deletions.
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ profile

####
# Xcode temporary files that should never be committed
#
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...

*~.nib
Expand Down Expand Up @@ -124,7 +124,7 @@ xcuserdata

####
# Cocoapods: cocoapods.org
#
#
# Ignoring these files means that whoever uses the code will first have to run:
# pod install
# in the App.xcodeproj directory.
Expand All @@ -137,7 +137,9 @@ Podfile.lock
# UNKNOWN: recommended by others, but I can't discover what these files are
#
# ...none. Everything is now explained.
SampleProject.xcodeproj/project.xcworkspace/xcshareddata/SampleProject.xccheckout

SampleProject.xcodeproj/project.xcworkspace/xcshareddata/SampleProject.xccheckout
###
# CUSTOM
# Related to TCBlobDownload

docset-installed.txt
20 changes: 16 additions & 4 deletions Example/TCBlobDownloadExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
21D06E11181847F400CAADCD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 21D06E06181847F400CAADCD /* main.m */; };
21D06E13181847F400CAADCD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 21D06E0A181847F400CAADCD /* ViewController.m */; };
21D06E14181847F400CAADCD /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 21D06E0B181847F400CAADCD /* ViewController.xib */; };
C33448CD18C00E500050C1ED /* libTCBlobDownload.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C33448CA18C000850050C1ED /* libTCBlobDownload.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -62,6 +63,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C33448CD18C00E500050C1ED /* libTCBlobDownload.a in Frameworks */,
217762391730025C001956C7 /* UIKit.framework in Frameworks */,
2177623B1730025C001956C7 /* Foundation.framework in Frameworks */,
2177623D1730025C001956C7 /* CoreGraphics.framework in Frameworks */,
Expand Down Expand Up @@ -282,7 +284,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -307,7 +309,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.1;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -322,8 +324,13 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "TCBlobDownloadExample/TCBlobDownloadExample-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(PROJECT_DIR)/../TCBlobDownload/**",
);
INFOPLIST_FILE = "$(SRCROOT)/TCBlobDownloadExample/TCBlobDownloadExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
LIBRARY_SEARCH_PATHS = "";
PRODUCT_NAME = TCBlobDownloadExample;
WRAPPER_EXTENSION = app;
Expand All @@ -337,8 +344,13 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "TCBlobDownloadExample/TCBlobDownloadExample-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(PROJECT_DIR)/../TCBlobDownload/**",
);
INFOPLIST_FILE = "$(SRCROOT)/TCBlobDownloadExample/TCBlobDownloadExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
LIBRARY_SEARCH_PATHS = "";
PRODUCT_NAME = TCBlobDownloadExample;
WRAPPER_EXTENSION = app;
Expand Down
38 changes: 31 additions & 7 deletions Example/TCBlobDownloadExample/ViewController.xib
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<objects>
Expand All @@ -19,33 +19,44 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="File URL to download" minimumFontSize="17" id="3">
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="URL to download" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="3">
<rect key="frame" x="20" y="77" width="280" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="280" id="VMX-Qb-awx"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="13">
<rect key="frame" x="24" y="115" width="128" height="44"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="13">
<rect key="frame" x="20" y="115" width="128" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<constraints>
<constraint firstAttribute="width" constant="128" id="0dH-dd-6MH"/>
<constraint firstAttribute="height" constant="44" id="s6H-L9-8ri"/>
</constraints>
<state key="normal" title="Add download">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="download:" destination="-1" eventType="touchUpInside" id="26"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="17">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="17">
<rect key="frame" x="185" y="115" width="95" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="gxb-5h-h5z"/>
<constraint firstAttribute="width" constant="95" id="u9c-JJ-X1e"/>
</constraints>
<state key="normal" title="Cancel all">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="cancelAll:" destination="-1" eventType="touchUpInside" id="28"/>
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="dG2-Ua-phD">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dG2-Ua-phD">
<rect key="frame" x="139" y="178" width="42" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
Expand All @@ -54,6 +65,19 @@
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="17" firstAttribute="height" secondItem="13" secondAttribute="height" id="3jH-Jl-w6d"/>
<constraint firstItem="dG2-Ua-phD" firstAttribute="centerX" secondItem="1" secondAttribute="centerX" id="4hL-5t-CGO"/>
<constraint firstItem="dG2-Ua-phD" firstAttribute="centerX" secondItem="3" secondAttribute="centerX" id="7JE-nS-jeN"/>
<constraint firstItem="dG2-Ua-phD" firstAttribute="top" secondItem="3" secondAttribute="bottom" constant="71" id="AEy-pV-XAl"/>
<constraint firstItem="3" firstAttribute="top" secondItem="1" secondAttribute="top" constant="77" id="FvB-de-oZ4"/>
<constraint firstItem="13" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="20" id="Nb4-x2-nmJ"/>
<constraint firstItem="17" firstAttribute="top" secondItem="3" secondAttribute="bottom" constant="8" id="T8E-1l-xrg"/>
<constraint firstAttribute="centerX" secondItem="3" secondAttribute="centerX" id="VE0-5X-ZXe"/>
<constraint firstItem="13" firstAttribute="top" secondItem="3" secondAttribute="bottom" constant="8" id="hrc-iq-ahL"/>
<constraint firstItem="17" firstAttribute="width" secondItem="13" secondAttribute="width" constant="-33" id="jgF-Fs-z2e"/>
<constraint firstAttribute="trailing" secondItem="17" secondAttribute="trailing" constant="40" id="jtS-gn-9L4"/>
</constraints>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</view>
Expand Down
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@ Requires **iOS 5.0 or later** and ARC.
- **[Documentation](#documentation)**
- **[Usage](#usage)**
- **[Change Log](#change-log)**
- **[Licence](#licence)**

======

## Features
1. Download files in background threads.
2. Use blocks or delegate!
3. Pause and resume a download.
4. Set maximum number of concurrent downloads.
5. Custom download path and auto path creation.
1. Download files in background threads
2. Blocks or delegate style
3. Pause and resume a download
4. Set maximum number of concurrent downloads
5. Custom download path and auto path creation
6. Download speed and remaining time
7. `[download cancelDownloadAndRemoveFile:BOOL]`
8. Download dependencies.
7. Download cancellation
8. Download dependencies

## Documentation

Browse the documentation on [Cocoadocs](http://cocoadocs.org/docsets/TCBlobDownload/1.4.0/) or add it directly to Xcode by downloading the docset and placing it into `~/Library/Developer/Shared/Documentation/DocSets/`.
Browse the documentation on [Cocoadocs](http://cocoadocs.org/docsets/TCBlobDownload/1.5.0/) or add it directly to Xcode by [downloading](https://github.com/thibaultCha/TCBlobDownload/blob/remaining-time/TCBlobDownload/Docs/TCBlobDownloadDocset.zip?raw=true) the docset and placing it into `~/Library/Developer/Shared/Documentation/DocSets/` or open it directly using [Dash](http://kapeli.com/dash).

## Usage

Expand Down Expand Up @@ -72,24 +71,24 @@ TCBlobDownload *downloader = [sharedManager startDownloadWithURL:@"http://give.m
// wow moving progress bar!
}
error:^(NSError *error){
// this not cool
// this not cool
}
complete:^(BOOL downloadFinished, NSString *pathToFile) {
// okay
// okay
}];
```
If you set a customPath:
If you set a custom path:
```objective-c
NSString *customPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"My/Custom/Path/"];
TCBlobDownload *downloader = [sharedManager startDownloadWithURL:@"http://give.me/abigfile.avi"
customPath:customPath // important
andDelegate:nil];
customPath:customPath // important
andDelegate:nil];
```

This will **create** the given path if needed and download the file in the `Path/` directory. **Remember that you should follow the [iOS Data Storage Guidelines](https://developer.apple.com/icloud/documentation/data-storage/)**.
This will **create** the given path if needed and download the file in the `Path/` directory. Please note that during the download process you have no control over the file name as explained with reasons why in the documentation. **Remember that you should follow the [iOS Data Storage Guidelines](https://developer.apple.com/icloud/documentation/data-storage/)**.

### 2. Delegate
You can either set a delegate which can implement those optional methods if delegates have your preference over blocks:
Expand Down Expand Up @@ -121,14 +120,16 @@ You can either set a delegate which can implement those optional methods if dele
### 3. Other things you should know
**Cool thing 1:** If a download has been stopped and the local file has not been deleted, when you will restart the download to the same local path, the download will start where it has stopped using the HTTP `Range=bytes` header.

**Cool thing 2:** You can also set dependencies in your downloads using the `addDependentDownload:` method from TCBlobDownload. (See [NSOperation Class Reference](http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSOperation_class/Reference/Reference.html) and the `addDependency:` method in particular.)
**Cool thing 2:** You can also set dependencies in your downloads using the `addDependentDownload:` method from `TCBlobDownload`.

See documentation for more details.

## Change log

### v1.5.0
### v1.5.0 (2/28/2014)
* Improved documentation and created a docset
* Added a `speedRate` and `remainingTime` (in seconds) property on TCBlobDownload thanks to [#16](https://github.com/thibaultCha/TCBlobDownload/issues/16)
* Updated TCBlobDownload properties to `readonly`
* Added a `speedRate` and `remainingTime` (in seconds) property on `TCBlobDownload` thanks to [#16](https://github.com/thibaultCha/TCBlobDownload/issues/16)
* Updated `TCBlobDownload` properties to `readonly`
* Renamed `sharedDownloadManager` to `sharedInstance`

### v1.4.0 (11/19/2013)
Expand Down Expand Up @@ -163,3 +164,4 @@ You can either set a delegate which can implement those optional methods if dele
If you have any idea or request, please suggest it! :smiley:

* Multi segmented downloads
* Dash XML feed for documentation versioning
2 changes: 1 addition & 1 deletion TCBlobDownload.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "TCBlobDownload"
s.version = "1.4.0"
s.version = "1.5.0"
s.summary = "Download big files competitively in Cocoa"
s.homepage = "https://github.com/thibaultCha/TCBlobDownload"
s.license = 'MIT'
Expand Down
Binary file modified TCBlobDownload/Docs/TCBlobDownloadDocset.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion TCBlobDownload/TCBlobDownload.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#appledoc Xcode script\n# Start constants\ncompany=\"thibaultCha\";\ncompanyID=\"com.thibaultcha\";\ncompanyURL=\"http://thibaultcha.me\";\ntarget=\"iphoneos\";\n#target=\"macosx\";\noutputPath=\"${PROJECT_DIR}/Docs\";\n# End constants\n/usr/local/bin/appledoc \\\n--project-name \"${PROJECT_NAME}\" \\\n--project-company \"${company}\" \\\n--company-id \"${companyID}\" \\\n--ignore \".m\" \\\n--docset-feed-url \"${companyURL}/${company}/%DOCSETATOMFILENAME\" \\\n--docset-package-url \"${companyURL}/${company}/%DOCSETPACKAGEFILENAME\" \\\n--docset-fallback-url \"${companyURL}/${company}\" \\\n--docset-platform-family \"${target}\" \\\n--keep-intermediate-files \\\n--keep-undocumented-objects \\\n--keep-undocumented-members \\\n--no-warn-missing-arg \\\n--no-warn-undocumented-object \\\n--no-repeat-first-par \\\n--no-warn-invalid-crossref \\\n--exit-threshold 2 \\\n--output \"${outputPath}\" \\\n\"${PROJECT_DIR}\"\n\nmv \"${outputPath}\"/docset \"${outputPath}\"/TCBlobDownload.docset;\nzip -9 \"${outputPath}\"/TCBlobDownloadDocset.zip \"${outputPath}\"/TCBlobDownload.docset;\nrm -rf \"${outputPath}\"/TCBlobDownload.docset;";
shellScript = "#appledoc Xcode script\n# Start constants\ncompany=\"thibaultCha\";\ncompanyID=\"com.thibaultcha\";\ncompanyURL=\"http://thibaultcha.me\";\ntarget=\"iphoneos\";\n#target=\"macosx\";\noutputPath=\"${PROJECT_DIR}/Docs\";\n# End constants\n/usr/local/bin/appledoc \\\n--project-name \"${PROJECT_NAME}\" \\\n--project-company \"${company}\" \\\n--company-id \"${companyID}\" \\\n--ignore \".m\" \\\n--docset-feed-url \"${companyURL}/${company}/%DOCSETATOMFILENAME\" \\\n--docset-package-url \"${companyURL}/${company}/%DOCSETPACKAGEFILENAME\" \\\n--docset-fallback-url \"${companyURL}/${company}\" \\\n--docset-platform-family \"${target}\" \\\n--keep-intermediate-files \\\n--keep-undocumented-objects \\\n--keep-undocumented-members \\\n--no-warn-missing-arg \\\n--no-warn-undocumented-object \\\n--no-repeat-first-par \\\n--no-warn-invalid-crossref \\\n--exit-threshold 2 \\\n--output \"${outputPath}\" \\\n\"${PROJECT_DIR}\"\n\nmv \"${outputPath}\"/docset \"${outputPath}\"/TCBlobDownload.docset;\nzip -9 \"${outputPath}\"/TCBlobDownloadDocset.zip \"${outputPath}\"/TCBlobDownload.docset -x .DS_STORE;\nrm -rf \"${outputPath}\"/TCBlobDownload.docset;";
};
/* End PBXShellScriptBuildPhase section */

Expand Down

0 comments on commit f9724a9

Please sign in to comment.