I guess we all would agree that this should be provided by the system so that there is no need of writing some transformation layer from UIColor to Swift.Color.
Meanwhile, I created a swift package that provides all the available colors for SwiftUI. To do this, I used UIColor documentation and transformed it with some regexes. Under the hood, it does the conversion like: Color(UIColor.secondaryLabel)
You can easily add it to your project as a SwiftPM dependency in Xcode from GitHub: https://github.com/diniska/swiftui-system-colors. Let me know your thoughts about that.
Post
Replies
Boosts
Views
Activity
I believe I've identified a solution to the issue. When exporting icons from Sketch as PNGs, ensure that the "Save for Web" checkbox is unchecked. Otherwise, Sketch removes metadata from the file, and Xcode doesn't recognize it as Display P3. You may need to click the "Show Options" button to access this checkbox
This happens to me when I use side bar menu on iPad. When I tap on an active side bar item second time the app crashes.
I fixed the crash by checking if the view controller is already on screen like this:
if splitViewController.viewController(for: .secondary) != selectedViewController {
splitViewController.setViewController(nil, for: .secondary)
splitViewController.setViewController(selectedViewController, for: .secondary)
}
I hope this information might help someone to fix the issue in similar situation.