Skip to content

Commit 8edaef8

Browse files
committed
Cleanup.
1 parent 5429d05 commit 8edaef8

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Sources/DiffableTextStylesXWrapper/Equals.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import DiffableTextKit
1717
///
1818
/// Use this wrapper to optimize the comparison on view update.
1919
///
20-
/// - Note: DiffableTextView updates its style only when the proposed style is unequal.
20+
/// - Note: DiffableTextViews update their styles only when proposed styles are unequal.
2121
///
2222
public struct EqualsTextStyle<Style: DiffableTextStyle, Proxy: Equatable>: WrapperTextStyle {
2323

@@ -69,7 +69,7 @@ extension DiffableTextStyle {
6969
///
7070
/// Use this wrapper to optimize the comparison on view update.
7171
///
72-
/// - Note: DiffableTextView updates its style only when the proposed style is unequal.
72+
/// - Note: DiffableTextViews update their styles only when proposed styles are unequal.
7373
///
7474
@inlinable @inline(__always)
7575
public func equals(_ proxy: Void) -> EqualsVoid {
@@ -80,7 +80,7 @@ extension DiffableTextStyle {
8080
///
8181
/// Use this wrapper to optimize the comparison on view update.
8282
///
83-
/// - Note: DiffableTextView updates its style only when the proposed style is unequal.
83+
/// - Note: DiffableTextViews update their styles only when proposed styles are unequal.
8484
///
8585
@inlinable @inline(__always)
8686
public func equals<Proxy>(_ proxy: Proxy) -> Equals<Proxy> {

Sources/DiffableTextViewsXiOS/DiffableTextField.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,12 @@ public struct DiffableTextField<Style: DiffableTextStyle>: UIViewRepresentable {
228228
//=----------------------------------=
229229
self.context.update(selection: selection, momentum: downstream.momentum)
230230
//=----------------------------------=
231-
// MARK: Update Downstream If Needed
231+
// MARK: Update Downstream As Needed
232232
//=----------------------------------=
233-
if selection != context.field.positions {
233+
let positions = context.field.positions
234+
if selection != positions {
234235
lock.perform {
235-
self.downstream.update(selection: context.field.positions)
236+
self.downstream.update(selection: positions)
236237
}
237238
}
238239
}

0 commit comments

Comments
 (0)