feat: Begins air handler measurement form

This commit is contained in:
2024-06-03 23:27:19 -04:00
parent 064282e54e
commit 04c899da8e
4 changed files with 145 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
import Foundation
public protocol FocusableField {
var next: Self? { get }
}
extension FocusableField where Self: CaseIterable, Self: Equatable {
public var next: Self? {
guard let index = Self.allCases.firstIndex(of: self)
else { return nil }
let endIndex = Self.allCases.endIndex
let nextIndex = Self.allCases.index(after: index)
guard nextIndex < endIndex else { return nil }
return Self.allCases[nextIndex]
}
}