Hacker News new | past | comments | ask | show | jobs | submit login

No it hasn't.

Optional is a Swift type that contains a value of any type. Obj-C doesn't have anything matching that behavior at all.

What's been done here is Obj-C has gained the ability to annotate any pointer valued type as either nullable or non-nullable. This does not affect the runtime behavior of the code in the slightest. It doesn't even affect the semantics of Obj-C. All it does for Obj-C is let the compiler yell at you if you pass nil to a non-nullable parameter / property.

The real point of these annotations is so Swift can be more intelligent when translating the obj-c API to Swift, choosing to use the correct optional type (or no optional type at all).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: