Good day! I have several UITextFields for registration, and an information button about the program

Information "about the program" opens on the new ViewController (so it is necessary) and after it we return back to the registration form, but at the same time all the fields that were filled in earlier, become clean.

As when returning to the registration window, leave all the data that the user has filled in their fields

  • Describe how you move to "about the program." As for me, an extra model with strong properties for registration will keep the memory (I could be wrong). In the registration controller, I would add the properties to which I entered the strings, and during the viewdidappear I substituted them into the fields. - tragvar

1 answer 1

Get a model object - an inheritor of NSObject which will contain all the fields whose data you need:

@interface RegistrationDataModel : NSObject @property (nonatomic, strong) NSString *name; @property (nonatomic, strong) NSString *email; @end 

After that, depending on the navigation variant between the two ViewControllers, either assign this object to the appropriate ViewController or transfer it from one to another by delegation. After clicking the save button, transfer the data from the model object to the database.

  • Ok, thanks, I’m filling in now - Svyatoslav Boyko