jeudi 9 juin 2016

Textfield if statement, animation swift

Im am new to swift. Looking to create an if statement so that if the text "mcmaster" is entered into a textfield the image named "introduction" animates into the imaged named "mcmaster". Any advice or link to tutorials would help.

Thanks

var Introduction: UIImageView!
var McMaster: UIImageView!

@IBOutlet weak var ScrollView: UIScrollView!
@IBOutlet weak var TextField: UITextField!

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

    Introduction = UIImageView(image: UIImage(named: "Introduction.png"))
    McMaster = UIImageView(image: UIImage(named: "McMaster.png"))


    if TextField == ("McMaster"){

        UIImageView.transitionFromView(Introduction, toView: McMaster, duration: 1, options: UIViewAnimationOptions.TransitionFlipFromRight, completion: nil)
    }


}

Aucun commentaire:

Enregistrer un commentaire