Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StopViewController SwiftUI #648

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

StopViewController SwiftUI #648

wants to merge 11 commits into from

Conversation

ualch9
Copy link
Member

@ualch9 ualch9 commented Feb 21, 2023

Started as an experiment, but might actually build it out now. Plus, the code can be reused for Live Activities/watchOS/etc.

@ualch9
Copy link
Member Author

ualch9 commented Feb 21, 2023

Demo

  • Loading arrdeps while maintaining scroll position
  • Flashing of updated minutes label. The main view is not concerned with displaying the flash, each individual label view tracks its own contents.
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-02-21.at.21.46.16.mp4

Each arrdep uses some set of fields as its identifier. I've tried to account for it, but if there are duplicate identifiers, SwiftUI will handle it gracefully. Previously, DiffableDataSource throw an exception and crash.

The screenshot below is showing a workaround for SwiftUI's unideal behavior for list selection. In iOS 15, creating a selectable list required displaying a checkmark in the cell, which would look unusual. The correct usage was to use a NavigationLink in each cell, but that doesn't interoperate well with UIKit (which is required for TripViewController). So, I manually created selection behavior into the cell, and will use a delegate to communicate to the UINavigationController to push a TripViewController.

simulator_screenshot_82653627-46AF-4BA1-B384-FD43D0A0BA74

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