ASTransitMonitor 0.1.0

ASTransitMonitor 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by ruddfawcett.



  • By
  • Rudd Fawcett

Podfile, Full AmbientStatus

platform :ios, '7.0'
pod "AmbientStatus", "~> 0.1.0"

Podfile, Just ASTransitMonitor:

platform :ios, '7.0'
pod "AmbientStatus/ASTransitMonitor"

Usage

First, add the <ASTransitMonitorDelegate> to whichever file you'd like to use it in.

After you have done so, you have to startMonitoring the user's transit:

ASTransitMonitor *transitMonitor = [ASTransitMonitor sharedInstance]; // create new instance
transitMonitor.delegate = self; // assign the delegate to self

[transitMonitor startMonitoring]; // start monitoring the user's transit

After you have created a new sharedInstance of ASTransitMonitor, and have set the delegate, you can implement the following optional delegates if you desire:

- (void)transitMonitor:(ASTransitMonitor *)transitMonitor didChangeTransitState:(ASTransitState)transitState {
    // Do something if the user starts driving here (or has changed transit)
}
- (void)transitMonitor:(ASTransitMonitor *)transitMonitor didChangeSpeed:(CGFloat)newSpeed oldSpeed:(CGFloat)oldSpeed{
    // Do something if the user has sped up here
}
- (void)transitMonitor:(ASTransitMonitor *)transitMonitor didAccelerationChange:(CMAcceleration)acceleration{
    // Do something if the user started shaking the device here
}

For more help, see the documentation.

Credits

ASTransitMonitor takes much of the code (though not verbatim) from SOMotionDetector with permission, which was developed by Artur Mkrtchyan (arturdev) for SocialObjects Software.

The rest of the project was developed by Rudd Fawcett. You can find all of his open source projects on GitHub.

Questions?

Open an issue. I'll try get back to you within 24 hours.

License

AmbientStatus and ASTransitMonitor are available under the MIT license. See the LICENSE file for more info.