TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
Depends on: | |
Mantle | ~> 1.3 |
AFNetworking | ~> 2.0.3 |
ReactiveCocoa | ~> 2.1 |
XMLDictionary | ~> 1.3 |
The University of Michigan has an awesome live bus tracking system for students. This is an Objective-C wrapper around the API.
Fare runs with the help of a couple awesome projects. AFNetworking runs asynchronous network requests faster than Usain Bolt behind chased by a Ferrari. Mantle helps the project turn "abc" into "A" "B" and "C" which sounds pretty dumb at first, but trust me: it's awesome. XMLDictionary converts a long-lost cryptic language once thought to be extinct into something that's actually usable. And lastly, ReactiveCocoa ties everything all together by merging together values throughout the project allowing value and property updates so silky smooth that they would make the founders of I Can't Believe It's Not Butter! jealous.
platform :ios, '7.0'
pod 'Fare', '~> 1.0.2'
Where you want to use Fare, import the header file.
#import "UMNetworkingSession.h"
GET
-fetchArrivalsWithSuccessBlock:errorBlock:
GET
-fetchBusesWithSuccessBlock:errorBlock:
GET
-fetchStopsWithSuccessBlock:errorBlock:
GET
-fetchRoutesWithSuccessBlock:errorBlock:
GET
-fetchAnnouncementsWithSuccessBlock:errorBlock:
GET
-fetchTraceRouteForRouteID:withSuccessBlock:errorBlock:
Property | Name | Purpose |
---|---|---|
NSString |
heading | heading of bus |
NSString |
id | the bus ID |
NSString |
latitude | current latitude of bus |
NSString |
longitude | current longitude of bus |
NSString |
routeID | the route ID that the bus is operating on |
NSString |
routeName | the name of the route that the bus is operating on |
NSString |
busRouteColor | a hex color representing route color |
Property | Name | Purpose |
---|---|---|
NSString |
id | id of the stop |
NSString |
uniqueName | a stop's unique name |
NSString |
humanName | a stop's human name |
NSString |
additionalName | an extra name if a stop needs it |
NSString |
latitude | the latitude that the stop resides on |
NSString |
longitude | the longitude that the stop resides on |
NSString |
heading | the heading that the stop faces |
Property | Name | Purpose |
---|---|---|
NSString |
id | the route's ID |
NSString |
name | the name of the route |
NSString |
color | a hex color representing the route |
NSString |
topOfLoopStopID | ID of the stop that represents the route ending |
BOOL |
isActive | boolean representing if the route is operating |
NSArray |
stops | array of Stop objects that the route frequents |
Property | Name | Purpose |
---|---|---|
NSString |
title | title of the announcement |
NSString |
text | content of the announcement |
NSString |
type | type of announcement |
Property | Name | Purpose |
---|---|---|
NSString |
name | name of the route that is arriving |
NSString |
id | id of the arriving route |
NSString |
topOfLoop | id of stop that represents route ending |
NSString |
busRouteColor | hex color representing the arriving route |
NSArray |
stop | array of ArrivalStop objects that represents stops that the arriving route frequents |
Property | Name | Purpose |
---|---|---|
NSString |
id1 | first id |
NSString |
id2 | second id |
NSString |
name | name of stop |
NSString |
name2 | secondary name of stop |
NSString |
name3 | third name of stop |
NSString |
latitude | latitude that the stop resides on |
NSString |
longitude | longitude that the stop resides on |
NSString |
heading | heading that the stop faces |
NSTimeInterval |
timeOfArrival | seconds until the bus arrives at this stop |
NSTimeInterval |
timeOfArrival2 | seconds until the second bus arrives at this stop |
If I want to log the latitude and longitudes of each bus currently operating, I would import UMNetworkingSession.h
and Bus.h
into my header file.
In my -viewDidLoad
, I would add:
UMNetworkingSession *networkingSession = [[UMNetworkingSession alloc] init];
[networkingSession fetchBusesWithSuccessBlock:^(NSArray *buses) {
for (Bus *bus in buses) {
NSLog(@"lat/lng: %@/%@", bus.latitude, bus.longitude);
}
} errorBlock:^(NSError *error) {
NSLog(@"Error fetching buses: %@", error.localizedDescription);
}];
The MIT License (MIT)
Copyright (c) 2013 Jonah Grant.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.