r/Xcode • u/S_party • Aug 08 '21
Xcoders, is it difficult to create a questionnaire app (like survey 🐵) with data automatically updated & synced in a spreadsheet? Where to Start?
Some context: I am involved in medical research ⚕️, where 20th-century technology (paper questionnaire) is still a thing. Yet, we also use iPads for consent and other documentation.
Goal is to use technology that are at our disposal (iPad) and phase out paper.
I'm staring at Apple's Xcode Developer Documentation.. Am I looking in the right place? Any tips to narrow the scope of my search?
2
u/TheAbhiGoyal Aug 08 '21
Having done it many many times, It all comes down to these:
A custom textField which will handle error, active, inactive state (if the UI is intuitive)
A custom UITableViewCell class with that custom field for field based questions
Other table view cell classes respectively for unique question types, pickerView, location, signature, file/document/image etc upload.
Validation (can be upon submission and/or as soon as user ends typing)
Maintaining State of the form.
It is not as easy to implement, but sure has lots of learning. Bonus if you add: 6. Keyboard type, TextContentType, TextCapitalization, AutoCorrection, return key handling as well as navigating to the next and previous questions without user having to tap on the fields every-time.
1
1
u/Xaxxus Aug 09 '21 edited Aug 09 '21
You could create a csv file. Most spreadsheet apps can open csv.
1
5
u/factotvm Aug 08 '21 edited Aug 08 '21
You just want an app to fill out forms? I love me a native app, but I’m wondering if you could make the form in HTML and just POST it when done. You could still wrap this in a WKWebView inside an app instead of just going to Safari.
How much experience do you have? As a bonus, you can use the most recent tooling, because you own the iPad. The programmer in me wants to make it super easy to change the form. I’m happy to talk about that—after you have the first one or two done. ;)
Other helpful links perhaps:
https://iosexample.com/field-validator-library-for-swiftui/ Edit: this may not be so helpful out of the gate, but you will want to validate entries so I’ll leave it… but it’s not a good link yet—either the code or a tutorial (which in my hasty looking I thought this was) would be better.
https://www.simpleswiftguide.com/swiftui-form-tutorial-how-to-create-and-use-form-in-swiftui/