I am getting an NSException error which I cannot understand since using the updated swift 2. I am aware that the exception is common and in itself doesn't really help. I have included the code I am using. The code is from the start of a calculator application. While this code runs perfectly fine in swift it now offers the exception in the updated swift 2.
class ViewController: UIViewController {
@IBOutlet weak var mainDisplay: UILabel!
@IBAction func appendDigit(sender: UIButton) {
let digit = sender.currentTitle
print("digit = \(digit)")
}}
The error is connected to the line print("digit = \(digit)")
as far as I can tell. In swift 2 println was removed and combined into print but I am not sure why calling in digit is causing an exception? I am completely new to swift and so any help would be appreciated to help me understand the issue.
Thank you