Please tell me what the problem is error: unexpectedly found nil while unwrapping an Optional value when you click on the calculator button hangs
The error in this line is numberOnScreen = Double (label.text!)!
import UIKit class ViewController: UIViewController {
var numberOnScreen:Double = 0 @IBOutlet weak var label: UILabel! @IBAction func numbers(_ sender: UIButton) { label.text = label.text! + String(sender.tag-1) numberOnScreen = Double(label.text!)! } override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated.