I\'m trying to developing an app that includes a simple Stopwatch feature. I\'m using Xcode 6 and the Swift language. Here is the code in FirstViewController
You have defined the updateTime as a local function to Stopwatch, so it is not available outside of its scope. You should move it at class level (same as Stopwatch) in order to be accessible.
I notice however that there are some local variables which should probably be instance properties.
let updateTime be a class method .
And if it's in a pure Swift class you'll need to preface that method's declaration with @objc like:
class A {
@objc func updateTime(timer:NSTimer) {
}
}
Another possibility: make sure your selector function doesn't throw, as that will also give you an unrecognized selector exception:
func mySelector(timer: NSTimer) throws {
}