diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Framework/Sources/Cell.swift b/Framework/Sources/Cell.swift index dfb5b2af..bea4aa75 100644 --- a/Framework/Sources/Cell.swift +++ b/Framework/Sources/Cell.swift @@ -97,7 +97,7 @@ open class Cell: UIView { } } -extension Cell: Comparable { +extension Cell: @MainActor Comparable { public static func <(lhs: Cell, rhs: Cell) -> Bool { return lhs.indexPath < rhs.indexPath } diff --git a/Framework/Sources/CellRange.swift b/Framework/Sources/CellRange.swift index 901e3c7b..96514721 100644 --- a/Framework/Sources/CellRange.swift +++ b/Framework/Sources/CellRange.swift @@ -8,7 +8,7 @@ import UIKit -public final class CellRange { +@MainActor public final class CellRange { public let from: Location public let to: Location @@ -48,7 +48,7 @@ public final class CellRange { } } -extension CellRange: Hashable { +extension CellRange: @MainActor Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(from) } @@ -58,7 +58,7 @@ extension CellRange: Hashable { } } -extension CellRange: CustomStringConvertible, CustomDebugStringConvertible { +extension CellRange: @MainActor CustomStringConvertible, @MainActor CustomDebugStringConvertible { public var description: String { return "R\(from.row)C\(from.column):R\(to.row)C\(to.column)" } diff --git a/Framework/Sources/CircularScrolling.swift b/Framework/Sources/CircularScrolling.swift index 135926c9..3099f866 100644 --- a/Framework/Sources/CircularScrolling.swift +++ b/Framework/Sources/CircularScrolling.swift @@ -72,9 +72,9 @@ public enum CircularScrolling { } struct Direction: OptionSet { - static var vertically = Direction(rawValue: 1 << 0) - static var horizontally = Direction(rawValue: 1 << 1) - static var both: Direction = [.vertically, .horizontally] + static let vertically = Direction(rawValue: 1 << 0) + static let horizontally = Direction(rawValue: 1 << 1) + static let both: Direction = [.vertically, .horizontally] let rawValue: Int init(rawValue: Int) { @@ -89,8 +89,8 @@ public enum CircularScrolling { } struct TableStyle: OptionSet { - static var columnHeaderNotRepeated = TableStyle(rawValue: 1 << 0) - static var rowHeaderNotRepeated = TableStyle(rawValue: 1 << 1) + static let columnHeaderNotRepeated = TableStyle(rawValue: 1 << 0) + static let rowHeaderNotRepeated = TableStyle(rawValue: 1 << 1) let rawValue: Int init(rawValue: Int) { diff --git a/Framework/Sources/LayoutEngine.swift b/Framework/Sources/LayoutEngine.swift index d3c9a3a0..cf1752e4 100644 --- a/Framework/Sources/LayoutEngine.swift +++ b/Framework/Sources/LayoutEngine.swift @@ -8,7 +8,7 @@ import UIKit -final class LayoutEngine { +@MainActor final class LayoutEngine { private let spreadsheetView: SpreadsheetView private let scrollView: ScrollView diff --git a/Framework/Sources/ScrollPosition.swift b/Framework/Sources/ScrollPosition.swift index e50df090..307e59ed 100644 --- a/Framework/Sources/ScrollPosition.swift +++ b/Framework/Sources/ScrollPosition.swift @@ -8,17 +8,17 @@ import Foundation -public struct ScrollPosition: OptionSet { +public struct ScrollPosition: OptionSet, Sendable { // The vertical positions are mutually exclusive to each other, but are bitwise or-able with the horizontal scroll positions. // Combining positions from the same grouping (horizontal or vertical) will result in an NSInvalidArgumentException. - public static var top = ScrollPosition(rawValue: 1 << 0) - public static var centeredVertically = ScrollPosition(rawValue: 1 << 1) - public static var bottom = ScrollPosition(rawValue: 1 << 2) + public static let top = ScrollPosition(rawValue: 1 << 0) + public static let centeredVertically = ScrollPosition(rawValue: 1 << 1) + public static let bottom = ScrollPosition(rawValue: 1 << 2) // Likewise, the horizontal positions are mutually exclusive to each other. - public static var left = ScrollPosition(rawValue: 1 << 3) - public static var centeredHorizontally = ScrollPosition(rawValue: 1 << 4) - public static var right = ScrollPosition(rawValue: 1 << 5) + public static let left = ScrollPosition(rawValue: 1 << 3) + public static let centeredHorizontally = ScrollPosition(rawValue: 1 << 4) + public static let right = ScrollPosition(rawValue: 1 << 5) public let rawValue: Int diff --git a/Framework/Sources/SpreadsheetViewDataSource.swift b/Framework/Sources/SpreadsheetViewDataSource.swift index 956ece08..a952c379 100644 --- a/Framework/Sources/SpreadsheetViewDataSource.swift +++ b/Framework/Sources/SpreadsheetViewDataSource.swift @@ -9,7 +9,7 @@ import UIKit /// Implement this protocol to provide data to an `SpreadsheetView`. -public protocol SpreadsheetViewDataSource: class { +public protocol SpreadsheetViewDataSource: AnyObject { /// Asks your data source object for the number of columns in the spreadsheet view. /// /// - Parameter spreadsheetView: The spreadsheet view requesting this information. diff --git a/Framework/Sources/SpreadsheetViewDelegate.swift b/Framework/Sources/SpreadsheetViewDelegate.swift index 48514389..b23a39d6 100644 --- a/Framework/Sources/SpreadsheetViewDelegate.swift +++ b/Framework/Sources/SpreadsheetViewDelegate.swift @@ -11,7 +11,7 @@ import UIKit /// The `SpreadsheetViewDelegate` protocol defines methods that allow you to manage the selection and /// highlighting of cells in a spreadsheet view and to perform actions on those cells. /// The methods of this protocol are all optional. -public protocol SpreadsheetViewDelegate: class { +public protocol SpreadsheetViewDelegate: AnyObject { /// Asks the delegate if the cell should be highlighted during tracking. /// - Note: As touch events arrive, the spreadsheet view highlights cells in anticipation of the user selecting them. /// As it processes those touch events, the collection view calls this method to ask your delegate if a given cell should be highlighted. diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..a3227849 --- /dev/null +++ b/Package.swift @@ -0,0 +1,13 @@ +// swift-tools-version: 6.2 + +import PackageDescription + +let package = Package( + name: "SpreadsheetView", + products: [ + .library(name: "SpreadsheetView", targets: ["SpreadsheetView"]), + ], + targets: [ + .target(name: "SpreadsheetView", path: "Framework/Sources", exclude: ["Info.plist", "SpreadsheetView.h"]), + ] +)