SimRa iOS - SwiftUI - #83
Open
Lime1887 wants to merge 8 commits into
Open
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
…gration von Kurzbefehle und Live Aktivität
…trip tracking - Migrate core models, views, and managers to Swift - Add Live Activities and SwiftUI widgets for active trip monitoring - Implement AppIntents and Siri shortcut integration for recording control - Add interactive user hazard tracking during rides and map route visualization - Clean up framework caches and obsolete bridging headers
…trip tracking - Migrate core models, views, and managers to Swift - Add Live Activities and SwiftUI widgets for active trip monitoring - Implement AppIntents and Siri shortcut integration for recording control - Add interactive user hazard tracking during rides and map route visualization - Clean up framework caches and obsolete bridging headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: SwiftUI Modernization, Core Models, & Live Activities
Overview
This pull request continues the comprehensive modernization of the SimRa iOS application by migrating core Objective-C data models, region managers, and upload systems completely to Swift, while introducing robust Live Activity support, modern SwiftUI navigation structures, updated Bluetooth components, deep iOS system integration, and a redesigned App Icon adhering to the latest Apple design guidelines.
Key Changes & Component Breakdown
1. Model Modernization & Swift Porting
Replaced legacy
.h/.mimplementation pairs with native Swift classes utilizing@objcMembersto ensure seamless interoperability with remaining Objective-C modules.News.swift: Reimplemented news fetching and version parsing logic, handling network requests viaURLSession, response evaluation, and local version persistence.Region.swift&Regions.swift: Converted region management, localization helpers, coordinate handling, and distance calculations into clean Swift, leveraging JSON dataset parsing with safe fallbacks to legacy plist structures.Trip.swift& Related Models: Completely transitioned the heavy trip data layer (Trip.swift,TripModels.swift) from Objective-C to modern Swift structures to improve memory safety and performance during route processing.UploaderObject.swift: Modernized data upload routines, handling multipart/file uploads viaURLSessionand secure SSL certificate pinning through the Security framework (SecTrustEvaluateWithError).IdPicker.swift: Added a clean SwiftUI component for selection workflows.2. SwiftUI Views & Architecture Modernization
SimRaApp.swift): Migrated the app initialization to the modern SwiftUI@mainlifecycle model, integratingWindowGroup,AppDelegatebridging, and custom URL scheme handling (simra://) for deep links.OBSConfigView.swift& ViewModel): Rewrote the Bluetooth configuration module using a@MainActor-isolatedObservableObjectand a reactive CoreBluetooth wrapper to handle asynchronous peripheral discovery and telemetry displays.ModernRecordActionButton.swift): Introduced a custom recording action button with advanced SwiftUI styling, spring animations, and native accessibility traits.SimRaHazardMapView.swift): Embedded the web-based SimRa hazard map via a performantUIViewRepresentablewrapper aroundWKWebViewwith custom navigation delegation.TripDetailView.swift&TripSettingsView.swift): Converted table layouts into native SwiftUIFormstructures supporting unsaved changes tracking via.onChangeand persistent preferences via@AppStorage.3. Live Activity & Dynamic Island Integration (
SimRaRecordingActivityManager.swift)Introduced full support for iOS 16.2+ Live Activities via
ActivityKitto display real-time trip metrics on the Lock Screen and Dynamic Island.SimRaRecordingAttributes).SimRaRecordingActivityManager+Enhanced.swift) to dynamically push live route coordinate buffers and increment recorded hazard counters during active bike rides.4. Utility Extensions & Charting Modules
NSString+hashCode.swift): Implements a Swift extension replicating Java/Objective-C UTF-16 string hashing algorithms for consistent backend client identifier generation.NSTimeInterval+hms.swift): Adds clean formatting extensions toTimeIntervalfor structured human-readable duration outputs.Technical Notes & Architectural Decisions
@objcand@objcMembersattributes on migrated model classes to prevent breaking integration points with existing legacy database controllers or delegates.@MainActorand leveragingasync/await.