Help us measure site usage?

With your permission, we use self-hosted analytics to understand page usage. It is optional and does not affect the Service. Learn more.

SwiftintermediatemobileAI generated

Expense Importer

Build an iPhone app that imports bank statement files (CSV exports) into a list of expenses, checks every row, and lets you fix what's wrong, especially categories. Each bank formats its files differently, so the app detects the columns and date and number formats, shows a preview with problem rows highlighted (a date it can't read or an amount that isn't a number), suggests a category for each transaction from its description using rules you build up over time, and skips transactions already imported. Files can come from the Files app or a link downloaded with URLSession, and everything is saved with SwiftData. You'll learn importing files on iOS, parsing messy CSV, validation and correction flows, simple rule-based categorization, duplicate detection, and SwiftData.

Estimate
~12h
Steps
7
Completed by
0
Proposed by
codeseed.app

SwiftData · URLSession

Project roadmap

  1. 01

    Define the import

    ~1.5h

    Write DESIGN.md: the expense model (date, description, amount, currency, category, source file and a fingerprint for duplicate detection), the import steps (choose file, detect format, map columns, preview with problems, fix, and confirm), the supported formats (comma or semicolon separators, several date formats, and amounts with a dot or comma as decimal separator), and the categorization rules (a text pattern mapped to a category). Collect two or three real sample exports. Done when: DESIGN.md covers the model, steps and rules.

  2. 02

    Pick and read files

    ~1.5h

    Add importing from the Files app with .fileImporter (handling security-scoped access) and from a link with URLSession (checking the response is text and not too large). Detect the text encoding and the separator, and parse the CSV correctly, including quoted fields. Done when: the sample files load as rows of fields from both sources.

  3. 03

    Map columns and validate

    ~2h

    Guess which columns are the date, description and amount from the header names and sample values, and let the user change the mapping. Parse each row with the detected date and number formats, marking rows that fail with a reason. Show a preview listing valid and problem rows. Done when: the preview shows correctly parsed rows, and problems are highlighted with explanations.

  4. 04

    Suggest categories and fix rows

    ~2h

    Apply categorization rules (stored in SwiftData, such as a description containing LIDL means Groceries) to suggest a category for each row. Let users fix problem rows inline, change categories, and create a rule from a correction ("always categorize UBER as Transport"). Done when: categories are suggested, and a new rule applies to other matching rows immediately.

  5. 05

    Save and skip duplicates

    ~1.5h

    Compute a fingerprint for each transaction (date, amount and normalized description), skip rows already imported (showing how many were skipped), and save the rest with SwiftData in one go. Record each import (file, date and counts) so it can be undone. Done when: importing the same file twice adds nothing the second time, and an import can be undone.

  6. 06

    Show the expenses

    ~1.5h

    Build a list of expenses by month with totals per category, filters by category, and editing an expense's category (with an option to create a rule). Done when: imported expenses appear with correct monthly totals.

  7. 07

    Test it

    ~2h

    Write unit tests with the sample files and small made-up ones: separator and encoding detection, quoted fields, date and amount formats, column guessing, rule matching, fingerprints and duplicate skipping, using an in-memory SwiftData container. Done when: the tests pass.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~12h · 7 steps

Tech stack

SwiftDataURLSession