# devxoul/then

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/devxoul-then).**

4,394 stars · 300 forks · Swift · MIT

## Links

- GitHub: https://github.com/devxoul/Then
- awesome-repositories: https://awesome-repositories.com/repository/devxoul-then.md

## Description

Then is a syntactic sugar library for Swift that provides closure-based extensions for configuring objects and value types. It enables the assignment of multiple properties within a single block to reduce repetitive variable naming during initialization and modification.

The library functions as both an object configuration tool and a value type modifier. It allows for the creation of modified copies of structs and enums by applying specific changes inside a scoped closure.

These utilities support declarative workflows for defining user interface component properties and managing complex view hierarchies.

## Tags

### Programming Languages & Runtimes

- [Swift Object Configuration Utilities](https://awesome-repositories.com/f/programming-languages-runtimes/swift-object-configuration-utilities.md) — Setting multiple properties on a Swift object immediately after creation to avoid repeating the variable name.
- [Shadow Copying](https://awesome-repositories.com/f/programming-languages-runtimes/shadow-copying.md) — Creates temporary mutable copies of structs to apply changes before returning a new value.
- [Syntactic Sugar Libraries](https://awesome-repositories.com/f/programming-languages-runtimes/syntactic-sugar-libraries.md) — Provides closure-based extensions to make initializing and configuring Swift objects and value types more concise.
- [Value Type Modifiers](https://awesome-repositories.com/f/programming-languages-runtimes/value-type-modifiers.md) — Offers a utility for creating modified copies of value types by applying changes inside a scoped closure.
- [Value Type Mutation Utilities](https://awesome-repositories.com/f/programming-languages-runtimes/value-type-mutation-utilities.md) — Enables the creation of modified copies of value types by applying changes within a closure. ([source](https://github.com/devxoul/then#readme))
- [Swift Development Tooling](https://awesome-repositories.com/f/programming-languages-runtimes/swift-development-tooling.md) — Acts as a development utility to improve the ergonomics of object configuration in Swift.
- [Type-Erasure Wrappers](https://awesome-repositories.com/f/programming-languages-runtimes/type-erasure-wrappers.md) — Employs a design that remains compatible across both reference and value type semantics.

### Software Engineering & Architecture

- [Object Configuration Utilities](https://awesome-repositories.com/f/software-engineering-architecture/object-configuration-utilities.md) — Provides a utility for configuring multiple properties on objects within a closure immediately after instantiation. ([source](https://github.com/devxoul/then#readme))
- [Closure-Based Property Mutations](https://awesome-repositories.com/f/software-engineering-architecture/closure-based-property-mutations.md) — Implements a closure-based pattern for grouped property updates to reduce variable repetition during object configuration.
- [Protocol Extensions](https://awesome-repositories.com/f/software-engineering-architecture/extensibility-patterns/protocol-extensions.md) — Uses Swift protocol extensions to add configuration methods across all compatible types.
- [Fluent Interfaces](https://awesome-repositories.com/f/software-engineering-architecture/fluent-interfaces.md) — Provides a generic self-returning interface that enables chaining multiple configuration blocks.

### Mobile Development

- [Swift UI Layout Development](https://awesome-repositories.com/f/mobile-development/swift-ui-layout-development.md) — Supports declarative workflows for defining complex view hierarchies and component properties in Swift UI.

### Part of an Awesome List

- [General Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/general-utilities.md) — Syntactic sugar for initializers.
