Skip to main content

AFCoreUI for iOS

AFCoreUI is a Swift Package that ships alongside AFCore SPM. Add the AFCoreUI product in addition to AFCore and import:

import AFCore
import AFCoreUI

The package source is at ui/afcore-ui-ios; README and examples there are the canonical reference.


What's inside

Theme

  • AFCoreUITheme — colors, typography, spacing, motion, haptics
  • AFCoreUITheme.advantaHealth — built-in AdvantaHealth palette (light + dark)
  • \.afCoreUITheme environment value; apply via .afCoreUITheme(_:)

Primitives

  • AHCard — themed surface with shadow / border
  • AHRing / AHRingTrio — Apple Activity-style progress rings
  • AHBadge — status pills (Accepted / Pending / Rejected / Queued / Custom)
  • AHBanner — auto-rotating page banner
  • AHEmptyState — illustrated zero-state with CTA
  • AHHero — section hero with eyebrow / title / subtitle / trailing slot
  • AHTrayNotification — dismissable info / success / warning / error row
  • AHHaptics — theme-aware feedback wrappers

Feature views

  • WelcomeCarousel — onboarding value-prop pages
  • PermissionsPrompt — multi-step permission explainer with async request callback
  • ActivityCalendarView — month grid with goal rings + summary pills
  • ActivityDayDetailView — drill-down with status badges + swipe-to-delete
  • CheckInSheet — Scan / Map / Manual chooser
  • BarcodeScannerView — AVFoundation scanner with themed overlay
  • FacilityMapView — MapKit map with themed facility pins
  • SpotItDeckView — Tinder-style swipe deck with up/down feedback

Theming

Wrap your root view once:

@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
RootView()
.afCoreUITheme(.advantaHealth)
}
}
}

To rebrand:

let myTheme = AFCoreUITheme(
colors: AFCoreUIColors(/* … */),
typography: .advantaHealth,
spacing: .standard
)
RootView().afCoreUITheme(myTheme)

Reference implementation

The iOS sample app is the working reference — every AFCoreUI primitive and feature view is wired to live AFCore APIs across the Home / Activity / Check-In / Wellness / Profile tabs.