How can I encode/decode a Swift dictionary with Obj-C objects as keys to and from JSON?
I have a Dictionary<ObjcType, SwiftType>
that I have to serialize to and deserialize from JSON. SwiftType
conforms to Codable
. ObjcType
is a class written in Objective-C (used by one of the libraries I heavily depend on, so cannot change it to be in Swift). All properties of ObjcType
are either NSString
or BOOL
.
Swift: how to encode-decode a Swift dictionary with obj-C class as keys to and from JSON?
I have a Dictionary<ObjcType, SwiftType> that I have to serialise to and deserialise from JSON. SwiftType conforms to Codable. ObjcType is a class written in Objective-C (used by one of the libraries I heavily depend on, so cannot change it to be in Swift). All properties of ObjcType are either NSString or BOOL.
How can I mock an Objective-C class from Swift code for unit testing?
I’m trying to unit test a Swift class that depends on an Objective-C class. Call these SwiftClass
and ObjcClass
.
How can I mock an Objective-C class from Swift code for unit testing?
I’m trying to unit test a Swift class that depends on an Objective-C class. Call these SwiftClass
and ObjcClass
.