Inspiration

All my life I have witnessed the struggles of people like my dad who are allergic to many foods. I have seen him spend upwards of 5 minutes reading an ingredient label to see if it is safe for him to eat. Not only was the font tiny but there were numerous ingredients too. On top of that, Seniors with ailing eyes may not be able to read it at all. I thought that people should know what's in their food, so I decided to create this app to allow people to scan a barcode to see its information.

How we built it

This app was created using Xcode's AVFoundation with the OpenFoodFacts API. The app uses the device's camera to scan a barcode and converts it to a numerical code. That code is then sent to the API which returns the information about the food which is then displayed to the user.

Challenges we ran into

Swift UI I initially attempted to create this app in SwiftUI as I wanted to move away from the Storyboard. However, I probably should have started with something simpler as this project quickly became too much to handle. API The API I used was pretty comprehensive but since anyone could add data, it was not the best. The thumbnail images were poorly taken, and the text was occasionally in a different language. However, most of the time, this API worked perfectly.

Accomplishments that we're proud of

I am proud of my implementation of the AVCapture Session to scan the barcode. Although it took a few tries and many visits to Stack Overflow, It turned out better than I expected.

What we learned

This project taught me how to use AVFoundation and make API calls using Swift. I also learned to not rush into things before learning the basics.

What's next for Allergen

As I stated previously, the API I'm using is not the greatest and doesn't have information for every product. A feature could be added allowing users to create new foods and input the information to expand to foods that aren't logged by the API. The app could also have a memory feature to allow users to see previously scanned objects.

Built With

Share this project:

Updates