• Stars
    star
    194
  • Rank 193,848 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 9 years ago

Reviews

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

Repository Details

Track trip distance, speed, altitude, and duration like a boss.

##Follower beta

Track trip distance, speed, altitude, and duration like a boss.

1

Getting started

  • Add pod 'Follower' to your podfile, and run pod install.
  • Ensure your app is set up for iOS 8 location services, i.e. add your NSLocationWhenInUseUsageDescription to your info.plist.

How easy is it to use?

Perhaps you're a fitness app, and you want to track the route information for a user on their daily mountain ride...

// Create your follower, and tell it to start route tracking.
self.follower = [Follower new];
[self.follower beginRouteTracking];
.
.
// Maybe they want to pause their workout so they can stop for a drink...
[self.follower pauseRouteTracking]
.
.
// Ready to get back to it!
[self.follower resumeRouteTracking]
.
.
// Some time later when they're done...
[self.follower endRouteTracking];

That was easy... Now what?

Map Polyline / Region

// Add their route to a MKMapView and center it properly.
[self.mapView addOverlay:self.follower.routePolyline];
[self.mapView setRegion:self.follower.routeRegion animated:YES];

Time

// Total time spent tracking route - not including time paused.
[self.follower routeDurationString]; // "02:30:00"
[self.follower routeDurationWithUnit:TimeUnitSeconds]; // 9000.0
[self.follower routeDurationWithUnit:TimeUnitMinutes]; // 150.0
[self.follower routeDurationWithUnit:TimeUnitHours]; // 2.5

Speed

// Get their averge speed...
[self.follower averageSpeedWithUnit:SpeedUnitMetersPerSecond]; // 26.8224...
[self.follower averageSpeedWithUnit:SpeedUnitKilometersPerHour]; // 96.560...
[self.follower averageSpeedWithUnit:SpeedUnitMilesPerHour]; // 60.0

// Get their top speed...
[self.follower topSpeedWithUnit:...];

Distance

// Get the total distance traveled...
[self.follower totalDistanceWithUnit:DistanceUnitMeters]; // 1000.0
[self.follower totalDistanceWithUnit:DistanceUnitKilometers]; // 1.0
[self.follower totalDistanceWithUnit:DistanceUnitFeet]; // 3280.8399...
[self.follower totalDistanceWithUnit:DistanceUnitMiles]; // .6213...

Altitude

// Get their average, minimum, and maximum altitudes...
[self.follower averageAltitudeWithUnit:...];
[self.follower minimumAltitudeWithUnit:...];
[self.follower maximumAltitudeWithUnit:...];

Realtime Information

Implement the following (optional) FollowerDelegate method, and set yourself as the delegate for your Follower to get updates when we do, rather than waiting for the trip to be done. NOTE: Region and polyline information is only available after route tracking has been ended.

- (void)followerDidUpdate:(Follower *)follower {
	// Get all of the same above information here and do whatever you want with it!
}

License

The source is made available under the MIT license.

More Repositories

1

Onboard

An iOS framework to easily create a beautiful and engaging onboarding experience with only a few lines of code.
Objective-C
6,469
star
2

Neon

A powerful Swift programmatic UI layout framework.
Swift
4,566
star
3

Facade

Programmatic view layout for the rest of us.
Objective-C
689
star
4

Organic

The intuitive UITableViewController.
Objective-C
644
star
5

MAThemeKit

Create an iOS app color theme using a single line of code.
Objective-C
552
star
6

MAFormViewController

Quick and easy iOS forms.
Objective-C
289
star
7

xkcd-Open-Source

A free and open source xkcd comic reader for iOS.
Objective-C
251
star
8

Wethr

Wethr provides developers the ability to add location-based current weather conditions to their views as simply as adding any UIView.
Objective-C
170
star
9

Evolve

An Evolution Simulation Engine written in Objective-C.
Objective-C
73
star
10

MALoggingViewController

MALoggingViewController is a real-time pseudo-console you can embed in your application, perfect for testing and debugging in the real world. Whether you are determining the reliability of network traffic while driving through areas with poor service, testing push notifications on ad-hoc builds while not connected to Xcode, or working out those pesky Core Location bugs, there's no need to carry around half of your development environment with you. No more driving around town with the Xcode console open, or having to handle logging to files and emailing them later to figure out what the heck happened - you can see all the data on your device, anywhere, in real time.
Objective-C
53
star
11

MAPageViewController

MAPageViewController is a simple wrapper around the most common boiler-plate UIPageViewController setup.
Swift
51
star
12

MAActionCell

Objective-C
34
star
13

MATextFieldCell

MATextFieldCell is a drop-in subclass of UITableViewCell, written in Swift, used for drastically streamlining UITableView-based form creation.
Swift
22
star
14

Essentials

A curated list of things I wish I knew about Objective-C, Xcode, and Cocoa Touch when I started programming iOS apps.
Objective-C
14
star
15

MADial

MADial and MATimerDial are UIViews that can quickly and easily be created to add slick circular sliders or minute/second timers to your views.
Objective-C
9
star
16

MontyHall

A swift implementation of the famous Monty Hall problem, attempting to explain the counter-intuitive nature of the puzzle.
Swift
4
star
17

Swift-State-Machine

A swift implementation of the state machine design pattern - with a demo implementation.
Swift
1
star