Follower

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

  • 所有者: mamaral/Follower
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

##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.

主要指標

概覽
名稱與所有者mamaral/Follower
主編程語言Objective-C
編程語言Objective-C (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2015-06-14 02:21:17
推送於2015-06-15 21:17:50
最后一次提交2015-06-15 17:17:50
發布數1
最新版本名稱v0.1 (發布於 )
第一版名稱v0.1 (發布於 )
用户参与
星數195
關注者數20
派生數43
提交數7
已啟用問題?
問題數0
打開的問題數0
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?