Skip to content

Commit 99ed583

Browse files
committed
Cleanup.
1 parent 15ea03a commit 99ed583

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Sources/DiffableTextKit/Models/Changes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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.
1515
public 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
}

Sources/DiffableTextKit/Models/Field.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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.
1617
public struct Field<Scheme: DiffableTextKit.Scheme> {
1718
public typealias Layout = DiffableTextKit.Layout<Scheme>
1819
public typealias Position = DiffableTextKit.Position<Scheme>

Sources/DiffableTextViewsXiOS/DiffableTextField.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)