Post

Replies

Boosts

Views

Activity

Reply to New UI Element colors in SwiftUI
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.
Feb ’21
Reply to UINavigationBar layoutSubviews crash
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.
Oct ’24