SplitSmart - iOS Bill-Splitting Application
Splitting restaurant bills accurately is tedious: manually typing each item and price, calculating who owes what with tax and tip, and coordinating payments. Existing bill-splitting apps either require full manual entry or have unreliable OCR that misidentifies items and prices.
SplitSmart solves this by automatically scanning and itemizing receipts. Point your camera at a bill, and the app extracts all line items with prices, assigns items to participants, calculates proportional tax and tip distribution, and shows real-time balances across devices. The core challenge wasn't just OCR—Apple's Vision Framework handles text extraction—but understanding receipt structure: which price belongs to which item when every restaurant formats receipts differently with inconsistent spacing and layouts.
Features
- Automatic Receipt Scanning: Upload or photograph receipts to automatically extract all items and prices without manual line-item entry, achieving 95% accuracy across hundreds of real-world receipts.
- Intelligent Bill Splitting: Assign items to multiple participants with shared dish support, automatic proportional tax and tip distribution, and real-time balance calculations showing who owes what.
- Manual Correction & Fallback: Edit or delete individual items when OCR fails on edge cases (handwritten amounts, poor print quality), with full manual entry mode available as complete fallback.
- Real-Time Synchronization: Firebase Firestore enables instant updates across devices—multiple users view the same bill simultaneously with automatic UI updates when changes occur.
- Bill Management: Complete transaction history, bill editing with conflict detection for concurrent edits, soft deletion preserving participant history, and session recovery for crash scenarios during bill creation.
Architecture & Technical Implementation
MVVM Architecture with Separation of Concerns: Built with layered MVVM separating read operations (BillManager with Firestore listeners for reactive state) from write operations (stateless BillService validation layer). This prevents accidental mutations and improves testability.
Custom Geometric Text-Matching Algorithm: Developed multi-strategy classification pipeline processing Vision Framework OCR output:
- Geometric positioning (primary): Groups text fragments by Y-coordinate with 2% tolerance, identifies prices via spatial boundary detection.
- Pattern heuristics: Keyword detection ("Tax", "Tip", "Total") and format validation.
- Price relationship validation: Mathematical verification (subtotal + tax = total).
- Gemini AI fallback: LLM classification for ambiguous charges.
Distributed Systems Patterns: Implemented optimistic locking with version-based conflict detection for concurrent edits. Session persistence with 24-hour expiration provides automatic crash recovery.
Validation & Results
Validated through extensive real-world testing on hundreds of actual receipts from diverse sources. Achieved 95% automated extraction accuracy with 5% requiring manual correction for edge cases. The geometric matching algorithm reliably handles inconsistent receipt formats where spatial classification alone would fail.
Tech Stack: Swift, SwiftUI, Firebase, Vision Framework, Gemini AI