• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 12 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extends AFNetworking with the ability to measure connection speed and estimate completion time.

AFURLConnectionByteSpeedMeasure

AFURLConnectionByteSpeedMeasure is a drop in extension for AFNetworking to measure download and upload speed of an AFURLConnectionOperation and estimate completion times.

Usage

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://download.thinkbroadband.com/1GB.zip"]];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
operation.downloadSpeedMeasure.active = YES;

// to avoid a retain cycle one has to pass a weak reference to operation into the progress block.
[operation setDownloadProgressBlock:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
	double speedInBytesPerSecond = operation.downloadSpeedMeasure.speed;
	NSString *humanReadableSpeed = operation.downloadSpeedMeasure.humanReadableSpeed;

	NSTimeInterval remainingTimeInSeconds = [operation.downloadSpeedMeasure remainingTimeOfTotalSize:totalBytesExpectedToRead numberOfCompletedBytes:totalBytesRead];
	NSString *humanReadableRemaingTime = [operation.downloadSpeedMeasure humanReadableRemainingTimeOfTotalSize:totalBytesExpectedToRead numberOfCompletedBytes:totalBytesRead];
}];

Lincense

MIT

More Repositories

1

SLExpandableTableView

SLExpandableTableView is a UITableView subclass that gives you easy access to expandable and collapsable sections by just implementing a few more delegate and dataSource protocols. (iPhone, iPad, iOS)
Objective-C
648
star
2

GHMarkdownParser

A markdown parser for iOS based on discount.
Objective-C
277
star
3

Flow

Gesture based tutorials inspired by Facebook Paper.
Objective-C
268
star
4

SLRESTfulCoreData

Objc naming conventions, autogenerated accessors at runtime, URL substitutions and intelligent attribute mapping
Objective-C
178
star
5

SPLMessageLogger

Intercept and log objc messages.
Objective-C
78
star
6

SLCoreDataStack

CoreData stack managing independent 2 NSManagedObjectContext instances
Objective-C
63
star
7

imp_implementationForwardingToSelector

IMP forwarding to a different selector.
Assembly
54
star
8

ANAdvancedNavigationController

Pretty advanced Navigation Controller for iPad
Objective-C
54
star
9

SPLBokehBackgroundView

Rebuilding iOS 7 dynamic wallpapers.
Objective-C
51
star
10

swift-docker

ubuntu:14.04 with Apple swift
30
star
11

SLUITableViewCellSectionLocation

UITableViewCellSectionLocation made public.
29
star
12

SLScrollViewKeyboardSupport

SLScrollViewKeyboardSupport auto adjusts UIScrollViews contentInset based on the first responder.
Objective-C
25
star
13

SPLRemoteObject

It's just an objc RPC framework for your local network
C
22
star
14

AFHTTPRequestOperationLogger-VolumeControl

Extends AFHTTPRequestOperationLogger with ability to change log level with hardware volume buttons.
19
star
15

GHGlossProgressView

An iOS progress view with a neat gloss gradient.
Objective-C
19
star
16

swift-async

Group async tasks together, swiftly
Swift
16
star
17

AFRESTfulCoreDataBackgroundQueue

AFNetworking based AFHTTPClient conforming to SLRESTfulCoreDataBackgroundQueue
Objective-C
15
star
18

iHubSC

Native iPhone and iPad GitHub client.
Objective-C
15
star
19

SPLWindow

UIWindow subclass with touch highlighting and rage shake.
Objective-C
12
star
20

SPLPing

Lightweight, reusable and race free ping implementation.
Objective-C
12
star
21

GHPieChartProgressView

A progress view that looks like a pie chart (iPhone, iPad, iOS)
Objective-C
11
star
22

GHTableViewAlertView

An iOS UIAlertView subclass with a UITableView that looks like the Systems default one.
Objective-C
10
star
23

SPLManagedObjectContextSnapshot

Snapshots an NSManagedObjectContext and tracks its changes.
Objective-C
8
star
24

SPLMimeEntity

Objective-C binding to mimetic.
Objective-C++
7
star
25

SLRESTfulCoreDataUI

UI counterpart to SLRESTfulCoreData
Objective-C
6
star
26

SPLDrawerViewController

iOS 7 / 8 drawer view controller.
Objective-C
6
star
27

xcode-templates

Set of ARC compatible XCode 4 Templates for iOS.
Objective-C
5
star
28

SPLTableViewBehavior

Lightweight, reusable and composable UITableViewDataSources/Delegates.
Objective-C
5
star
29

SLTableViewContent

Multiple contents for one UITableViewController.
Objective-C
5
star
30

GitHubAPI

GitHubAPI implemented with SLRESTfulCoreData.
Objective-C
5
star
31

GHPullToReleaseTableViewController

Another Pull to release UITableViewController subclass (iPhone, iPad, iOS)
Objective-C
4
star
32

PlaceIt

Simply place your views ... Swiftly
Swift
3
star
33

UIImage-UITabBarStyle

UIImage category to create Images styled like seen in UITabBar
3
star
34

TokTik

iOS private API client for TikTok.
Swift
3
star
35

SPLLinearGradientView

UIView subclass that draws a linear gradient.
Objective-C
3
star
36

CTPerformanceMeasurement

Small library to measure performance by counting time that operations take.
Objective-C
3
star
37

CodeSnippets

Useful set of Xcode 4 Code Snippets
3
star
38

CrissCross2D

A 2D CrissCross Space Game
2
star
39

checked

A dead simple programming language.
Swift
2
star
40

SPLFormViewController

Form ViewControllers made easy.
Objective-C
2
star
41

DQuest

Continuation of the DQuest (http://code.google.com/p/d-quest/) project.
1
star
42

TableViewReuseIdentifier

Swift
1
star
43

testPullRepo

1
star
44

TestRepo

Just testing github api.
1
star
45

try_git

1
star
46

UIAlertController-Convenience

Convenience API for UIAlertController.
Objective-C
1
star
47

mimetic

iOS port of mimetic (http://www.codesink.org/mimetic_mime_library.html)
Shell
1
star