Smart iOS app that helps scan, understand, and organize receipts using on-device OCR and OpenAI for data extraction.
While learning iOS development, I wanted to build something practical that solves a real-life problem. Many people collect a lot of receipts from both online and offline purchases, and it becomes difficult to track expenses, warranties, or proof of purchase over time. Gotcha helps by turning receipt images into structured and searchable records.
The app uses camera scanning or photo import, Apple Vision OCR, and OpenAI-based extraction to automatically pull important details such as store name, date, total amount, and other key information. This makes the app useful for basic expense tracking, personal record keeping, and small-scale financial organization for everyday use.
-
Camera-based document scanning
-
Photo library import
-
On-device OCR
-
AI-powered field extraction
-
Structured receipt storage
-
Fast, debounced search
-
Detail view with zoom
-
Modern SwiftUI UI
-
MVVM architecture
-
Languages
- Swift
-
Frameworks
- SwiftUI
- UIKit (used for camera/document scanner integration)
- Core Data
- Vision (OCR)
- VisionKit (Document Scanner)
- PhotosUI
-
Libraries / Services
- OpenAI Chat Completions API (integrated using
URLSession)
- OpenAI Chat Completions API (integrated using
- macOS compatible with Xcode 16+
- Xcode 16+
- iOS device or simulator (iOS 18+ recommended)
- An OpenAI API key with Chat Completions access
git clone https://github.com/rajk-dev-01/Gotcha.git
cd Gotcha(Adjust path if your remote repo name differs.)
-
In the repo, you’ll find an example config:
Gotcha/Secerts-Example.xcconfig
-
Create a real secrets file alongside it:
Secrets.xcconfig -
Edit
Secrets.xcconfigand set your key:OPENAI_API_KEY = sk-...your_key_here... -
Make sure the project’s build configuration is using
Secrets.xcconfig(already referenced in the.xcodeproj).
The Receipt-Finder-Info.plist reads OPENAI_API_KEY from the build settings, which comes from Secrets.xcconfig.
- Open
Gotcha.xcodeprojin Xcode. - Select the Gotcha app scheme.
- Choose an iOS Simulator or a physical device.
- Press Cmd + R to build and run the app.
-
Integrating multiple Apple frameworks Learned how to work with Vision, VisionKit, PhotosUI, Core Data, and SwiftUI together and connect the full workflow from scanning to storage.
-
Designing a clean MVVM architecture for SwiftUI Implemented a simple MVVM structure by moving business logic into
ViewModelclasses to keep Views cleaner and easier to manage. -
AI integration
- Designed prompts and used
response_format: json_objectto get structured responses from the OpenAI API. - Added basic error handling and safe parsing for network or API issues.
- Designed prompts and used
-
User experience for scanning flows
- Managed navigation between scanning, processing, and list screens without blocking the UI.
- Implemented debounced search to keep the app responsive.
- Name: Raj K
- Email:
rajk.dev01@gmail.com - LinkedIn:
www.linkedin.com/in/rajk01 - GitHub:
GitHub Profile
Copyright (c) 2025 Raj K
All rights reserved.


