From c25f95d71fc62326270bb18a66d1c5a40b459bd0 Mon Sep 17 00:00:00 2001 From: Peter Vanhoef Date: Sat, 25 Mar 2017 11:54:14 +0100 Subject: [PATCH] Implemented hint 2 (closes #11) --- Calculator/Calculator/ViewController.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Calculator/Calculator/ViewController.swift b/Calculator/Calculator/ViewController.swift index d8dfd2e..366d601 100644 --- a/Calculator/Calculator/ViewController.swift +++ b/Calculator/Calculator/ViewController.swift @@ -22,11 +22,7 @@ class ViewController: UIViewController { display.text = textCurrentlyInDisplay + digit } } else { - if digit == "." { - display.text = "0." - } else { - display.text = digit - } + display.text = (digit == ".") ? "0." : digit userIsInTheMiddleOfTyping = true } }