Skip to content

Commit 1fd63b1

Browse files
committed
Cleanup.
1 parent cfa97c6 commit 1fd63b1

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Sources/DiffableTextKit/Models/Update.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@
1212
//*============================================================================*
1313

1414
/// A message describing which properties should be updated.
15+
///
16+
/// It is recommended to update the value first, then the text before selection.
17+
///
18+
/// - Implement reentrant updates by only updating the value until it stabilizes.
19+
///
1520
@frozen public struct Update: OptionSet {
16-
17-
public static let text = Self(rawValue: 1 << 0)
18-
public static let selection = Self(rawValue: 1 << 1)
19-
public static let value = Self(rawValue: 1 << 2)
21+
22+
public static let value = Self(rawValue: 1 << 0)
23+
public static let text = Self(rawValue: 1 << 1)
24+
public static let selection = Self(rawValue: 1 << 2)
2025

2126
//=------------------------------------------------------------------------=
2227

Sources/DiffableTextKitXUIKit/DiffableTextField.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public struct DiffableTextField<Style: DiffableTextStyle>: UIViewRepresentable {
272272
// Value
273273
//=----------------------------------=
274274
if let _ = self.update.remove(.value) {
275-
self.upstream.value = self.context.value
275+
self.upstream.value = context.value
276276
//=------------------------------=
277277
// Reentrance
278278
//=------------------------------=

0 commit comments

Comments
 (0)