How to Store User Entered Details and Get It Back in ios?

前端 未结 3 1020
深忆病人
深忆病人 2021-01-17 06:41

How to Store user entered details and Get it Back in ios?

  • I had Following TextFields

3条回答
  •  悲&欢浪女
    2021-01-17 07:04

    I would suggest you to create variables and store your data there. Once you are ready to go to the next view controller , you can pass the data to your next view controller in this fashion

    let nextVC = self.storyboard!.instantiateViewControllerWithIdentifier("NextVCStoryBoardId") as! NextVCViewController 
    nextVC.variable1 = variable1 //variable1 is in currentVC
    nextVC.variable2 = variable2 //variable2 is in currentVC
    

    and so on...

    You can then push to nextVC with this code

    self.navigationController!.pushViewController(nextVC, animated: true)
    

    In nextVC , you make an action for button to send the data to mail.

提交回复
热议问题