We Present a smart way to understand how to code with swift3
class ViewController: UIViewController {
@IBOutlet weak var tempEntry: UITextField!
@IBAction func convertClick(_ sender: UIButton) {
//check if there is a text inside TextFiled
if let results = tempEntry.text {
if (results == “”) { //TextFiled is Empty
return
}
else { //text exists inside TextFiled
resultLabel.text = results
}
}}