diff --git a/Dwifft/AbstractDiffCalculator.swift b/Dwifft/AbstractDiffCalculator.swift index 9db51ca..6cc8706 100644 --- a/Dwifft/AbstractDiffCalculator.swift +++ b/Dwifft/AbstractDiffCalculator.swift @@ -7,7 +7,9 @@ // import Foundation - +#if canImport(UIKit) +import UIKit +#endif /// A parent class for all diff calculators. Don't use it directly. public class AbstractDiffCalculator { @@ -57,7 +59,7 @@ public class AbstractDiffCalculator { #if os(iOS) || os(tvOS) let row = indexPath.row #endif - #if os(macOS) + #if os(macOS) || os(watchOS) let row = indexPath.item #endif return self.sectionedValues[indexPath.section].1[row] diff --git a/Dwifft/Dwifft.swift b/Dwifft/Dwifft.swift index 5efe041..91fc040 100644 --- a/Dwifft/Dwifft.swift +++ b/Dwifft/Dwifft.swift @@ -36,10 +36,10 @@ public enum DiffStep : CustomDebugStringConvertible { /// The value to be inserted or deleted. public var value: Value { switch(self) { - case let .insert(j): - return j.1 - case let .delete(j): - return j.1 + case let .insert(_, value): + return value + case let .delete(_, value): + return value } } } diff --git a/Package.swift b/Package.swift index df9459e..1d7af0d 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.2 // import PackageDescription @@ -6,8 +6,6 @@ import PackageDescription let package = Package( name: "Dwifft", platforms: [ - .iOS(.v8), - .tvOS(.v9), .macOS(.v10_11) ], products: [