This is the solution I came up with. Right now the alert at the end of the timer simply prints to the console with "Done". Big thanks to user Prawn as I used some of his code in this solution.
import WatchKit
import Foundation
var myTimer : NSTimer?
var elapsedTime : NSTimeInterval = 0.0
var startTime = NSDate()
var duration : NSTimeInterval = 4.0 //Arbitrary 4 seconds to test timer.
class InterfaceController: WKInterfaceController {
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
WKTimer.setDate(NSDate(timeIntervalSinceNow: duration))
}
override func willActivate() {
super.willActivate()
}
@IBOutlet var WKTimer: WKInterfaceTimer! //The WatchKit timer the user sees
@IBAction func startButton() { //Start button
NSTimer.scheduledTimerWithTimeInterval(duration, target: self, selector: ("timerDone"), userInfo: nil, repeats: false)
WKTimer.setDate(NSDate(timeIntervalSinceNow: duration ))
WKTimer.start()
}
//Reset button resets the timer back to the original time set.
@IBAction func resetButton() {
WKTimer.stop()
WKTimer.setDate(NSDate(timeIntervalSinceNow: duration))
}
func timerDone() {
print("Done")
}
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}
}