Skip to content

Commit 59b762a

Browse files
committed
Add SPM support & migrate to Swift 6.2
1 parent f881358 commit 59b762a

File tree

9 files changed

+39
-19
lines changed

9 files changed

+39
-19
lines changed

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Framework/Sources/Cell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ open class Cell: UIView {
9797
}
9898
}
9999

100-
extension Cell: Comparable {
100+
extension Cell: @MainActor Comparable {
101101
public static func <(lhs: Cell, rhs: Cell) -> Bool {
102102
return lhs.indexPath < rhs.indexPath
103103
}

Framework/Sources/CellRange.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import UIKit
1010

11-
public final class CellRange {
11+
@MainActor public final class CellRange {
1212
public let from: Location
1313
public let to: Location
1414

@@ -48,7 +48,7 @@ public final class CellRange {
4848
}
4949
}
5050

51-
extension CellRange: Hashable {
51+
extension CellRange: @MainActor Hashable {
5252
public func hash(into hasher: inout Hasher) {
5353
hasher.combine(from)
5454
}
@@ -58,7 +58,7 @@ extension CellRange: Hashable {
5858
}
5959
}
6060

61-
extension CellRange: CustomStringConvertible, CustomDebugStringConvertible {
61+
extension CellRange: @MainActor CustomStringConvertible, @MainActor CustomDebugStringConvertible {
6262
public var description: String {
6363
return "R\(from.row)C\(from.column):R\(to.row)C\(to.column)"
6464
}

Framework/Sources/CircularScrolling.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ public enum CircularScrolling {
7272
}
7373

7474
struct Direction: OptionSet {
75-
static var vertically = Direction(rawValue: 1 << 0)
76-
static var horizontally = Direction(rawValue: 1 << 1)
77-
static var both: Direction = [.vertically, .horizontally]
75+
static let vertically = Direction(rawValue: 1 << 0)
76+
static let horizontally = Direction(rawValue: 1 << 1)
77+
static let both: Direction = [.vertically, .horizontally]
7878

7979
let rawValue: Int
8080
init(rawValue: Int) {
@@ -89,8 +89,8 @@ public enum CircularScrolling {
8989
}
9090

9191
struct TableStyle: OptionSet {
92-
static var columnHeaderNotRepeated = TableStyle(rawValue: 1 << 0)
93-
static var rowHeaderNotRepeated = TableStyle(rawValue: 1 << 1)
92+
static let columnHeaderNotRepeated = TableStyle(rawValue: 1 << 0)
93+
static let rowHeaderNotRepeated = TableStyle(rawValue: 1 << 1)
9494

9595
let rawValue: Int
9696
init(rawValue: Int) {

Framework/Sources/LayoutEngine.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import UIKit
1010

11-
final class LayoutEngine {
11+
@MainActor final class LayoutEngine {
1212
private let spreadsheetView: SpreadsheetView
1313
private let scrollView: ScrollView
1414

Framework/Sources/ScrollPosition.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88

99
import Foundation
1010

11-
public struct ScrollPosition: OptionSet {
11+
public struct ScrollPosition: OptionSet, Sendable {
1212
// The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions.
1313
// Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException.
14-
public static var top = ScrollPosition(rawValue: 1 << 0)
15-
public static var centeredVertically = ScrollPosition(rawValue: 1 << 1)
16-
public static var bottom = ScrollPosition(rawValue: 1 << 2)
14+
public static let top = ScrollPosition(rawValue: 1 << 0)
15+
public static let centeredVertically = ScrollPosition(rawValue: 1 << 1)
16+
public static let bottom = ScrollPosition(rawValue: 1 << 2)
1717

1818
// Likewise, the horizontal positions are mutually exclusive to each other.
19-
public static var left = ScrollPosition(rawValue: 1 << 3)
20-
public static var centeredHorizontally = ScrollPosition(rawValue: 1 << 4)
21-
public static var right = ScrollPosition(rawValue: 1 << 5)
19+
public static let left = ScrollPosition(rawValue: 1 << 3)
20+
public static let centeredHorizontally = ScrollPosition(rawValue: 1 << 4)
21+
public static let right = ScrollPosition(rawValue: 1 << 5)
2222

2323
public let rawValue: Int
2424

Framework/Sources/SpreadsheetViewDataSource.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import UIKit
1010

1111
/// Implement this protocol to provide data to an `SpreadsheetView`.
12-
public protocol SpreadsheetViewDataSource: class {
12+
public protocol SpreadsheetViewDataSource: AnyObject {
1313
/// Asks your data source object for the number of columns in the spreadsheet view.
1414
///
1515
/// - Parameter spreadsheetView: The spreadsheet view requesting this information.

Framework/Sources/SpreadsheetViewDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import UIKit
1111
/// The `SpreadsheetViewDelegate` protocol defines methods that allow you to manage the selection and
1212
/// highlighting of cells in a spreadsheet view and to perform actions on those cells.
1313
/// The methods of this protocol are all optional.
14-
public protocol SpreadsheetViewDelegate: class {
14+
public protocol SpreadsheetViewDelegate: AnyObject {
1515
/// Asks the delegate if the cell should be highlighted during tracking.
1616
/// - Note: As touch events arrive, the spreadsheet view highlights cells in anticipation of the user selecting them.
1717
/// As it processes those touch events, the collection view calls this method to ask your delegate if a given cell should be highlighted.

Package.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// swift-tools-version: 6.2
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "SpreadsheetView",
7+
products: [
8+
.library(name: "SpreadsheetView", targets: ["SpreadsheetView"]),
9+
],
10+
targets: [
11+
.target(name: "SpreadsheetView", path: "Framework/Sources"),
12+
]
13+
)

0 commit comments

Comments
 (0)