mercredi 3 août 2016

Unable to hide view in SecondViewController class by calling function in FirstViewController Class

Function call in FirstViewController is -

@IBAction func redViewAct(sender :UIButton) {
        let nextview = self.storyboard?.instantiateViewControllerWithIdentifier("ViewController1") as! ViewController1
        self.navigationController?.pushViewController(nextview, animated: true)
       let f1 = ViewController1()
        f1.view1Show()
    }

Method in second class -

@IBOutlet weak var redView: UIView!
    @IBOutlet weak var blackview: UIView!
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    func view1Show() {
        redView.hidden = false
        blackview.hidden = true
    }

Aucun commentaire:

Enregistrer un commentaire