Every time I went looking for a candlestick chart for an iOS app, I found the same thing: a WebView wrapping TradingView's widget or some JS charting library. Works fine, but it means your "native" app ships a hidden browser just to draw some rectangles, and it never quite feels like the rest of your UI.
So I built CandleKit, an open-source candlestick chart for SwiftUI. The goal: make it feel like a control Apple shipped, not a chart library bolted on.
What it does
- Momentum scrolling and pinch-to-zoom anchored under your fingers
- Long-press crosshair that snaps between candles with a haptic tick
- Live tick updates that redraw without disturbing your scroll position
- Infinite history loading as you scroll back
- Drag the price axis itself to rescale, double-tap to snap back to autoscale
- Dynamic Type, dark mode via system colors, and VoiceOver gets a real Audio Graph (closing prices as pitch) instead of "chart, image"
The API, boring on purpose
You add it, and you draw it:
CandlestickChart(candles)
.indicators([.sma(20), .ema(50)])
.frame(height: 360)
Under the hood it's split into two targets. CandleKitCore is pure Foundation, no UI dependencies, so it builds on macOS and Linux too - it holds everything testable: viewport math, autoscaling, series diffing, indicator calculations. CandleKit sits on top and owns the SwiftUI view, the Canvas renderers, and a transparent UIKit view underneath that handles the gesture recognizers. Candles draw as a handful of batched paths, so draw calls don't scale up with however much history is loaded.
It's 0.1, pre-release. CandleKitCore has full unit test coverage, but the SwiftUI rendering side hasn't been profiled on device yet or snapshot-tested, so treat it accordingly. There's a demo app in the repo if you want to poke at it before wiring it into anything real.
Repo: github.com/LalanaChami/CandleKit. MIT licensed.
Genuinely want the feedback, especially if you try it on a device I haven't and something feels off. Bug reports, "this API is awkward," whatever, all useful.
Top comments (0)