Closed widavies closed 5 years ago
@wdavies973 Did you end up getting this to work? Running into a similar issue.
@JackIrish no, haven't been able to get it to work.
Seems to work just fine (tested in Xcode 9.4.1 and 10.1)
The same problem (swift 5, iOS 12). If array type isn't nill = all fine. Works:
final class MarketMap: ImmutableMappable {
let outcomes: [OutcomeMap]
required init(map: Map) throws {
do {
outcomes = try map.value("outcomes")
} catch let error {
print(error)
throw error
}
}
}
NOT Works:
final class MarketMap: ImmutableMappable {
let outcomes: [OutcomeMap]?
required init(map: Map) throws {
do {
outcomes = try? map.value("outcomes")
} catch let error {
print(error)
throw error
}
}
}
I believe this has been addressed in the latest release
Your model:
What you did:
What you expected:
I expected a JSON output of RForm
What you got:
print(JSONString) just prints nil