Skip to content

Commit

Permalink
Swift6 code update
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelHolec committed Nov 12, 2024
1 parent e05c339 commit 46793c3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/Orbit/Foundation/Typography/OrbitFont.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ struct OrbitFont: ViewModifier {
public extension View {

/// Sets the Orbit font as a default font for text in this view.
func orbitFont(size: CGFloat, weight: Font.Weight = .regular) -> some View {
nonisolated func orbitFont(size: CGFloat, weight: Font.Weight = .regular) -> some View {
modifier(OrbitFont(size: size, weight: weight))
}
}

public extension SwiftUI.Text {

/// Sets the Orbit font as a default font for text in this view.
func orbitFont(
nonisolated func orbitFont(
size: CGFloat,
weight: Font.Weight = .regular,
sizeCategory: ContentSizeCategory
Expand Down
2 changes: 2 additions & 0 deletions Sources/Orbit/Support/BindingSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public enum OptionalBindingSource<Value> {
case state(Value)
}

extension Binding: Sendable where Value: Sendable {}

extension OptionalBindingSource: Sendable where Value: Sendable {}

/// A view that provides either a binding to its content or an internal state, based on provided ``OptionalBindingSource`` value.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Orbit/Support/Previews/PreviewWrapper.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftUI

/// Registers Orbit fonts for preview content.
public struct OrbitPreviewWrapper<Content: View>: View {
@MainActor public struct OrbitPreviewWrapper<Content: View>: View {

@ViewBuilder let content: Content

Expand Down
2 changes: 1 addition & 1 deletion Sources/Orbit/Support/Text/TextRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ struct TextConcatenationPreviews: PreviewProvider {
extension View {

/// Textual representation of view.
func text(locale: Locale, localizationBundle: Bundle) -> SwiftUI.Text? {
@MainActor func text(locale: Locale, localizationBundle: Bundle) -> SwiftUI.Text? {
switch self {
case let text as SwiftUI.Text: text
case let text as TextRepresentable: text.text(environment: .init(locale: locale, localizationBundle: localizationBundle))
Expand Down

0 comments on commit 46793c3

Please sign in to comment.