Skip to content

Commit

Permalink
Adopt Swift 6
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanov91 committed Oct 15, 2024
1 parent 246ff31 commit 8af2ddb
Show file tree
Hide file tree
Showing 52 changed files with 410 additions and 609 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 5.9
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swiftlint:disable all

Expand Down
24 changes: 13 additions & 11 deletions Sources/OversizeUI/Controls/Checkbox/Checkbox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import SwiftUI

public enum CheckboxAlignment {
public enum CheckboxAlignment: Sendable {
case leading, trailing
}

Expand Down Expand Up @@ -115,16 +115,18 @@ public extension Checkbox where Label == EmptyView {
}
}

struct Checkbox_LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
Checkbox(isOn: .constant(false), label: {
Text("Text")
}),
title: "Checkbox", category: .control
)
}
}
/*
struct Checkbox_LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
Checkbox(isOn: .constant(false), label: {
Text("Text")
}),
title: "Checkbox", category: .control
)
}
}
*/

struct Checkbox_preview: PreviewProvider {
static var previews: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

import SwiftUI

public protocol ColorSelectorStyle {
public protocol ColorSelectorStyle: Sendable {
associatedtype Body: View
typealias Configuration = ColorSelectorConfiguration

func makeBody(configuration: Self.Configuration) -> Self.Body
}

public struct ColorSelectorConfiguration {
public struct ColorSelectorConfiguration: Sendable {
public struct Label: View {
public init(content: some View) {
body = AnyView(content)
Expand All @@ -31,7 +31,7 @@ public struct DefaultColorSelectorStyle: ColorSelectorStyle {
}

struct ColorSelectorStyleStyleKey: EnvironmentKey {
public static var defaultValue = AnyColorSelectorStyle(style: DefaultColorSelectorStyle())
public static let defaultValue = AnyColorSelectorStyle(style: DefaultColorSelectorStyle())
}

public extension EnvironmentValues {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import SwiftUI

public struct AnyColorSelectorStyle: ColorSelectorStyle {
private var _makeBody: (Configuration) -> AnyView
private var _makeBody: @Sendable (Configuration) -> AnyView

public init(style: some ColorSelectorStyle) {
_makeBody = { configuration in
Expand Down
12 changes: 6 additions & 6 deletions Sources/OversizeUI/Controls/GridSelect/GridSelectStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,24 @@ public struct SelectionOnlyGridSelectStyle: GridSelectStyle {

// MARK: - Support

public enum GridSelectSeletionIconStyle {
public enum GridSelectSeletionIconStyle: Sendable {
case none
case checkbox(alignment: Alignment = .bottomTrailing)
case radio(alignment: Alignment = .bottomTrailing)
}

public enum GridSelectSeletionStyle {
public enum GridSelectSeletionStyle: Sendable {
case shadowSurface
case graySurface
case accentSurface
}

public enum GridSelectUnseletionStyle {
public enum GridSelectUnseletionStyle: Sendable {
case clean
case surface
}

public protocol GridSelectStyle {
public protocol GridSelectStyle: Sendable {
associatedtype Body: View
typealias Configuration = GridSelectConfiguration

Expand Down Expand Up @@ -103,7 +103,7 @@ public struct AnyGridSelectStyle: GridSelectStyle {
public var unseletionStyle: GridSelectUnseletionStyle
public var icon: GridSelectSeletionIconStyle

private var _makeBody: (Configuration) -> AnyView
private var _makeBody: @Sendable (Configuration) -> AnyView

public init(
seletionStyle: GridSelectSeletionStyle,
Expand All @@ -125,7 +125,7 @@ public struct AnyGridSelectStyle: GridSelectStyle {
}

struct GridSelectStyleKey: EnvironmentKey {
public static var defaultValue = AnyGridSelectStyle(seletionStyle: .accentSurface,
public static let defaultValue = AnyGridSelectStyle(seletionStyle: .accentSurface,
unseletionStyle: .surface,
icon: .none,
style: IslandGridSelectStyle())
Expand Down
22 changes: 12 additions & 10 deletions Sources/OversizeUI/Controls/Radio/Radio.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,18 @@ public extension Radio where Label == EmptyView {
}
}

struct Radio_LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
Radio(isOn: false, alignment: .leading, label: {
Text("Text")
}),
title: "Chip", category: .control
)
}
}
/*
struct Radio_LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
Radio(isOn: false, alignment: .leading, label: {
Text("Text")
}),
title: "Chip", category: .control
)
}
}
*/

struct Radio_preview: PreviewProvider {
struct RadioPreview: View {
Expand Down
22 changes: 12 additions & 10 deletions Sources/OversizeUI/Controls/Radio/RadioPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@ public struct RadioPicker<Element: Equatable, Content>: View where Content: View
}
}

struct RadioPicker_LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
RadioPicker(["One", "Two"], selection: .constant("One")) { item in
Text(item)
},
title: "Radio Picker", category: .control
)
}
}
/*
struct RadioPicker_LibraryContent: LibraryContentProvider {
var views: [LibraryItem] {
LibraryItem(
RadioPicker(["One", "Two"], selection: .constant("One")) { item in
Text(item)
},
title: "Radio Picker", category: .control
)
}
}
*/

struct RadioPicker_previw: PreviewProvider {
struct RadioPickerPreview: View {
Expand Down
12 changes: 6 additions & 6 deletions Sources/OversizeUI/Controls/SectionView/SectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@

import SwiftUI

public enum SectionViewTitlePosition {
public enum SectionViewTitlePosition: Sendable {
case inside, outside
}

public enum SectionViewTitleButtonPosition {
public enum SectionViewTitleButtonPosition: Sendable {
case leading, trailing
}

public enum SectionViewTitleButton {
case arrow(_ action: () -> Void)
case title(_ title: String, _ action: () -> Void)
public enum SectionViewTitleButton: Sendable {
case arrow(_ action: @Sendable () -> Void)
case title(_ title: String, _ action: @Sendable () -> Void)
}

public enum SectionViewStyle {
public enum SectionViewStyle: Sendable {
case `default`, smallIndent, edgeToEdge
}

Expand Down
Loading

0 comments on commit 8af2ddb

Please sign in to comment.