Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings for Xcode 12, when used from SPM #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dwifft/AbstractDiffCalculator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Section: Equatable, Value: Equatable> {

Expand Down Expand Up @@ -57,7 +59,7 @@ public class AbstractDiffCalculator<Section: Equatable, Value: Equatable> {
#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]
Expand Down
8 changes: 4 additions & 4 deletions Dwifft/Dwifft.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public enum DiffStep<Value> : 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
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// swift-tools-version:5.1
// swift-tools-version:5.2
//

import PackageDescription

let package = Package(
name: "Dwifft",
platforms: [
.iOS(.v8),
.tvOS(.v9),
.macOS(.v10_11)
],
products: [
Expand Down