Skip to content

Instantly share code, notes, and snippets.

@rawandahmad698
Last active October 12, 2018 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rawandahmad698/9ac0b7a411b7e88ff44068938a0b250a to your computer and use it in GitHub Desktop.
Save rawandahmad698/9ac0b7a411b7e88ff44068938a0b250a to your computer and use it in GitHub Desktop.
import WatchKit
import Foundation
import NotificationCenter
class SwipeController: WKInterfaceController {
//@IBOutlet weak var myTimer: WKInterfaceTimer!
var timer = TimerController()
override func awake(withContext context: Any?) {
super.awake(withContext: context)
// Configure interface objects here.
}
override func willActivate() {
// This method is called when watch view controller is about to
super.willActivate()
}
override func didDeactivate() {
// This method is called when watch view controller is no
super.didDeactivate()
}
@IBAction func PauseButton() {
// Post notification:
let userInfo = ["foo": 1, "bar": "baz"] as [String: Any] // you could also transfer data
NotificationCenter.default.post(name: .stopTimer, object: nil, userInfo: userInfo)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment