Group Expense Splitter with Charts
Build an iOS app for splitting shared costs in a group, for a trip, a shared flat or a dinner with friends. Members log what they paid and who it was for, split equally or by custom amounts, and the app works out who owes whom. Instead of everyone paying everyone back, it calculates the smallest number of payments that settles all debts. Charts made with Swift Charts show spending by category and by person, and everything is saved with Core Data. You'll learn Core Data with several related entities, money calculations without rounding errors, a debt simplification algorithm, Swift Charts, and testing the logic that matters most.
- Estimate
- ~13h
- Steps
- 7
- Completed by
- 0
- Proposed by
- codeseed.app
SwiftUI · CoreData · Swift Charts
Project roadmap
- 01
Model groups, members and expenses
~2hCreate an app with Core Data entities: Group, Member, Expense (description, amount in cents as an integer, date, category, payer) and Share (the expense, the member and the amount they owe). Set the relationships and delete rules, so deleting a group deletes everything in it. Add sample data for previews. Done when: a group with members and expenses can be created in code and loaded again.
- 02
Build the expense form
~2.5hBuild a form to add an expense: description, amount, category, who paid, and how to split it: equally among selected members, or with custom amounts that must add up to the total. For equal splits, spread the leftover cents so the shares always add up exactly (100 split three ways is 34, 33 and 33). Done when: saving an expense creates shares that add up exactly to its amount.
- 03
Calculate balances and simplify debts
~2.5hWrite a pure Swift function that calculates each member's balance (what they paid minus what they owe), then settles debts with a greedy algorithm: repeatedly match the person who owes the most with the person owed the most, and record a payment of the smaller amount, until everyone is at zero. This needs at most one payment fewer than the number of people. Done when: the payments settle every balance to exactly zero.
- 04
Show the settlement
~1.5hBuild a Settle up screen showing each member's balance (green for owed, red for owing) and the list of payments, such as Ana pays Mihai 45.50. Let the user mark a payment as done, which records it as a settlement and updates the balances. Done when: marking all suggested payments as done brings every balance to zero.
- 05
Add charts
~1.5hUse Swift Charts to show spending by category as a bar chart (or a pie chart with SectorMark) and spending per member. Add a time filter (this month, all time). Handle a group with no expenses without showing an empty chart. Done when: the charts match the expenses and update when expenses change.
- 06
Build the group screens
~1.5hBuild a list of groups, a group screen with its expenses (newest first) and a button to add members. Allow editing and deleting expenses, and prevent deleting a member who still has expenses or an unsettled balance. Done when: all group, member and expense actions work, and the balances always stay correct.
- 07
Test the settlement logic
~1.5hWrite XCTest tests for splitting with leftover cents, balances, and debt simplification: two people, a circle of debts (A owes B, B owes C, C owes A) that cancels out, everyone already even, and a random group where you check all balances end at zero. 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.
Tech stack