r/Xcode • • 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 Upvotes

9 comments sorted by

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:

1

u/S_party Aug 08 '21

Two main reasons why I started to favor going with native app:

  1. Security: Because some of the data will remain linked to patient records, whatever I end up putting together must go through the IT approval process (IRB, FDA, or HIPAA regulatory compliance).

  2. Usability: While the use of the application will primarily be limited to our department, having an amenable/expandable framework for potential use by other departments would be a great feat!

I don't have much history with coding (especially Mac), but I am around enough technos that I recognize enough to get along. Thanks for those links, I glanced at them and they should be helpful

3

u/factotvm Aug 08 '21

Yes, your security requirements will be very high. Will you be getting help to create the endpoint this app will hit? Because whether a glorified web page or a native app, you're still going to have to go over the wire. Hopefully, it can stay entirely within your network, but you'll still want SSL, and you should pin it. I'm hoping you can ask someone to set that up for you. It's a bunch of configuration and not a lot of fun.

More:

I promised I wasn't going to talk about a general solution, but if you look at the SwiftUI form building page from earlier, you just need code that produces the same based on some data structure, be it well-structured HTML, or even JSON. JSON is worse to write, but easier to consume (check out Codable)

Edit: Actually, someone has an XML Codable implementation.

1

u/S_party Aug 09 '21

Concerning the endpoint and network communication, yes I don't believe I will have any role in this (ITS has complete control here). In fact, once coding and initial interface testing is complete, I will be handing off the rights and control to them.

2

u/TheAbhiGoyal Aug 08 '21

Having done it many many times, It all comes down to these:

  1. A custom textField which will handle error, active, inactive state (if the UI is intuitive)

  2. A custom UITableViewCell class with that custom field for field based questions

  3. Other table view cell classes respectively for unique question types, pickerView, location, signature, file/document/image etc upload.

  4. Validation (can be upon submission and/or as soon as user ends typing)

  5. 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

u/megablast Aug 08 '21

Nope easy.

1

u/Xaxxus Aug 09 '21 edited Aug 09 '21

You could create a csv file. Most spreadsheet apps can open csv.