Apps for the Apple Watch Sensors
-
Upload
happywatch -
Category
Documents
-
view
836 -
download
0
description
Transcript of Apps for the Apple Watch Sensors
Apps for Sensors
WATCH
“Not Sensors” but still cool
Sensors
Accelerometer
Accelerometerlet motionManager: CMMotionManager = CMMotionManager()
if (motionManager.accelerometerAvailable) {
motionManager.startAccelerometerUpdatesToQueue(NSOperationQueue())
{(data, error) in
if(data.acceleration.y < -0.25) {
// tilting the device to the right
Location
locationManager = CLLocationManager() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.requestAlwaysAuthorization() locationManager.startUpdatingLocation()
Camera Controller@IBAction func takePhoto(sender: AnyObject) { if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera){ println("Button capture") var imag = UIImagePickerController() imag.delegate = self imag.sourceType = .Camera; imag.mediaTypes = NSArray(object: kUTTypeImage) imag.allowsEditing = false self.presentViewController(imag, animated: true, completion: nil) } }
Heart Rate
// total guess!
sensorManager = CSSensorManager()
sensorManager.delegate = self
heartMonitor = sensorManager.sensorType(HEARTRATE)
heartMonitor.startCollectingHeartrate()
Smart Devices Health & Activity
PORTING
The only platform that goes everywear.™
Write once.Go everywear.
Simple, brilliant insights.
The only platform that goes everywear.™
@stevecaldwell
www.straphq.com@getstrap
github.com/strap
We’re Hiring!
Additional Slides
November 14, 2013 @antwatkins Anthony Watkins, Senior Director of Developer Relations