From b9024f24f3a1cafec973f52cb84cbe6a6d4fa478 Mon Sep 17 00:00:00 2001 From: Roman Podymov Date: Wed, 1 May 2024 09:33:58 +0200 Subject: [PATCH] More for iOS only --- Sources/CommonAppleKit/CAListViewCell.swift | 3 +++ Sources/CommonAppleKit/CAScreenItem.swift | 10 +++++----- Tests/CommonAppleKitTests/CommonAppleKitTests.swift | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Sources/CommonAppleKit/CAListViewCell.swift b/Sources/CommonAppleKit/CAListViewCell.swift index 55d0ef7..8cad2f1 100644 --- a/Sources/CommonAppleKit/CAListViewCell.swift +++ b/Sources/CommonAppleKit/CAListViewCell.swift @@ -9,8 +9,11 @@ import Foundation public protocol CAListViewCellDelegate: AnyObject { + #if canImport(UIKit) func onCellTap(data: Any?) + #endif func onAction(data: Any?) + func onHeaderWillBeDisplayed() func onFooterWillBeDisplayed() } diff --git a/Sources/CommonAppleKit/CAScreenItem.swift b/Sources/CommonAppleKit/CAScreenItem.swift index 89ff30e..320cdcb 100644 --- a/Sources/CommonAppleKit/CAScreenItem.swift +++ b/Sources/CommonAppleKit/CAScreenItem.swift @@ -15,17 +15,17 @@ open class CAScreenItem: CAView { } #endif + open func didChangeTraitCollection() { + + } + #if canImport(AppKit) open override func mouseDown(with _: CAEvent) { didTap() } - #endif - - open func didChangeTraitCollection() { - - } open func didTap() { } + #endif } diff --git a/Tests/CommonAppleKitTests/CommonAppleKitTests.swift b/Tests/CommonAppleKitTests/CommonAppleKitTests.swift index 7afbdbd..95b7a53 100644 --- a/Tests/CommonAppleKitTests/CommonAppleKitTests.swift +++ b/Tests/CommonAppleKitTests/CommonAppleKitTests.swift @@ -171,10 +171,12 @@ final class CommonAppleKitTests: XCTestCase { } extension CommonAppleKitTests: CAListViewCellDelegate { + #if canImport(UIKit) func onCellTap(data: Any?) { } - + #endif + func onAction(data: Any?) { }