Latest 0.0.3
Homepage https://github.com/ezefranca/WatchShaker
License MIT
Platforms watchos 3.0
Frameworks Foundation, WatchKit, CoreMotion
Authors

Simple motion detector for ⌚️ (watchOS) shake gesture.

Swift Version CocoaPods Compatible Platform

imagem

WatchShaker is a watchOS helper to get your ⌚️ shake movements

Requirements

  • watchOS 3.0+
  • Xcode 8.0+

Installation

CocoaPods

You can use CocoaPods to install WatchShaker by adding it to your Podfile:

use_frameworks!
pod 'WatchShaker'

Manually

  1. Download and drop WatchShaker.swift in your project to your watch target.
  2. Congratulations!

Usage example

import WatchKit
import Foundation

class InterfaceController: WKInterfaceController {

    override func awake(withContext context: Any?) {
        super.awake(withContext: context)
        // Configure interface objects here.
    }

    var shaker:WatchShaker = WatchShaker(shakeSensibility: .shakeSensibilityNormal, delay: 0.2)

    override func willActivate() {

        super.willActivate()
        shaker.delegate = self
        shaker.start()
    }

    override func didDeactivate() {

        super.didDeactivate()
        shaker.stop()

    }

}

extension InterfaceController: WatchShakerDelegate
{
    func watchShakerDidShake(_ watchShaker: WatchShaker) {
        print("YOU HAVE SHAKEN YOUR ⌚️⌚️⌚️")
    }

    func watchShaker(_ watchShaker: WatchShaker, didFailWith error: Error) {
        print(error.localizedDescription)
    }
}

Contribute

We would love for you to contribute to WatchShaker, check the LICENSE file for more info.

Meta

Ezequiel França – @ezefranca[email protected]

Distributed under the MIT license. See LICENSE for more information.

Latest podspec

{
    "name": "WatchShaker",
    "version": "0.0.3",
    "summary": "watchOS shake moviment",
    "description": "WatchShaker is a watchOS helper to get your u231aufe0f shake moviment.",
    "homepage": "https://github.com/ezefranca/WatchShaker",
    "license": "MIT",
    "authors": {
        "ezefranca": "https://github.com/ezefranca"
    },
    "source": {
        "git": "https://github.com/ezefranca/WatchShaker.git",
        "tag": "0.0.3"
    },
    "platforms": {
        "watchos": "3.0"
    },
    "requires_arc": false,
    "social_media_url": "http://twitter.com/ezefranca",
    "source_files": "Pod/Classes/**/*",
    "frameworks": [
        "Foundation",
        "WatchKit",
        "CoreMotion"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This