Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
fec9537745 | |
|
|
246c0d06c0 | |
|
|
54bf141aff |
|
|
@ -1 +1 @@
|
||||||
5.0
|
5.7
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
// swift-tools-version:5.0
|
// swift-tools-version:5.7
|
||||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
|
||||||
|
|
||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
name: "TableKit",
|
name: "TableKit",
|
||||||
platforms: [
|
|
||||||
.iOS(.v12)
|
|
||||||
],
|
|
||||||
|
|
||||||
products: [
|
products: [
|
||||||
.library(
|
.library(
|
||||||
|
|
|
||||||
|
|
@ -346,13 +346,7 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
|
||||||
open func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
|
open func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
|
||||||
return sections[indexPath.section].rows[indexPath.row].isEditingAllowed(forIndexPath: indexPath)
|
return sections[indexPath.section].rows[indexPath.row].isEditingAllowed(forIndexPath: indexPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(iOS, deprecated: 11, message: "Use leadingSwipeActionsConfigurationForRowAt(:_) and trailingSwipeActionsConfigurationForRowAt(:_) instead")
|
|
||||||
open func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
|
|
||||||
return sections[indexPath.section].rows[indexPath.row].editingActions
|
|
||||||
}
|
|
||||||
|
|
||||||
@available(iOS 11, *)
|
|
||||||
open func tableView(_ tableView: UITableView,
|
open func tableView(_ tableView: UITableView,
|
||||||
leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
||||||
let currentRow = sections[indexPath.section].rows[indexPath.row]
|
let currentRow = sections[indexPath.section].rows[indexPath.row]
|
||||||
|
|
@ -362,8 +356,7 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
|
||||||
|
|
||||||
return configuration
|
return configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(iOS 11, *)
|
|
||||||
open func tableView(_ tableView: UITableView,
|
open func tableView(_ tableView: UITableView,
|
||||||
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
||||||
let currentRow = sections[indexPath.section].rows[indexPath.row]
|
let currentRow = sections[indexPath.section].rows[indexPath.row]
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,6 @@ public protocol RowActionable {
|
||||||
var leadingContextualActions: [UIContextualAction] { get }
|
var leadingContextualActions: [UIContextualAction] { get }
|
||||||
var trailingContextualActions: [UIContextualAction] { get }
|
var trailingContextualActions: [UIContextualAction] { get }
|
||||||
var performsFirstActionWithFullSwipe: Bool { get }
|
var performsFirstActionWithFullSwipe: Bool { get }
|
||||||
|
|
||||||
@available(iOS, deprecated: 11, message: "Use leadingContextualActions, trailingContextualActions instead")
|
|
||||||
var editingActions: [UITableViewRowAction]? { get }
|
|
||||||
|
|
||||||
func isEditingAllowed(forIndexPath indexPath: IndexPath) -> Bool
|
func isEditingAllowed(forIndexPath indexPath: IndexPath) -> Bool
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,6 @@ open class TableRow<CellType: ConfigurableCell>: Row where CellType: UITableView
|
||||||
|
|
||||||
public let item: CellType.CellData
|
public let item: CellType.CellData
|
||||||
private lazy var actions = [String: [TableRowAction<CellType>]]()
|
private lazy var actions = [String: [TableRowAction<CellType>]]()
|
||||||
|
|
||||||
@available(iOS, deprecated: 11, message: "Use leadingContextualActions, trailingContextualActions instead")
|
|
||||||
open private(set) var editingActions: [UITableViewRowAction]?
|
|
||||||
|
|
||||||
open var leadingContextualActions: [UIContextualAction] {
|
open var leadingContextualActions: [UIContextualAction] {
|
||||||
[]
|
[]
|
||||||
|
|
@ -64,17 +61,6 @@ open class TableRow<CellType: ConfigurableCell>: Row where CellType: UITableView
|
||||||
return CellType.self
|
return CellType.self
|
||||||
}
|
}
|
||||||
|
|
||||||
@available(iOS, deprecated: 11, message: "Use leadingContextualActions, trailingContextualActions instead")
|
|
||||||
public init(item: CellType.CellData,
|
|
||||||
actions: [TableRowAction<CellType>]? = nil,
|
|
||||||
editingActions: [UITableViewRowAction]? = nil) {
|
|
||||||
|
|
||||||
self.item = item
|
|
||||||
self.editingActions = editingActions
|
|
||||||
|
|
||||||
actions?.forEach { on($0) }
|
|
||||||
}
|
|
||||||
|
|
||||||
public init(item: CellType.CellData,
|
public init(item: CellType.CellData,
|
||||||
actions: [TableRowAction<CellType>]? = nil) {
|
actions: [TableRowAction<CellType>]? = nil) {
|
||||||
|
|
||||||
|
|
@ -108,13 +94,9 @@ open class TableRow<CellType: ConfigurableCell>: Row where CellType: UITableView
|
||||||
return invoke(action: .canEdit, cell: nil, path: indexPath) as? Bool ?? false
|
return invoke(action: .canEdit, cell: nil, path: indexPath) as? Bool ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
if #available(iOS 11, *) {
|
return !leadingContextualActions.isEmpty
|
||||||
return !leadingContextualActions.isEmpty
|
|| !trailingContextualActions.isEmpty
|
||||||
|| !trailingContextualActions.isEmpty
|
|| actions[TableRowActionType.clickDelete.key] != nil
|
||||||
|| actions[TableRowActionType.clickDelete.key] != nil
|
|
||||||
} else {
|
|
||||||
return editingActions?.isEmpty == false || actions[TableRowActionType.clickDelete.key] != nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - actions -
|
// MARK: - actions -
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ Pod::Spec.new do |s|
|
||||||
s.name = 'TableKit'
|
s.name = 'TableKit'
|
||||||
s.module_name = 'TableKit'
|
s.module_name = 'TableKit'
|
||||||
|
|
||||||
s.version = '2.11.1'
|
s.version = '2.12'
|
||||||
|
|
||||||
s.homepage = 'https://git.svc.touchin.ru/TouchInstinct/TableKit'
|
s.homepage = 'https://git.svc.touchin.ru/TouchInstinct/TableKit'
|
||||||
s.summary = 'Type-safe declarative table views with Swift.'
|
s.summary = 'Type-safe declarative table views with Swift.'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue