A Swift library providing syntactic sugar for object initialization and configuration using closures.
Then is a Swift library that provides syntactic sugar for initializing and configuring objects using closure-based syntax. It solves the problem of verbose object setup code by allowing developers to configure properties immediately after creation in a clean, readable way.
iOS/macOS developers working with Swift who want to write cleaner, more expressive initialization code, particularly when dealing with UIKit components or custom NSObject subclasses.
Developers choose Then because it eliminates boilerplate initialization code, makes object configuration more readable, and integrates seamlessly with existing Swift patterns without requiring significant changes to code structure.
✨ Super sweet syntactic sugar for Swift initializers
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Reduces boilerplate code by allowing property configuration in a trailing closure, making Swift code more readable, as shown in the UILabel example from the README.
Works out-of-the-box with all NSObject subclasses like UIKit components, requiring no additional setup for common iOS development tasks.
Easily extend your own types by conforming to the Then protocol, enabling the same clean syntax for custom objects, as demonstrated in the tips section.
Provides the `with()` method to create modified copies of value types like CGRect, avoiding mutability issues in Swift, as highlighted in the README examples.
Primarily designed for UIKit and NSObject, so it doesn't integrate well with SwiftUI's declarative syntax, limiting its relevance in modern iOS development trends.
Adds a third-party library for functionality that can be replicated with standard Swift closures or computed properties, which might not be justified in lightweight projects.
Over-reliance on the closure syntax can lead to less readable code if developers nest configurations excessively, contrary to Swift's emphasis on clarity.