Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.25 KB

README.md

File metadata and controls

36 lines (26 loc) · 1.25 KB

MagicalRecord SPM Example

A minimal SwiftUI iOS app that consumes MagicalRecord through Swift Package Manager as a local package (../) and verifies the integration end-to-end.

What it does

On launch, SelfCheck.swift runs the real MagicalRecord flow against an in-memory store using the raw Objective-C API bridged into Swift:

  1. MagicalRecord.setupCoreDataStackWithInMemoryStore()
  2. create a Person entity and populate it
  3. save synchronously to the persistent store
  4. 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.

Run / verify

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"'