File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
DiffableTextStylesXWrapper Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff 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///
2222public 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 > {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments