A SwiftUI calculator that estimates HbA1c and average blood glucose using the 2008 ADAG Study Group formulas, plus glucose/HbA1c unit conversions.
Runs on iPhone, iPad, and macOS. The iPad window opens small and is freely resizable; the macOS app is a native SwiftUI port sharing the same codebase.
- Keypad-driven input:
7 8 9 C / 4 5 6 ⌫ / 1 2 3 = / 0 ., with=computing,Cclearing (zeros input + results),⌫backspacing - Calculate eAG (from HbA1c) and Calculate HbA1c (from eAG) modes
- UK (IFCC) switch converts the current input to the other unit system on the fly (mg/dl ↔ mmol/L, % ↔ mmol/mol) and recomputes results
- Results always show both units (mg/dl + mmol/L, or % + mmol/mol)
- Display: three label/value rows, all values
0initially and afterC - Help sheet with usage, terminology, formulas, and contact info
- eAG = 28.7 × A1c − 46.7 (mg/dl); mmol/L = /18
- A1c = (eAG + 46.7) / 28.7 (%); IFCC = 10.93 × A1c − 23.50 (mmol/mol)
- NGSP = 0.09148 × IFCC + 2.152; mmol/L ↔ mg/dl: ×18 / ÷18
Project generated by xcodegen from
project.yml — run xcodegen generate after adding/removing source files.
Two targets share Glucocalc/ sources: iOS (Glucocalc) and macOS
(GlucocalcMac, macOS 14+).
./build.sh # build + install + launch (default: jphone)
./build.sh opad # or specify a deviceRequires Xcode 26.6 and a development team for device deployment.
xcodegen generate
xcodebuild -project Glucocalc.xcodeproj -target Glucocalc -sdk iphonesimulator -configuration Debug build
# product: build/Debug-iphonesimulator/Glucocalc.appxcodegen generate
xcodebuild -project Glucocalc.xcodeproj -scheme GlucocalcMac -destination 'platform=macOS' build
open build/.../Glucocalc.appGPL-3.0 — see LICENSE.