How would we define the following in swift programming language :
In other words, what would be the swift equivalent of each of these objective c terms. Besides, would also like to know whether any specific use cases exist for non objective c types like structs and enums. Thanks in advance.
Regarding equivalents:
NULL
has no equivalent in Swift. nil
is also called nil
in SwiftNil
has no equivalent in Swift[NSNull null]
can be accessed in Swift as NSNull()Note: These are my guesses based on reading and play. Corrections welcome.
But nil/NULL handling in Swift is very different from Objective C. It looks designed to enforce safety and care. Read up on optionals in the manual. Generally speaking a variable can't be NULL at all and when you need to represent the "absence of a value" you do so declaratively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With