Skip to content

Commit 55263d3

Browse files
committed
Cleanup. Renamed: isolated() as standalone()
1 parent 9e7759e commit 55263d3

File tree

6 files changed

+24
-19
lines changed

6 files changed

+24
-19
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,11 @@ Decorative styles that modify the behavior of their content.
191191

192192
| Style | Description |
193193
|:------|:------------|
194-
| [constant()](Sources/DiffableTextKit/Styles/Constant.swift) | Prevents style transformations |
195-
| [equals(\_:)](Sources/DiffableTextKit/Styles/Equals.swift) | Binds the style's equality to a proxy |
196-
| [isolated()](Sources/DiffableTextKit/Styles/Isolated.swift) | Grants ownership of the style's cache |
197194
| [prefix(_:)](Sources/DiffableTextKit/Styles/Prefix.swift) | Adds a prefix to the style |
198195
| [suffix(_:)](Sources/DiffableTextKit/Styles/Suffix.swift) | Adds a suffix to the style |
196+
197+
| Style | Description |
198+
|:------|:------------|
199+
| [constant()](Sources/DiffableTextKit/Styles/Constant.swift) | Prevents style transformations |
200+
| [equals(\_:)](Sources/DiffableTextKit/Styles/Equals.swift) | Binds the style's equality to a proxy |
201+
| [standalone()](Sources/DiffableTextKit/Styles/Standalone.swift) | Grants ownership of the style's cache |

Sources/DiffableTextKit/DiffableTextStyle.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ public extension DiffableTextStyle {
8989
// MARK: Utilities
9090
//=------------------------------------------------------------------------=
9191

92-
@inlinable func update(_ cache: inout Cache) { cache = self.cache() }
92+
@inlinable func update(_ cache: inout Cache) {
93+
cache = self.cache()
94+
}
9395
}
9496

9597
//=----------------------------------------------------------------------------=

Sources/DiffableTextKit/Styles/Isolated.swift renamed to Sources/DiffableTextKit/Styles/Standalone.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
//=----------------------------------------------------------------------------=
99

1010
//*============================================================================*
11-
// MARK: * Isolated
11+
// MARK: * Standalone
1212
//*============================================================================*
1313

1414
/// Grants ownership of the style's cache.
1515
///
1616
/// Use this modifier to control when the cache is created and destroyed.
1717
///
18-
public struct IsolatedTextStyle<Base: DiffableTextStyle>: WrapperTextStyle {
18+
public struct StandaloneTextStyle<Base: DiffableTextStyle>: WrapperTextStyle {
1919

2020
public typealias Value = Base.Value
2121

@@ -70,15 +70,15 @@ public struct IsolatedTextStyle<Base: DiffableTextStyle>: WrapperTextStyle {
7070
// MARK: + Conditionals
7171
//=----------------------------------------------------------------------------=
7272

73-
extension IsolatedTextStyle: NullableTextStyle where Base: NullableTextStyle { }
73+
extension StandaloneTextStyle: NullableTextStyle where Base: NullableTextStyle { }
7474

7575
//*============================================================================*
76-
// MARK: * Isolated x Style
76+
// MARK: * Standalone x Style
7777
//*============================================================================*
7878

7979
public extension DiffableTextStyle {
8080

81-
typealias Isolated = IsolatedTextStyle<Self>
81+
typealias Standalone = StandaloneTextStyle<Self>
8282

8383
//=------------------------------------------------------------------------=
8484
// MARK: Transformations
@@ -88,7 +88,7 @@ public extension DiffableTextStyle {
8888
///
8989
/// Use this modifier to control when the cache is created and destroyed.
9090
///
91-
@inlinable func isolated() -> Isolated {
92-
Isolated(self)
91+
@inlinable func standalone() -> Standalone {
92+
Standalone(self)
9393
}
9494
}

Sources/DiffableTextKitXUIKit/DiffableTextField.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ public struct DiffableTextField<Style: DiffableTextStyle>: UIViewRepresentable {
106106
//=--------------------------------------------------------------------=
107107

108108
@inlinable @inline(never)
109-
func setup(_ parent: DiffableTextField, _ environment: EnvironmentValues) {
109+
func setup(_ upstream: DiffableTextField, _ environment: EnvironmentValues) {
110110
//=----------------------------------=
111111
// Upstream
112112
//=----------------------------------=
113-
self.upstream = Upstream(parent, environment)
113+
self.upstream = Upstream(upstream, environment)
114114
//=----------------------------------=
115115
// Downstream
116116
//=----------------------------------=
@@ -125,15 +125,15 @@ public struct DiffableTextField<Style: DiffableTextStyle>: UIViewRepresentable {
125125
}
126126

127127
@inlinable @inline(never)
128-
func update(_ parent: DiffableTextField, _ environment: EnvironmentValues) {
128+
func update(_ upstream: DiffableTextField, _ environment: EnvironmentValues) {
129129
//=----------------------------------=
130130
// Upstream
131131
//=----------------------------------=
132-
self.upstream = Upstream(parent, environment)
132+
self.upstream = Upstream(upstream, environment)
133133
//=----------------------------------=
134134
// Downstream
135135
//=----------------------------------=
136-
self.downstream.placeholder(parent.title)
136+
self.downstream.placeholder(upstream.title)
137137
self.downstream.autocorrectionDisabled(environment)
138138
self.downstream.font(environment)
139139
self.downstream.foregroundColor(environment)

Sources/DiffableTextKitXUIKit/Models/Upstream.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import SwiftUI
2626

2727
//=------------------------------------------------------------------------=
2828

29-
@inlinable init(_ parent: DiffableTextField<Style>, _ environment: EnvironmentValues) {
30-
self.style = parent.style.locale(environment.locale); self.value = parent.value
29+
@inlinable init(_ upstream: DiffableTextField<Style>, _ environment: EnvironmentValues) {
30+
self.style = upstream.style.locale(environment.locale); self.value = upstream.value
3131
}
3232
}
3333

Sources/DiffableTextViews/Exports.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
@_exported import struct DiffableTextKit.EqualsTextStyle
2020

21-
@_exported import struct DiffableTextKit.IsolatedTextStyle
21+
@_exported import struct DiffableTextKit.StandaloneTextStyle
2222

2323
@_exported import struct DiffableTextKit.PrefixTextStyle
2424

0 commit comments

Comments
 (0)