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. The bridging goes in both directions: Swift can call ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.