3 ms·
They're adding it to Objective-C now to make it interop better with Swift. Objective-C classes have Swift interfaces automatically generated so you can call th
by potatolicious 11y ago
They're adding it to Objective-C now to make it interop better with Swift.
Objective-C classes have Swift interfaces automatically generated so you can call them from Swift code. Up until now this has been pretty shitty, since Swift is overall a stricter language than Obj-C. e.g., calls in Swift can enforce a return value to be non-nil, but Obj-C cannot, therefore all Obj-C-Swift interfaces leaves these values in an unknown nullable state even if the code itself makes guarantees on nilness.
The "nice" bits being added allow proper generation of Swift interfaces so that Swift code calling Obj-C code doesn't lose type safety (or nil-safety).