Sven van den Boogaart
Sven van den Boogaart

Reputation: 12323

Swift wrong syntax?

Im following the swift tutorials at https://itunes.apple.com/us/course/developing-ios-8-apps-swift/id961180099

ive created some buttons which i want to handle in a method.

To handle the buttons I have:

@IBAction func appendDigit(sender:UIButtion {
    let digit  = sender.currentTitle
    println("digit" = \(digit)")
}

This gives me an error on the prinln that states

   Consecutive statements on a line must be separated by ";"

So I tried adding ; after the println and after the declartion of digit but the error remains.

This question might be very easy to fix but im pretty much stuck.

Upvotes: 0

Views: 46

Answers (1)

mipadi
mipadi

Reputation: 410572

You forgot the right parenthesis after UIButton.

You also have a hanging quote mark in the println statement; that line should be

println("digit = \(digit)")

Upvotes: 3

Related Questions