Swift 6 compliance: @main entry, @MainActor isolation and MetalBuffer safety improvements #4
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.
Summary
This change modernizes the app’s entry point and ensures concurrency safety under Swift 6 by introducing @mainactor isolation to key components.
Changes
• Replaced @UIApplicationMain with @main for a clean Swift-based entry point.
• Applied @mainactor isolation to ViewController, TaskDelegate, and related rendering logic.
• Validated safe usage of CVMetalTexture under @preconcurrency isolation.
• Modernized Info.plist: removed deprecated UIRequiresFullScreen and aligned supported orientations.
• Improved MetalBuffer APIs for Swift 6 compliance: element-typed assign methods, safer array initializer, resource option honoring, and safe raw copy logic.
• Left harmless warnings for simd_float matrix Codable conformance (expected until SDK provides native support).
Testing
• Verified build and runtime stability under Xcode 16 / iOS 26 SDK (Swift 6).
• Ensured consistent rendering output with and without @mainactor isolation.
• Confirmed no regressions in texture handling or orientation behavior.
Notes
These updates bring the project in line with modern Swift concurrency and Metal safety guidelines, eliminating deprecated constructs and potential concurrency pitfalls.