26 Your First Cocoa Application

One of Swift’s most compelling features is its ability to interact with Objective-C, the language in which Mac and iOS apps have traditionally been written. We are not going to cover the full story of how the two languages live side by side in one app, but the next three chapters will give you a taste. Swift makes it possible to use Objective-C libraries like Cocoa, the native API for developing desktop Mac apps.

Swift is able to talk to Cocoa (and other Objective-C frameworks) using techniques broadly described as bridging. Bridging is the process by which a function or instance in one language can be called from or given to the other language. Bridging goes in both directions: Swift can call Objective-C ...

Get Swift Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.