Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Swift Result Builders for `Array` and `Set`

## Overview

Creating or modifying arrays and sets using [result builders](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/advancedoperators#Result-Builders) allows for inline logic such as `if/else`, `switch`, `for` loops and availability checking. Also commas are not needed to separate elements.
Creating or modifying arrays and sets using [result builders](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/advancedoperators#Result-Builders) allows for inline control statements such as `if`/`else`, `switch`, `for` loops and availability checking. Additionally, commas are not used to separate collection elements, yielding cleaner syntax than array and set literals.

When used with [Combine](https://developer.apple.com/documentation/combine) for example, the result builder may be used to add `AnyCancellable` instances to a `Set` without calling `store(in:)` on each instance individually.

Expand Down Expand Up @@ -52,15 +52,22 @@ mutating func insert(@Builder elements: () -> Self)
func inserting(@Builder elements: () -> Self) -> Self
```

## Minimum Requirements
## Installation

### Swift Package Collection

- iOS `13.0`
- Swift `5.8`
<details><summary>Expand / Collapse</summary><br>

## Installation
```
https://swiftpackageindex.com/Tinder/collection.json
```

</details>

### Swift Package Manager

<details><summary>Expand / Collapse</summary><br>

**Package Dependency**

> Replace `<version>` with the desired minimum version.
Expand All @@ -71,16 +78,30 @@ func inserting(@Builder elements: () -> Self) -> Self

**Target Dependency**

```
```swift
"CollectionBuilders"
```

### Swift Package Collection
</details>

```swift
https://swiftpackageindex.com/Tinder/collection.json
### Xcode

<details><summary>Expand / Collapse</summary><br>

**Package Dependency**

```
https://github.com/Tinder/CollectionBuilders.git
```

**Target Dependency**

```
CollectionBuilders
```

</details>

## Supported Types

The `Array` and `Set` result builders may be used with any `Element` type.
Expand Down