title: Designing Calculator in Swift - How to add single "." when require to enter floating point number?
body: <p>I am developing calculator in Swift for IOS8. When pressed [0-9] button. It displays correctly. Also operator [+ - / *] works successfully. </p>
  
  <p>I would need to add "." button, so user can enter floating number 19.2, 21.67, 40.6725 - <strong>How to write code so that "." appear once only, instead of 19.3.4?</strong> (not legal floating point number in calculator)</p>
  
  <p>I found out rangeOfString(subString: String) might be great use. It returns an Optional. If passed String argument cannot be found in the receiver, it returns nil</p>
  
  <pre><code>@IBOutlet weak var display: UILabel!
  @IBAction func appendDigit(sender: UIButton) {
          let digit = sender.currentTitle!
  
          if (digit == "․") {
              if (display.text.rangeOfString("﹒") != nil) {
                 //DO Something Here
              } else{
  
              }
  </code></pre>