Repository navigation
- onboarding pages - #15
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an onboarding flow to guide users through best practices before using the scorecard camera UI, both in the demo iOS app and in the ScorecardCamUI SwiftPM target.
Changes:
- Introduces a paged
OnboardingViewwith scan tips (icons + title + description) in both the demo app and the SDK UI target. - Updates the demo app’s
ContentViewto show onboarding before requesting camera permission. - Updates
ScorecardCameraViewto show onboarding before the camera experience.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| iosApp/iosApp/OnboardingView.swift | New onboarding UI for the demo app (paged tips, skip/get started). |
| iosApp/iosApp/ContentView.swift | Routes “Launch Camera” into onboarding first, then permission request. |
| Sources/ScorecardCamUI/ScorecardCameraView.swift | Shows onboarding before presenting the camera UI flow. |
| Sources/ScorecardCamUI/OnboardingView.swift | New onboarding UI inside the SwiftPM ScorecardCamUI target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| struct OnboardingPage { | ||
| let icon: String | ||
| let title: String | ||
| let body: String | ||
| } |
There was a problem hiding this comment.
OnboardingPage is only used within this file; consider making it private (as in the demo app’s version) to avoid exporting an extra internal symbol from the ScorecardCamUI module.
| @@ -184,6 +188,7 @@ public struct ScorecardCameraView: View { | |||
| Text(uploadAlertMessage) | |||
| } | |||
| .persistentSystemOverlays(.hidden) | |||
| } // end else (onboarding dismissed) | |||
There was a problem hiding this comment.
Because the onboarding is implemented as an if/else, the view modifiers currently attached to the camera branch (.onAppear { viewModel.checkPermission(); lockToLandscape(); ... }, .onDisappear { ... }, and .persistentSystemOverlays(.hidden)) do not run/apply while onboarding is visible. This changes behavior (e.g., onboarding can be shown in portrait despite the “Hold in Landscape” guidance, and overlays may remain visible until dismiss). If you want those behaviors during onboarding too, apply the modifiers outside the conditional (wrap branches in a Group) or move the orientation/overlay logic to a parent container so it runs regardless of which branch is active.
| 8000 | .onAppear { | |
| UIPageControl.appearance().currentPageIndicatorTintColor = .white | ||
| UIPageControl.appearance().pageIndicatorTintColor = UIColor.white.withAlphaComponent(0.3) | ||
| } |
There was a problem hiding this comment.
UIPageControl and UIColor are used in this file but UIKit isn’t imported, which will fail to compile. Add import UIKit (or wrap in #if canImport(UIKit) and import conditionally) before using these types.
| .onAppear { | ||
| UIPageControl.appearance().currentPageIndicatorTintColor = .white | ||
| UIPageControl.appearance().pageIndicatorTintColor = UIColor.white.withAlphaComponent(0.3) | ||
| } |
There was a problem hiding this comment.
UIPageControl and UIColor are referenced without importing UIKit, which will not compile for this SwiftPM target. Add import UIKit (or conditional #if canImport(UIKit) import) to this file.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Onboarding steps for taking better pictures