Skip to content

Commit

Permalink
Deprecate methods
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelHolec committed Nov 16, 2023
1 parent 696d183 commit 5b6a01b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/Orbit/Foundation/Typography/Font.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public extension ContentSizeCategory {
1 + (ratio - 1) * 0.5
}

@available(iOS, deprecated: 15.0, message: "Use DynamicTypeSize.isAccessibilitySize instead from iOS 15.0")
@available(iOS, deprecated: 15.0, message: "Use native DynamicTypeSize.isAccessibilitySize")
var isAccessibilitySize: Bool {
ratio >= 1.6
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ struct InputFieldBeginEditingIdentifiableActionKey: EnvironmentKey {
public extension EnvironmentValues {

/// An Orbit `textFieldDidBeginEditing` action for `InputField` stored in a view’s environment.
@available(iOS, deprecated: 15.0, message: "Use native @FocusState to manage focus for Orbit text fields")
var inputFieldBeginEditingAction: () -> Void {
get { self[InputFieldBeginEditingActionKey.self] }
set { self[InputFieldBeginEditingActionKey.self] = newValue }
}

/// An Orbit `textFieldDidBeginEditing` action for an identifiable `InputField` stored in a view’s environment.
@available(iOS, deprecated: 15.0, message: "Use native @FocusState to manage focus for Orbit text fields")
var inputFieldBeginEditingIdentifiableAction: (AnyHashable) -> Void {
get { self[InputFieldBeginEditingIdentifiableActionKey.self] }
set { self[InputFieldBeginEditingIdentifiableActionKey.self] = newValue }
Expand All @@ -29,6 +31,7 @@ public extension View {
///
/// - Parameters:
/// - action: A handler that is executed when the user starts editing `InputField` inside the view hierarchy.
@available(iOS, deprecated: 15.0, renamed: "onChange(_:)", message: "Use native @FocusState in combination with `onChange` to monitor focus changes of Orbit text fields")
func inputFieldBeginEditingAction(_ action: @escaping () -> Void) -> some View {
environment(\.inputFieldBeginEditingAction, action)
}
Expand All @@ -40,6 +43,7 @@ public extension View {
/// - Parameters:
/// - action: A handler that is executed when the user starts editing an identifiable `InputField` inside the view hierarchy.
/// The action parameter specifies the identifier of the `InputField`.
@available(iOS, deprecated: 15.0, renamed: "onChange(_:)", message: "Use native @FocusState in combination with `onChange` to monitor focus changes of Orbit text fields")
func inputFieldBeginEditingAction(_ action: @escaping (AnyHashable) -> Void) -> some View {
environment(\.inputFieldBeginEditingIdentifiableAction, action)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ struct InputFieldEndEditingIdentifiableActionKey: EnvironmentKey {
public extension EnvironmentValues {

/// An Orbit `textFieldDidEndEditing` action for `InputField` stored in a view’s environment.
@available(iOS, deprecated: 15.0, message: "Use native @FocusState to manage focus for Orbit text fields")
var inputFieldEndEditingAction: () -> Void {
get { self[InputFieldEndEditingActionKey.self] }
set { self[InputFieldEndEditingActionKey.self] = newValue }
}

/// An Orbit `textFieldDidEndEditing` action for an identifiable `InputField` stored in a view’s environment.
@available(iOS, deprecated: 15.0, message: "Use native @FocusState to manage focus for Orbit text fields")
var inputFieldEndEditingIdentifiableAction: (AnyHashable) -> Void {
get { self[InputFieldEndEditingIdentifiableActionKey.self] }
set { self[InputFieldEndEditingIdentifiableActionKey.self] = newValue }
Expand All @@ -29,6 +31,7 @@ public extension View {
///
/// - Parameters:
/// - action: A handler that is executed after the user ends editing `InputField` inside the view hierarchy.
@available(iOS, deprecated: 15.0, renamed: "onChange(_:)", message: "Use native @FocusState in combination with `onChange` to monitor focus changes of Orbit text fields")
func inputFieldEndEditingAction(_ action: @escaping () -> Void) -> some View {
environment(\.inputFieldEndEditingAction, action)
}
Expand All @@ -40,6 +43,7 @@ public extension View {
/// - Parameters:
/// - action: A handler that is executed after the user ends editing a specific identifiable `InputField` inside the view hierarchy.
/// The action parameter specifies the identifier of the `InputField`.
@available(iOS, deprecated: 15.0, renamed: "onChange(_:)", message: "Use native @FocusState in combination with `onChange` to monitor focus changes of Orbit text fields")
func inputFieldEndEditingAction(_ action: @escaping (AnyHashable) -> Void) -> some View {
environment(\.inputFieldEndEditingIdentifiableAction, action)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public extension View {
/// Assigns a focus binding to Orbit text fields in a view.
///
/// When a value of a binding matches the `identifier` of a specific Orbit text field, that text field becomes focused.
@available(iOS, deprecated: 15.0, renamed: "focused(_:)", message: "Use native @FocusState to manage focus for Orbit text fields")
func inputFieldFocus<Value>(_ binding: Binding<Value?>) -> some View where Value: Hashable {
environment(
\.inputFieldFocus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public extension View {
/// Pass `nil` to ignore environment font weight and to allow the system
/// or the container to provide its own font weight.
/// If a container-specific override doesn’t exist, the `regular` will be used.
@available(iOS, introduced: 13, obsoleted: 16, renamed: "fontWeight")
@available(iOS, deprecated: 16, renamed: "fontWeight(_:)", message: "Use native modifier to set font weight.")
func textFontWeight(_ fontWeight: Font.Weight?) -> some View {
environment(\.textFontWeight, fontWeight)
}
Expand Down

0 comments on commit 5b6a01b

Please sign in to comment.