From da76188afda619b0b8245c55f73bdb4060497534 Mon Sep 17 00:00:00 2001 From: astrokin Date: Fri, 23 Feb 2018 01:16:39 +0300 Subject: [PATCH] add swap rows func. usefull for table row reordering while editing --- Sources/TableSection.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/TableSection.swift b/Sources/TableSection.swift index ddc93e7..d1a3e8a 100644 --- a/Sources/TableSection.swift +++ b/Sources/TableSection.swift @@ -89,6 +89,10 @@ open class TableSection { rows[index] = row } + open func swap(from: Int, to: Int) { + rows.swapAt(from, to) + } + open func delete(rowAt index: Int) { rows.remove(at: index) }