Defining and Adopting Protocols

  • Scott Gardner


Swift is predominantly a protocol-based language. Protocols are also prevalent in Objective-C, frequently used with the delegation design pattern—although there has been a gradual shift from protocol/delegate to block-based usage in recent years. A protocol is simply a contract that defines requirements that the adopting type agrees to implement. This chapter will compare how Objective-C and Swift similarly utilize protocols, pointing out the differences in syntax and examining the broadened usage, new capabilities, and specific caveats of using protocols in Swift.


Angle Bracket Additional Protocol Instance Method Protocol Type Specific Caveat 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Scott Gardner 2014

Authors and Affiliations

  • Scott Gardner
    • 1
  1. 1.NYUS

Personalised recommendations