Note that your code should not crash, whatever input user does. You have to make it more robust. May be the reason is you are converting to Float, something like let value = Float(textField.text!) If so, you should instead test for nil with: let value = Float(textField.text!) ?? 0.0
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: