easyTrip #if else
Published in
1 min readAug 26, 2018
import UIKitclass ViewController: UIViewController {@IBOutlet weak var countryTextField: UITextField!@IBOutlet weak var seasonSegmentedControl: UISegmentedControl!@IBOutlet weak var answerImageView: UIImageView!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view, typically from a nib.}@IBAction func bookButtom(_ sender: UIButton) {if countryTextField.text == "Italy" || countryTextField.text == "italy" {if seasonSegmentedControl.selectedSegmentIndex == 0 {answerImageView.image = UIImage(named: "yes-milano")}else if seasonSegmentedControl.selectedSegmentIndex == 1 {answerImageView.image = UIImage(named: "no-Europe")}else if seasonSegmentedControl.selectedSegmentIndex == 2 {answerImageView.image = UIImage(named: "no-Europe")}else {answerImageView.image = UIImage(named: "yes-milano")}} else {answerImageView.image = UIImage(named: "yes-milano")}}}