I have a UIScrollView
with a UILabel
+ UITableView
as a subview. Here is how it looks in a Storyboard: https://cln.sh/k2QiFS
In my tableView
I have implemented a drag and drop for its cells through edit mode. When I drag a cell and move it down to the bottom of the tableView,
the scrollView
doesn't scroll and not showing cells which is currently out of the visible area.
So I should drop the cell, scroll the UIScrollView
manually and again drag the cell.
Here is the behaviour on GIF: https://cln.sh/j45g83
If I get rid out of scrollView,
the basic tableView
behaviour automatically scrolls to the up/bottom, but the reason I added the scrollView
is to be able the UILabel
be scrolled too.
Here is my code for moveRowAt():
func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
var currencies = fetchedResultsController.fetchedObjects!
let currency = fetchedResultsController.object(at: sourceIndexPath)
currencies.remove(at: sourceIndexPath.row)
currencies.insert(currency, at: destinationIndexPath.row)
for (index, currency) in currencies.enumerated() {
currency.rowForCurrency = Int32(index)
}
coreDataManager.save()
}
How can I turn on a scroll for my UIScrollView?
What is the UILabel Here on GIF: https://cln.sh/j45g83 ?
When do you want the label to move ? When you scroll the tableView ?
If so, why not just put this label in HeaderView of the table ?
Having a tableView (which is a scrollView) inside another scrollView is complex to handle.
See discussion here: