protocol oriented programming
Asked on 06/20/2025
1 search
Protocol-oriented programming is a key concept in Swift, which emphasizes the use of protocols to define a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality. Protocols can be adopted by classes, structs, and enums, allowing for a flexible and reusable code design.
In the session titled A Swift Tour: Explore Swift’s features and design, protocols are discussed as a more general way to build abstractions compared to inheritance, and they work equally well with both value and reference types. A protocol is an abstract set of requirements for a type, and a type conforms to a protocol by providing implementations of all the requirements. This session also highlights how extensions can be used to add methods, properties, and protocol conformances to any type, regardless of where that type is defined.
If you're interested in learning more about how protocols are used in Swift, you might want to check out the chapter on protocols in the session A Swift Tour: Explore Swift’s features and design.

Use structured concurrency with Network framework
Network framework is the best way to make low-level network connections on Apple platforms — and in iOS, iPadOS, and macOS 26, it’s a perfect fit for your structured concurrency code. We’ll explore how you can make connections, send and receive data and framed messages, listen for incoming connections, and browse the network for services. We’ll also cover key best practices along the way.

A Swift Tour: Explore Swift’s features and design
Learn the essential features and design philosophy of the Swift programming language. We’ll explore how to model data, handle errors, use protocols, write concurrent code, and more while building up a Swift package that has a library, an HTTP server, and a command line client. Whether you’re just beginning your Swift journey or have been with us from the start, this talk will help you get the most out of the language.

Explore Swift performance
Discover how Swift balances abstraction and performance. Learn what elements of performance to consider and how the Swift optimizer affects them. Explore the different features of Swift and how they’re implemented to further understand the tradeoffs available that can impact performance.