API Design Guidelines

To facilitate use as a quick reference, the details of many guidelines can be expanded individually. Details are never hidden when this page is printed.

Table of Contents

Introduction

Delivering a clear, consistent developer experience when writing Swift code is largely defined by the names and idioms that appear in APIs. These design guidelines explain how to make sure that your code feels like a part of the larger Swift ecosystem.

Fundamentals

Naming

Promote Clear Usage

Strive for Fluent Usage

Use Terminology Well

Term of Art
noun - a word or phrase that has a precise, specialized meaning within a particular field or profession.

Conventions

General Conventions

Parameters

func move(from **start**: Point, to **end**: Point)

Argument Labels

func move(**from** start: Point, **to** end: Point)
x.move(**from:** x, **to:** y)

Special Instructions