How william-baldwin-paradox/oliviacemsplashanimation works
Project type and purpose
• Type: iOS UI component/library built with SwiftUI.
• Purpose: Provide a production-ready splash screen animation (using Rive) that transitions into a login UI.
Main components
a. App Entry (SwiftUI App struct)
b. Splash Module
– SplashView (SwiftUI View)
– SplashViewModel (business logic + state)
– SplashConstants (configuration & magic numbers)
c. Login Module
– LoginView (SwiftUI View)
d. Shared UI Components
– Custom Button, InputField, Toggle, AppColors, AnimationProgressEnvironment
e. Resources
– Asset Catalog (Assets.xcassets)
– Rive File (olivia-cem-splash-prod.riv)
f. External Framework
– RiveRuntime.xcframework
Relationships and data flow
• The App Entry → injects topSafeArea into SplashView.
• SplashView ↔ binds to SplashViewModel (two‐way: view reads published state; viewModel receives animation events).
• SplashView → loads RiveRuntime.xcframework → renders .riv file, fires “logoDelta” events.
• SplashViewModel → monitors initializationPercent input, listens for events, updates “showLogin” state.
• When “logoDelta” fires → SplashViewModel toggles flag → SplashView transitions to LoginView.
• Shared Components → used by both SplashView and LoginView for styling and controls.
Architectural patterns and design principles
• MVVM: clear View / ViewModel separation.
• Environment injection: animation progress via AnimationProgressEnvironment.
• Constants centralization: SplashConstants.
• Thread safety: @MainActor annotations, Task usage.
• Error handling & fallback: Rive load failures trigger fallback UI in SplashView.
Technologies & frameworks
• SwiftUI (iOS 17+)
• Rive iOS Runtime v6.7.4 (xcframework or SPM)
• SwiftLint (build‐time quality checks)