A minimal SwiftUI iOS app that consumes MagicalRecord through Swift Package
Manager as a local package (../) and verifies the integration end-to-end.
On launch, SelfCheck.swift runs the real
MagicalRecord flow against an in-memory store using the raw Objective-C API
bridged into Swift:
MagicalRecord.setupCoreDataStackWithInMemoryStore()- create a
Personentity and populate it - save synchronously to the persistent store
- fetch/count the results and assert they match
The result is shown on screen, logged as MRSPM_SELFCHECK PASS/FAIL, and a
failure trips an assert, so an automated build+launch surfaces regressions.
Open MagicalRecordExample.xcodeproj in Xcode and run, or from the command line:
cd Example
# Build (proves package resolution, linking, and Swift↔ObjC interop)
xcodebuild -project MagicalRecordExample.xcodeproj \
-scheme MagicalRecordExample \
-destination 'generic/platform=iOS Simulator' build
# Or build, install and launch on a booted simulator to run the self-check,
# then confirm the runtime result:
xcrun simctl spawn booted log show --last 1m \
--predicate 'eventMessage CONTAINS "MRSPM_SELFCHECK"'