Skip to content
Simple motion detector for ⌚️ (watchOS) shake gesture.
Swift Ruby
Branch: master
Clone or download
Latest commit 284a6ac Aug 18, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Pod/Classes update to swift 4 Aug 18, 2018
WatchShaker WatchKit App update to swift 4 Aug 18, 2018
WatchShaker WatchKit Extension update to swift 4 Aug 18, 2018
WatchShaker.xcodeproj update to swift 4 Aug 18, 2018
WatchShaker Remove .DS_Store files. Nov 11, 2017
WatchShakerTests Initial Project Dec 10, 2016
img Add files via upload Nov 11, 2017
.gitignore Initial commit Dec 10, 2016
LICENSE Update LICENSE Nov 11, 2017
README.md Update README.md Nov 11, 2017
WatchShaker.podspec 0.0.3 Jan 30, 2017
giphy (1).gif upload gif readme May 2, 2017

README.md

WatchShaker

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

Swift Version CocoaPods Compatible Platform

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 and all awesome Contributors

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

You can’t perform that action at this time.