Wrapping Up
You’ve now learned about ways to declare and refine APIs. APIs may be consumed by your own types or they may play a role in a shared module with nuanced visibility. The quality and expressiveness of your shared functionality and the readability of call sites accessing that functionality play important roles in Swift design.
In reading this chapter, you’ve explored the notion of Swift design hierarchy and how nested types and functions play a large role in limiting an API’s visible surface area. In Swift, a well-considered smaller API surface is preferred to a more expansive one. Access control and careful selection minimize development and maintenance costs to provide a highly curated API experience.
You’ve discovered why custom operators ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access