Make UIColor Codable

If you care only about the 4 color components this is a simple solution using a wrapper struct struct Color : Codable { var red : CGFloat = 0.0, green: CGFloat = 0.0, blue: CGFloat = 0.0, alpha: CGFloat = 0.0 var uiColor : UIColor { return UIColor(red: red, green: green, blue: blue, alpha: alpha) … Read more

Swift 4 Conversion error – NSAttributedStringKey: Any

Why you got this error Previously, your attributes is defined as [String: Any], where the key comes from NSAttributedStringKey as a string or NSAttributedString.Key in Swift 4.2 During the migration, the compiler tries to keep the [String: Any] type. However, NSAttributedStringKey becomes a struct in swift 4. So the compiler tries to change that to … Read more

How to fix “Read-Write-Data Sandbox: error when using Mac Catalyst

MasterChief96, you are not alone. Here is my setup: MacOS 10.15.3 Xcode 11.4.1 I create a brand new SwiftUI “Hello World” project, enable Mac as a target device, a.k.a. Catalyst. I set the iOS deployment target to 13.2 (otherwise I get a MacOS runtime error saying I need Catalina 10.15.4) Set the scheme to “My … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)