An open-source, offline-first iOS Anki client with full AnkiWeb sync.
Anki iOS wraps the official ankitects/anki Rust backend via C FFI, giving you a native SwiftUI experience backed by the same battle-tested engine that powers Anki Desktop and AnkiDroid. Sync your decks with AnkiWeb, study with FSRS scheduling, and keep your review history in perfect sync across all your devices.
- Full AnkiWeb Sync -- login, sync, full upload/download, bidirectional review sync
- FSRS Scheduling -- powered by the official Rust FSRS engine, not a reimplementation
- Card Rendering -- Rust template engine renders cards exactly like desktop Anki
- Deck Browser -- hierarchical deck tree with recursive
DisclosureGroupexpand/collapse, new/learn/review count badges on every node - Study Session -- answer cards with Again/Hard/Good/Easy; next-interval labels shown above each button
- Note Browser -- search notes across all decks, deck filter chips (top-level decks auto-include subdecks), lazy-load results (50 per page)
- Note Editor -- edit note fields with accurate field names from the Rust notetype RPC
- Statistics Dashboard -- full-year review heatmap (auto-scrolls to today), streak counter, retention rate, forecast chart, card count breakdown
- Offline-First -- everything works offline; sync when you have a connection
- Swift 6.2 Strict Concurrency -- zero data races, fully actor-isolated,
Sendablethroughout
SwiftUI Views
|
@DependencyClient structs
|
AnkiBackend (Swift wrapper)
|
C FFI (4 functions)
|
Rust static library (ankitects/anki)
Swift owns the UI. Rust owns everything else -- database, sync, FSRS scheduling, card templates, statistics.
For the full architecture walkthrough, see ARCHITECTURE.md.
| Tool | Version |
|---|---|
| iOS | 17.0+ |
| Xcode | 16.0+ |
| Rust | 1.92+ (via rustup) |
| protoc | 3.0+ |
| protoc-gen-swift | latest |
| xcodegen | latest |
git clone --recursive https://github.com/antigluten/anki-ios.git
cd anki-ios# Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios-simulator
# Protobuf compiler and Swift plugin
brew install protobuf swift-protobuf
# Xcode project generator
brew install xcodegen./scripts/build-xcframework.shThis cross-compiles the Rust bridge for iOS device and simulator, then packages both into AnkiRust.xcframework. The first build takes several minutes; incremental builds are fast.
./scripts/generate-protos.shcd AnkiApp && xcodegen generate && cd ..
open AnkiApp/AnkiApp.xcodeprojSelect an iOS Simulator or device, then build and run (Cmd+R).
- UI: SwiftUI with strict concurrency (Swift 6.2, language mode v6)
- Dependency Injection: swift-dependencies (
@DependencyClientstruct-closure pattern) - Backend: ankitects/anki Rust crate via C FFI
- Serialization: Protocol Buffers (24 .proto service definitions)
- Database: SQLite (owned by Rust backend)
- Build: SPM for library modules, xcodegen for the app target
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) because it incorporates ankitects/anki (copyright Ankitects Pty Ltd), which is also AGPL-3.0. See LICENSE for the full license text.
The AGPL requires that if you distribute this software or run it as a network service, you must make the complete source code available under the same license.
Contributions are welcome. See CONTRIBUTING.md for guidelines, code style, and the development setup.
- Damien Elmes and the ankitects/anki contributors for the Rust backend that powers this app
- AnkiDroid for pioneering the Rust backend bridge pattern on mobile
- Point-Free for swift-dependencies

