File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1111// MARK: * Changes
1212//* ============================================================================*
1313
14- /// A snapshot and one continuous change that has not yet been applied to it.
14+ /// A snapshot and one continuous change not yet been applied to it.
1515public struct Changes {
1616 public typealias Change < S: Scheme > = ( content: String , range: Range < Layout < S > . Index > )
1717
@@ -36,7 +36,7 @@ public struct Changes {
3636 // MARK: Utilities
3737 //=------------------------------------------------------------------------=
3838
39- /// Returns a new snapshot where the proposed change has been applied .
39+ /// Returns a new snapshot with the proposed change applied to it .
4040 @inlinable public func proposal( ) -> Snapshot {
4141 var result = snapshot; result. replaceSubrange ( range, with: replacement) ; return result
4242 }
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import Foundation
1313// MARK: * Field
1414//*============================================================================*
1515
16+ /// A model describing a snapshot's layout and the selection in it.
1617public struct Field < Scheme: DiffableTextKit . Scheme > {
1718 public typealias Layout = DiffableTextKit . Layout < Scheme >
1819 public typealias Position = DiffableTextKit . Position < Scheme >
Original file line number Diff line number Diff line change @@ -113,8 +113,7 @@ public struct DiffableTextField<Style: DiffableTextStyleXiOS>: UIViewRepresentab
113113 //=--------------------------------------------------------------------=
114114
115115 @inlinable func update( _ upstream: DiffableTextField , _ environment: EnvironmentValues ) {
116- self . upstream = upstream
117- self . environment = environment
116+ self . upstream = upstream; self . environment = environment
118117 self . synchronize ( )
119118 self . downstream. transform ( environment. diffableTextField_onUpdate)
120119 }
@@ -148,9 +147,8 @@ public struct DiffableTextField<Style: DiffableTextStyleXiOS>: UIViewRepresentab
148147 //=--------------------------------------------------------------------=
149148
150149 @inlinable public func textField( _ textField: UITextField ,
151- shouldChangeCharactersIn nsRange: NSRange , replacementString string: String ) -> Bool {
152- let style = style ( )
153- let range = context. field. indices ( at: nsRange)
150+ shouldChangeCharactersIn range: NSRange , replacementString string: String ) -> Bool {
151+ let style = style ( ) ; let range = context. field. indices ( at: range)
154152 let changes = Changes ( context. field. snapshot, change: ( string, range) )
155153 //=----------------------------------=
156154 // MARK: Merge
You can’t perform that action at this time.
0 commit comments