File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed
Sources/DiffableTextKitXUIKit Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -282,8 +282,9 @@ public struct DiffableTextField<Style: DiffableTextStyle>: UIViewRepresentable {
282282 //=----------------------------------=
283283 // Value
284284 //=----------------------------------=
285- if let _ = self . update. remove ( . value) {
285+ if self . update. contains ( . value) {
286286 self . upstream. value = context. value
287+ self . update. subtract ( . value)
287288 //=------------------------------=
288289 // Reentrance
289290 //=------------------------------=
@@ -292,14 +293,16 @@ public struct DiffableTextField<Style: DiffableTextStyle>: UIViewRepresentable {
292293 //=----------------------------------=
293294 // Text
294295 //=----------------------------------=
295- if let _ = self . update. remove ( . text) {
296+ if self . update. contains ( . text) {
296297 self . downstream. text = context. text
298+ self . update. subtract ( . text)
297299 }
298300 //=----------------------------------=
299301 // Selection
300302 //=----------------------------------=
301- if let _ = self . update. remove ( . selection) {
303+ if self . update. contains ( . selection) {
302304 self . downstream. selection = context. selection ( )
305+ self . update. subtract ( . selection)
303306 }
304307 }
305308 }
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ extension EnvironmentValues {
2727}
2828
2929public extension View {
30- @inlinable func diffableTextViews_textFieldStyle(
31- _ style: UITextField . BorderStyle ) -> some View {
30+ @inlinable func diffableTextViews_textFieldStyle( _ style: UITextField . BorderStyle ) -> some View {
3231 environment ( \. diffableTextViews_textFieldStyle, style)
3332 }
3433}
Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ extension EnvironmentValues {
2828}
2929
3030public extension View {
31- @inlinable func diffableTextViews_toolbarDoneButton(
32- _ style: UIBarButtonItem . Style = . plain) -> some View {
31+ @inlinable func diffableTextViews_toolbarDoneButton( _ style: UIBarButtonItem . Style = . plain) -> some View {
3332 environment ( \. diffableTextViews_toolbarDoneButton, style)
3433 }
3534}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ import UIKit
4646 }
4747
4848 //=------------------------------------------------------------------------=
49- // MARK: Transformations
49+ // MARK: Toolbar
5050 //=------------------------------------------------------------------------=
5151
5252 @usableFromInline func setupToolbarDoneButton( _ style: UIBarButtonItem . Style ) {
@@ -67,7 +67,7 @@ import UIKit
6767 }
6868
6969 //=------------------------------------------------------------------------=
70- // MARK: Events
70+ // MARK: Interactions
7171 //=------------------------------------------------------------------------=
7272
7373 override func pressesBegan( _ presses: Set < UIPress > , with event: UIPressesEvent ? ) {
You can’t perform that action at this time.
0 commit comments