I have created an app using ionic and cordova and now I want to remake it on iOS. I am working with iOS for the first time, and I cannot figure out how to store data. For ex
You can work with persistent data in several ways on iOS.
This is a tool that is used to store small amounts of information like user settings, preferences etc. Don't use it for data that will scale with application usage (e.g. like notes in notepad app). Documentation will answer all your questions about User Defaults.
You have Core Data as an out of the box solution which is build on top of the SQLite
and takes some time to learn, but from my experience it's worth the effort. You are free to use pure SQLite
or other database type, but it requires more code and probably custom frameworks.
You can use arbitrary XML
, JSON
or CSV
files to store your data. Tooling is rich (e.g. NSXMLParser or SwifyJSON just to name two) and if you look on Github, you will find what you need. You can also use build in combination of NSCoder and NSKeyArchiver / NSKeyUnarchiver which are easy to grasp.
Finally, for a local storage you can use binary files i.e. images. This is too advanced topic to cover here, but I want to share an example of Open Raster file format. It is used to save informations for drawing apps (eq. GIMP) and inside, it is basically an XML file and a bunch of images compressed to zip and named as .ora file. Creating your own specification for a hybrid format is not that hard.
Just to not overlook other methods, you can use remote database API to store data outside of the device, but of course you need your own host and some backend skills.
I hope I didn't miss something important. I just wanted to sum up this knowledge in one place for future reference.
As the first comment says, your question is quite large. When you say 'one form on several view', I consider it as 'one form per view'. Keep It Simple S... ;) (Except if you use page control for your form.)
Basically, you have three ways to store data :
There are numerous tutorials on these topics. www.raywenderlich.com site is a good one to begin...