remove outdated actions and swift tools version
This commit is contained in:
parent
01134b83b4
commit
427103acae
|
|
@ -1,4 +1,4 @@
|
|||
// 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
|
||||
|
|
|
|||
|
|
@ -346,13 +346,7 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
|
|||
open func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
|
||||
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,
|
||||
leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
||||
let currentRow = sections[indexPath.section].rows[indexPath.row]
|
||||
|
|
@ -362,8 +356,7 @@ open class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate {
|
|||
|
||||
return configuration
|
||||
}
|
||||
|
||||
@available(iOS 11, *)
|
||||
|
||||
open func tableView(_ tableView: UITableView,
|
||||
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
||||
let currentRow = sections[indexPath.section].rows[indexPath.row]
|
||||
|
|
|
|||
|
|
@ -40,9 +40,6 @@ public protocol RowActionable {
|
|||
var leadingContextualActions: [UIContextualAction] { get }
|
||||
var trailingContextualActions: [UIContextualAction] { get }
|
||||
var performsFirstActionWithFullSwipe: Bool { get }
|
||||
|
||||
@available(iOS, deprecated: 11, message: "Use leadingContextualActions, trailingContextualActions instead")
|
||||
var editingActions: [UITableViewRowAction]? { get }
|
||||
|
||||
func isEditingAllowed(forIndexPath indexPath: IndexPath) -> Bool
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@ open class TableRow<CellType: ConfigurableCell>: Row where CellType: UITableView
|
|||
|
||||
public let item: CellType.CellData
|
||||
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] {
|
||||
[]
|
||||
|
|
@ -64,17 +61,6 @@ open class TableRow<CellType: ConfigurableCell>: Row where CellType: UITableView
|
|||
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,
|
||||
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
|
||||
}
|
||||
|
||||
if #available(iOS 11, *) {
|
||||
return !leadingContextualActions.isEmpty
|
||||
|| !trailingContextualActions.isEmpty
|
||||
|| actions[TableRowActionType.clickDelete.key] != nil
|
||||
} else {
|
||||
return editingActions?.isEmpty == false || actions[TableRowActionType.clickDelete.key] != nil
|
||||
}
|
||||
return !leadingContextualActions.isEmpty
|
||||
|| !trailingContextualActions.isEmpty
|
||||
|| actions[TableRowActionType.clickDelete.key] != nil
|
||||
}
|
||||
|
||||
// MARK: - actions -
|
||||
|
|
|
|||
Loading…
Reference in New Issue