Is prepareForSegue right way of passing value between view controllers

后端 未结 4 1840
迷失自我
迷失自我 2021-01-05 16:02

I\'m trying to learn Swift and I\'m trying to develop the famous note application.

There is an array bound to a tableview and another view for adding notes. At secon

4条回答
  •  萌比男神i
    2021-01-05 17:07

    It is not 'the' right way, but it is a right way. Especially in storyboard applications.

    Here is an alternative way of passing value and calling the view.

    var myNewVC = NewViewController()
    myNewVC.data = self
    navigationController?.presentViewController(myNewVC, animated: true, completion: nil)
    

提交回复
热议问题