Skip to content

Commit

Permalink
Change last from static to non-static
Browse files Browse the repository at this point in the history
  • Loading branch information
tareksabry1337 committed Sep 9, 2022
1 parent 49df26c commit 3e08cde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/Focuser/ComplianceProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import Foundation

public protocol FocusStateCompliant: Hashable {
static var last: Self { get }
var last: Self { get }
var next: Self? { get }
}

public extension FocusStateCompliant where Self: CaseIterable, AllCases: BidirectionalCollection {

static var last: Self {
var last: Self {
return Self.allCases.last! //swiftlint:disable:this force_unwrapping
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Focuser/TextFieldIntrospect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public struct FocusModifier<Value: FocusStateCompliant & Hashable>: ViewModifier
}

/// to show kayboard with `next` or `return`
if equals.hashValue == Value.last.hashValue {
if equals.hashValue == focusedField?.last.hashValue {
tf.returnKeyType = .done
} else {
tf.returnKeyType = .next
Expand Down

0 comments on commit 3e08cde

Please sign in to comment.