Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
Fix "Ambiguous use of 'init" compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
david-swift committed Jul 8, 2023
1 parent 9ffb948 commit b60360b
Show file tree
Hide file tree
Showing 58 changed files with 258 additions and 1,545 deletions.
6 changes: 0 additions & 6 deletions Documentation/Reference/ColibriComponents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,10 @@
- [CGFloat](extensions/CGFloat.md)
- [ClosedRange](extensions/ClosedRange.md)
- [Color](extensions/Color.md)
- [CommandMenu](extensions/CommandMenu.md)
- [Comparable](extensions/Comparable.md)
- [Double](extensions/Double.md)
- [Int](extensions/Int.md)
- [Label](extensions/Label.md)
- [Menu](extensions/Menu.md)
- [Picker](extensions/Picker.md)
- [Range](extensions/Range.md)
- [Section](extensions/Section.md)
- [TextField](extensions/TextField.md)
- [View](extensions/View.md)

This file was generated by [SourceDocs](https://github.com/eneko/SourceDocs)
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,13 @@

# `ArrayBuilder.Component`

```swift
public enum Component
```

A component used in the ``ArrayBuilder``.

## Cases
### `element(_:)`

```swift
case element(_: Element)
```

An element as a component.

### `components(_:)`

```swift
case components(_: [Self])
```

An array of components as a component.
84 changes: 0 additions & 84 deletions Documentation/Reference/ColibriComponents/enums/ArrayBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

# `ArrayBuilder`

```swift
public enum ArrayBuilder<Element>
```

The ``ArrayBuilder`` is a simple result builder that outputs an array of any type.

You can define any array using Swift's DSL:
Expand All @@ -26,128 +22,48 @@ You can define any array using Swift's DSL:
## Methods
### `buildBlock(_:)`

```swift
public static func buildBlock(_ elements: Component...) -> Component
```

Build combined results from statement blocks.
- Parameter components: The components.
- Returns: The components in a component.

#### Parameters

| Name | Description |
| ---- | ----------- |
| components | The components. |

### `buildExpression(_:)`

```swift
public static func buildExpression(_ element: Element) -> Component
```

Translate an element into an ``ArrayBuilder.Component``.
- Parameter element: The element to translate.
- Returns: A component created from the element.

#### Parameters

| Name | Description |
| ---- | ----------- |
| element | The element to translate. |

### `buildExpression(_:)`

```swift
public static func buildExpression(_ component: Component) -> Component
```

Fetch a component.
- Parameter component: A component.
- Returns: The component.

#### Parameters

| Name | Description |
| ---- | ----------- |
| component | A component. |

### `buildOptional(_:)`

```swift
public static func buildOptional(_ component: Component?) -> Component
```

Enables support for `if` statements without an `else`.
- Parameter component: An optional component.
- Returns: A nonoptional component.

#### Parameters

| Name | Description |
| ---- | ----------- |
| component | An optional component. |

### `buildEither(first:)`

```swift
public static func buildEither(first component: Component) -> Component
```

Enables support for `if`-`else` and `switch` statements.
- Parameter component: A component.
- Returns: The component.

#### Parameters

| Name | Description |
| ---- | ----------- |
| component | A component. |

### `buildEither(second:)`

```swift
public static func buildEither(second component: Component) -> Component
```

Enables support for `if`-`else` and `switch` statements.
- Parameter component: A component.
- Returns: The component.

#### Parameters

| Name | Description |
| ---- | ----------- |
| component | A component. |

### `buildArray(_:)`

```swift
public static func buildArray(_ components: [Component]) -> Component
```

Enables support for `for..in` loops.
- Parameter components: The components as a two dimensional array.
- Returns: The components as a one dimensional array.

#### Parameters

| Name | Description |
| ---- | ----------- |
| components | The components as a two dimensional array. |

### `buildFinalResult(_:)`

```swift
public static func buildFinalResult(_ component: Component) -> [Element]
```

Convert a component to an array of elements.
- Parameter component: The component to convert.
- Returns: The generated array of elements.

#### Parameters

| Name | Description |
| ---- | ----------- |
| component | The component to convert. |
20 changes: 0 additions & 20 deletions Documentation/Reference/ColibriComponents/enums/Color.RGBA.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,21 @@

# `Color.RGBA`

```swift
internal enum RGBA
```

The values of an RGBA representation (red, green, blue and alpha).

## Cases
### `red`

```swift
case red
```

The red RGBA value.

### `green`

```swift
case green
```

The green RGBA value.

### `blue`

```swift
case blue
```

The blue RGBA value.

### `alpha`

```swift
case alpha
```

The alpha RGBA value.
20 changes: 0 additions & 20 deletions Documentation/Reference/ColibriComponents/enums/UndoProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

# `UndoProvider`

```swift
public enum UndoProvider
```

Register undo and redo actions.

An example implementation with a view model:
Expand All @@ -22,25 +18,9 @@ An example implementation with a view model:
## Methods
### `registerUndo(withTarget:undoManager:set:)`

```swift
public static func registerUndo<TargetType>(
withTarget target: TargetType,
undoManager: UndoManager? = NSApplication.shared.keyWindow?.undoManager,
set: @escaping (TargetType) -> Void
) where TargetType: AnyObject
```

Registers the undo and redo actions.
Thanks to Matthaus Woolard for the article "Handling undo & redo in SwiftUI".
- Parameters:
- target: The target object, usually the observable object with the property.
- undoManager: If you do not want to use the key window's undo manager, specify one here.
- set: The closure that assigns the old value to the property.

#### Parameters

| Name | Description |
| ---- | ----------- |
| target | The target object, usually the observable object with the property. |
| undoManager | If you do not want to use the key window’s undo manager, specify one here. |
| set | The closure that assigns the old value to the property. |
27 changes: 0 additions & 27 deletions Documentation/Reference/ColibriComponents/extensions/Array.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,21 @@
**EXTENSION**

# `Array`
```swift
extension Array: Bindable
```

## Properties
### `body`

```swift
public var body: some View
```

The toolbar.

## Methods
### `checkIndex(_:)`

```swift
private func checkIndex(_ index: Int) -> Bool
```

Check if a given index is valid for the array.
- Parameter index: The index to test.
- Returns: Return whether the index is valid or not.

#### Parameters

| Name | Description |
| ---- | ----------- |
| index | The index to test. |

### `getIndex(id:)`

```swift
private func getIndex(id: Element.ID?) -> Int?
```

Get the index of an element with a specified identifier.
- Parameter id: The element's identifier.
- Returns: The index of the element.

#### Parameters

| Name | Description |
| ---- | ----------- |
| id | The element’s identifier. |
13 changes: 0 additions & 13 deletions Documentation/Reference/ColibriComponents/extensions/Bindable.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
**EXTENSION**

# `Bindable`
```swift
extension Bindable
```

## Methods
### `binding(_:)`

```swift
public func binding(_ set: @escaping (Self) -> Void) -> Binding<Self>
```

Convert a bindable value to a binding with a custom set clause.
- Parameter set: The function with the value as a parameter used as the set of the binding.
- Returns: The binding with the custom set behaviour.

#### Parameters

| Name | Description |
| ---- | ----------- |
| set | The function with the value as a parameter used as the set of the binding. |
Loading

0 comments on commit b60360b

Please sign in to comment.