Skip to content

Glossary: SwiftUI

#require

Also written: require

A Swift Testing macro that checks a condition and stops the test immediately if it fails. Given an optional, it unwraps it like `guard let`, and needs `try`.

Where the book teaches it

Related terms

#expect@Test