Merge pull request 'fix warnings' (#1) from fix/xcode_15 into master

Reviewed-on: #1
This commit is contained in:
Ivan Smolin 2024-01-30 22:08:00 +03:00
commit 3fefa09c3a
6 changed files with 25 additions and 32 deletions

View File

@ -5,6 +5,9 @@ import PackageDescription
let package = Package(
name: "TableKit",
platforms: [
.iOS(.v12)
],
products: [
.library(

View File

@ -1,4 +1,4 @@
public protocol ExpandableCellViewModel: class {
public protocol ExpandableCellViewModel: AnyObject {
var expandableState: ExpandableState { get set }

View File

@ -414,36 +414,36 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
extension TableDirector {
@discardableResult
open func append(section: TableSection) -> Self {
public func append(section: TableSection) -> Self {
append(sections: [section])
return self
}
@discardableResult
open func append(sections: [TableSection]) -> Self {
public func append(sections: [TableSection]) -> Self {
self.sections.append(contentsOf: sections)
return self
}
@discardableResult
open func append(rows: [Row]) -> Self {
public func append(rows: [Row]) -> Self {
append(section: TableSection(rows: rows))
return self
}
@discardableResult
open func insert(section: TableSection, atIndex index: Int) -> Self {
public func insert(section: TableSection, atIndex index: Int) -> Self {
sections.insert(section, at: index)
return self
}
@discardableResult
open func replaceSection(at index: Int, with section: TableSection) -> Self {
public func replaceSection(at index: Int, with section: TableSection) -> Self {
if index < sections.count {
sections[index] = section
}
@ -451,20 +451,20 @@ extension TableDirector {
}
@discardableResult
open func delete(sectionAt index: Int) -> Self {
public func delete(sectionAt index: Int) -> Self {
sections.remove(at: index)
return self
}
@discardableResult
open func remove(sectionAt index: Int) -> Self {
public func remove(sectionAt index: Int) -> Self {
return delete(sectionAt: index)
}
@discardableResult
open func clear() -> Self {
public func clear() -> Self {
rowHeightCalculator?.invalidate()
sections.removeAll()
@ -474,7 +474,7 @@ extension TableDirector {
// MARK: - deprecated methods
@available(*, deprecated, message: "Use 'delete(sectionAt:)' method instead")
@discardableResult
open func delete(index: Int) -> Self {
public func delete(index: Int) -> Self {
sections.remove(at: index)
return self

View File

@ -37,14 +37,8 @@ public protocol RowConfigurable {
}
public protocol RowActionable {
@available(iOS 11, *)
var leadingContextualActions: [UIContextualAction] { get }
@available(iOS 11, *)
var trailingContextualActions: [UIContextualAction] { get }
@available(iOS 11, *)
var performsFirstActionWithFullSwipe: Bool { get }
@available(iOS, deprecated: 11, message: "Use leadingContextualActions, trailingContextualActions instead")

View File

@ -27,18 +27,15 @@ open class TableRow<CellType: ConfigurableCell>: Row where CellType: UITableView
@available(iOS, deprecated: 11, message: "Use leadingContextualActions, trailingContextualActions instead")
open private(set) var editingActions: [UITableViewRowAction]?
@available(iOS 11, *)
open var leadingContextualActions: [UIContextualAction] {
[]
}
@available(iOS 11, *)
open var trailingContextualActions: [UIContextualAction] {
[]
}
@available(iOS 11, *)
open var performsFirstActionWithFullSwipe: Bool {
false
}
@ -78,7 +75,6 @@ open class TableRow<CellType: ConfigurableCell>: Row where CellType: UITableView
actions?.forEach { on($0) }
}
@available(iOS 11, *)
public init(item: CellType.CellData,
actions: [TableRowAction<CellType>]? = nil) {

View File

@ -2,15 +2,15 @@ Pod::Spec.new do |s|
s.name = 'TableKit'
s.module_name = 'TableKit'
s.version = '2.11.0'
s.version = '2.11.1'
s.homepage = 'https://github.com/maxsokolov/TableKit'
s.summary = 'Type-safe declarative table views with Swift.'
s.author = { 'Max Sokolov' => 'i@maxsokolov.net' }
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.platforms = { :ios => '8.0' }
s.ios.deployment_target = '8.0'
s.platforms = { :ios => '12.0' }
s.ios.deployment_target = '12.0'
s.source_files = 'Sources/*.swift'
s.source = { :git => 'https://github.com/maxsokolov/TableKit.git', :tag => s.version }