Closed bilsou closed 5 years ago
That behavior is by-design. What were you expecting instead? I don't know of another obvious way to represent an optional enum in Objective-C in a safe way. Boxed types allow nullability, and and NSNumber is expected way to box enums in Objective-C.
Apologies, I have been using Swift full-time lately and I just forgot that an NSEnum
cannot be nullable on Obj-C contrarily to a Swift enum
. It is a pain, but nothing Djinni can do about indeed.
Thanks again
Yeah, direct bridging to Swift would be a nice feature add now that ObjC is on its way out, but I don't know of anyone currently putting the the effort into that for Djinni.
When using a Djinni's
optional<enum>
in arecord
type, the generated Objective-C property becomes anNSNumber
generates on ObjC
After some digging, it might be related to line 118 in
ObjcMarshal.scala
but I might have been mistakenAny help would be much appreciated