Upgrade to Pro — share decks privately, control downloads, hide ads and more …

watchOS3の新機能 / watchos3

watchOS3の新機能 / watchos3

Katsuya Kato

December 08, 2016
Tweet

More Decks by Katsuya Kato

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • ໊લ • Ճ౻উ໵ • ݴޠ • Swift/Objective-C/Java •

    ૊ࠐ։ൃ΋΍͍ͬͯͨͷͰCͱ͔Ξηϯϒϥͱ͔ Verilogʢϋʔυ΢ΣΞهड़ݴޠʣͱ͔΋ᅂΉ
  2. WKCrownSequencer / WKCrownDelegate crownSequencer.delegate = self crownSequencer.focus() • WKInterfaceControllerͷϓϩύςΟʹcrownSequencer͕͋Δ ͷͰdelegateΛηοτɻfucusϝιουͰσʔλऔಘ։࢝

    extension InterfaceController: WKCrownDelegate { public func crownDidRotate(_ crownSequencer: WKCrownSequencer?, rotationalDelta: Double) { print("Delta:¥(rotationalDelta)") if let crownSequencer = crownSequencer { print("PerSecond:¥(crownSequencer.rotationsPerSecond)") } } } • ճసͤͨ͞Βdelegateϝιου͕ݺ͹ΕΔ
  3. WKTapGestureRecognizer/ WKLongPressGestureRecognizer @IBAction func handleTapGesture(gestureRecognizer : WKTapGestureRecognizer) { print("x:(¥(gestureRecognizer.locationInObject().x)") print("y:(¥(gestureRecognizer.locationInObject().y)")

    } @IBAction func handleLongPressGesture(gestureRecognizer : WKLongPressGestureRecognizer) { print("x:(¥(gestureRecognizer.locationInObject().x)") print("y:(¥(gestureRecognizer.locationInObject().y)") }
  4. WKSwipeGestureRecognizer @IBAction func handleSwipeGesture(gestureRecognizer : WKSwipeGestureRecognizer) { switch gestureRecognizer.direction {

    case WKSwipeGestureRecognizerDirection.right: label.setText("Swipe Right") case WKSwipeGestureRecognizerDirection.left: label.setText("Swipe Left") case WKSwipeGestureRecognizerDirection.down: label.setText("Swipe Down") case WKSwipeGestureRecognizerDirection.up: label.setText("Swipe Up") default: break } }
  5. CMDeviceMotion let handler: CMDeviceMotionHandler = {(motion: CMDeviceMotion?, error: Error?) ->

    Void in if let motion = motion { // Ճ଎౓ηϯα print(motion.gravity.x) print(motion.gravity.y) // δϟΠϩείʔϓ print(motion.rotationRate.x) print(motion.rotationRate.y) // ࢟੎ print(motion.attitude.roll) print(motion.attitude.yaw) print(motion.attitude.pitch) } } • ·ͣ͸ϋϯυϥΛ༻ҙ
  6. CMDeviceMotion let motionManager = CMMotionManager() if motionManager.isDeviceMotionAvailable { motionManager.startDeviceMotionUpdates( to:

    OperationQueue.current!, withHandler: handler) } • CMMotionManagerͷstartDeviceMotionUpdates ϝιουʹϋϯυϥΛࢦఆͯ͠ܭଌ։࢝
  7. όοΫάϥ΢ϯυॲཧ • Background App Refresh • Background Snapshot Refresh •

    Կ෼ޙʹ࣮ߦ͢Δ͔࣌ؒΛࢦఆͯ͠όοΫάϥ΢ϯ υͰॲཧ/εφοϓγϣοτͷߋ৽͕Ͱ͖Δ
  8. όοΫάϥ΢ϯυॲཧ • AppleWatch͕όοΫάϥϯυͰ΋ iPhoneͱ௨৴Ͱ͖ΔΑ͏ʹͳͬͨ • watchOS2·Ͱ͸ • AppleWatch→iPhoneͷ৔߹͸ड͚ΔଆͷiPhone͕ όοΫάϥ΢ϯυͰ΋OK •

    iPhone→ AppleWatch͸ड͚ΔଆͷAppleWatch͕ ϑΥΞάϥ΢ϯυͰ͋Δඞཁ͕͋ͬͨ • iPhoneͰΞϓϦΛૢ࡞ͨ͠ͱ͖ʹWatchʹσʔλΛ౤ ͓͍͛ͯͯԿ͔͠ΒͷॲཧΛ࣮ߦͤ͞Δ͜ͱ͕Ͱ͖Δ Α͏ʹͳͬͨ
  9. ·ͱΊ • watchOS3Ͱ͸ • औಘͰ͖ΔσόΠεɾηϯαʔͷ৘ใ͕૿͑ͨ • όοΫάϥ΢ϯυॲཧ͕Ͱ͖ΔΑ͏ʹͳͬͨ • SpriteKit/SceneKitͰήʔϜٴͼϦονͳදݱ͕Ͱ͖ΔΑ͏ʹͳͬͨ •

    Audio/iCloud/GameCenterपΓ΋ڧԽ͞Εͨ • Appleͱͯ͠͸ήʔϜΛ࡞ͬͯ΄͍͠ʁʁ • Ͱ͖Δ͜ͱ͸૿͑ͨͷͰ͋ͱ͸ΞΠσΞ࣍ୈ • Ͱ΋γΣΞ͕૿͑ͳ͍͜ͱʹ͸ɾɾɾ • ΤϯδχΞ͕Ͱ͖Δ͜ͱ͸AppleWatch͕ ཉ͘͠ͳΔັྗతͳΞϓϦΛ࡞Δ͜ͱ