0

I am attempting to create an app in Swift using a Storyboard. I want to have a button trigger the UIProgressView's animation.

*Expected '{' in body of function declaration*

import Cocoa

class ViewController: NSViewController {

override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
}

override var representedObject: AnyObject? {
    didSet {
    // Update the view, if already loaded.
    }
}

@IBAction func PressKit(sender: AnyObject) {    
    func startAnimating()
    }
}
Jeffrey
  • 1,271
  • 2
  • 15
  • 31
Mr.X
  • 21
  • 1
  • 4

1 Answers1

0

If you are trying to call the function "startAnimating", then don't use the "func" keyword in front of it, just use "startAnimating()" to call the function. You will then need to define the function (outside of the "PressKit" function). You might want to do this somewhere else in the class using, say: func startAnimating() { ...some code... }

Samaga
  • 98
  • 5