-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TimecodeField
: Added Return and Escape keypress action view modifiers
- Loading branch information
Showing
4 changed files
with
163 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Sources/TimecodeKitUI/SwiftUI/TimecodeField/TimecodeField Types.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// TimecodeField Types.swift | ||
// TimecodeKit • https://github.com/orchetect/TimecodeKit | ||
// © 2020-2024 Steffan Andrews • Licensed under MIT License | ||
// | ||
|
||
#if canImport(SwiftUI) && (os(macOS) || os(iOS) || os(visionOS)) | ||
|
||
import SwiftUI | ||
import TimecodeKit | ||
|
||
@available(macOS 14, iOS 17, *) | ||
@available(watchOS, unavailable) | ||
@available(tvOS, unavailable) | ||
extension TimecodeField { | ||
/// An enum describing actions to perform in response to ``TimecodeField`` user input. | ||
public enum FieldAction: Equatable, Hashable, Sendable { | ||
/// End editing. | ||
/// Removes focus from the timecode field. | ||
case endEditing | ||
|
||
/// Resets component focus to the specified component. | ||
/// If `nil`, focus is reset to the first visible component. | ||
case resetComponentFocus(component: Timecode.Component? = nil) | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters