@objc
final class User: RealmSwift.Object, Mappable {
var id: Int = -1
var name: String = ""
required convenience init?(map: Map) {
self.init()
}
init(_ map: Map) {
id <- map["id"]
name <- map["name"]
}
}
What you did:
let users = Mapper<User>().mapArray(JSONString: string)
What you expected:
I exepected something like:
[User]
What you got:
The crash happens when the unit test calls Mapper<User>(), I tried to replace it with Mapper<User>(shouldIncludeNilValues: true) and tried to remove final from the class User but no success.
Xcode: 12.4
Cocoapods: 1.10.1 (It's not using use_frameworks! nor use_modular_headers!)
Swift: 5.3.2
Your JSON dictionary:
Your model:
What you did:
What you expected:
I exepected something like:
What you got:
The crash happens when the unit test calls
Mapper<User>()
, I tried to replace it withMapper<User>(shouldIncludeNilValues: true)
and tried to removefinal
from the classUser
but no success.Xcode: 12.4 Cocoapods: 1.10.1 (It's not using
use_frameworks!
noruse_modular_headers!
) Swift: 5.3.2