Back to Browse

Swift Protocols in Use: Existential Types vs. Generic Constraints

478 views
Dec 10, 2025
9:10

Did you know there are two distinct ways to use protocols in Swift, with dramatically different performance implications? Most developers are familiar with using protocols as existential types, but it comes with a hidden cost: significant runtime overhead. The alternative—using protocols as generic constraints—is not without its own nuances, but it offers a hefty boost in performance. In this video, I guide you through both mechanisms. Whether you’re aiming for maximum performance or simply want a deeper understanding of Swift’s powerful protocol system, this episode offers the crucial insights you need. Don’t just use protocols—master them! Watch now to learn the difference between existential types and generic constraints, and start writing faster, more efficient Swift code! Support the Code Bird by… • …joining as a member: https://www.youtube.com/channel/UC3mDnPzYxvKHaMLANaiDDYQ/join • …becoming a patron: https://url.ykvm.com/patreon • …leaving a tip: https://url.ykvm.com/bmac Chapters: • 0:00 Intro • 1:03 How Protocols Typically Work • 3:01 Can They Work Faster? • 5:38 Can They Be More Flexible? • 6:42 Can We Write Less Boilerplate? • 8:17 Summary & What’s Next The Code Bird, a Yakov Manshin production 🎞️ #Swift #protocols #softwaredevelopment

Download

0 formats

No download links available.

Swift Protocols in Use: Existential Types vs. Generic Constraints | NatokHD