Skip to content

Example app: adapt to iPhone Duo - #17

Merged
Lakr233 merged 3 commits into
mainfrom
duo/adaptive-layout
Oct 17, 2026
Merged

Lakr233 merged 3 commits into
mainfrom
duo/adaptive-layout

Conversation

@Lakr233

@Lakr233 Lakr233 commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Adapts the CENFC example app to iPhone Duo, following iphone-duo-skills. Library code is untouched; every change is under Example/.

What changes

  • Two columns on the inner display. Scanner, Dump, NDEF and Passport use a UISplitViewController (.doubleColumn, .oneBesideSecondary, .tile): list on the leading side, details beside it, with a "Select a record to see its details." placeholder. On the outer display (compact width) it collapses to the usual single stack. Tools stays a plain stack.
  • State survives folding. A record open in the details column is kept when the split collapses (fold) and moved back into the details column when it expands (unfold). Deleting the open record puts the placeholder back.
  • Details column layout. Stack screens shown there are pinned to the horizontal safe area so their rows don't sit under the list column.
  • Empty-state text re-measures its wrap width when its column changes size (it stayed wrapped to a narrow strip after unfolding).
  • Welcome sheet is placed on the leading side (preferredPlacement = .leading, iOS 27+) and capped at 440pt wide there, so it and Get Started stay clear of the fold. The feature list flashes its scroll indicator so a short (half-open) sheet shows it scrolls.
  • Bars: edit-mode Delete moved into the trailing group; Logs and NDEF menus are real menu bar items; popovers (export, delete confirmations) anchor to the bar item or row that opened them; icon-only bar items also carry a title so they survive in a vertical bar/overflow.
  • Routing: open-URL handling in SceneDelegate finds the list inside the split.
  • Strings added to Localizable.xcstrings (en + zh-Hans). Layout uses SnapKit. No device sizes or fold position are hard-coded.

Verified (iPhone Duo simulator only)

  • Built with Xcode 27.1 RC (macos-xcode-beta), run on the iPhone Duo simulator.
  • Unit tests: 113 tests in 38 suites pass on Xcode 27.0 (default SDK), so nothing needs the 27.1 SDK to compile.
  • Open: list + details split; NDEF editor in the details column is clear of the list; welcome sheet in the leading half, clear of the fold.
  • Half open: split holds; welcome sheet stays in the leading half.
  • Closed: single stack with a back button; the open NDEF editor survives closed -> open.
  • Edit mode: Delete sits in the trailing group; its confirmation popover anchors to the trash button; deleting the open record resets the details column.
  • Empty-list hint re-wraps correctly after closed -> open.

Not verified

  • Any physical device, other iPhones, iPad, Mac Catalyst.
  • Real NFC scanning, card dumps and passport reads (no NFC on the simulator), so Scanner/Dump/Passport details were not exercised with real records; NDEF was.
  • Import from file, export popovers on Scanner/Dump/Passport rows, and the Logs menu popover.
  • Right-to-left layout and large Dynamic Type sizes.

- List tabs (Scanner, Dump, NDEF, Passport) use a two-column split: list on
  the leading side, details beside it on the open or half-open inner display;
  a single stack on the outer display. Open details survive folding.
- Detail-column stack screens stay inside the safe area, clear of the list.
- Empty-state text re-wraps when its column changes width.
- The welcome sheet is placed on the leading side and narrowed to stay clear
  of the fold; the feature list flashes its scroll indicator.
- Popovers anchor to their bar items; bar items keep accessibility labels.
- Tests cover the split wiring and fold collapse.
UISheetPresentationController.preferredPlacement is not in the iOS 26 SDK
that GitHub CI builds with, so the example app failed to compile there.
1.1.2 is already on the App Store; 2.0.0 matches the library tag.
@Lakr233
Lakr233 merged commit 271bc2b into main Oct 17, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant