0

I have text field with text. When I am going to another view and coming back to the view (using dismis view controller.) The text is present on the text field but when I am coming back to this view (using any action Button) the text on textfield disappear. I want the text to be present on the text field even after coming from any view using action button. How can I achieve it? Please someone help me.

Zissouu
  • 924
  • 2
  • 10
  • 17
Tapan Raut
  • 73
  • 7
  • Please include the code causing the issue in your question. – Dávid Pásztor Sep 13 '17 at 15:08
  • There are several scenarios can be the caused that make you trouble. Please add some code snippet along with your question so that you can get appropriate answer for that. I think this [link](https://stackoverflow.com/questions/5562938/looking-to-understand-the-ios-uiviewcontroller-lifecycle) will help you to understand the life cycle of a view controller. – Amir Khan Sep 13 '17 at 16:59

1 Answers1

0

You have to save the text entered in the text field to some model or variable and set it to textfield after dismissing the another viewcontroller. View don't preserve the data in it when viewcontroller is dismissed.

laxman khanal
  • 998
  • 1
  • 8
  • 18