Using Cocoa data types
So far, in this chapter, we have looked at several native Swift data types, such as the string, array, and dictionary types. While using these types is definitely preferred, as part of the Objective-C interoperability, Apple has provided convenient and effective ways to work with Cocoa data types from within our Swift applications.
Some of the Cocoa and Swift data types can be used interchangeably, while others are automatically converted between Cocoa and Swift data types. Those data types that can be used interchangeably or converted are called bridged data types.
Swift also provides an overlay for working with Foundation data types. This lets us work with Foundation data types in a way that feels more like native Swift ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access