You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Match the color of (-) icon and delete button to the color of the "Add Videos" button.
Change "Delete" to "Remove."
Replace number / play icon with (-) icon when editing (i.e. don't move the thumbnail or text).
Make sure the previous video always hides its separator.
Numbering Challenges
The number label is already included in the xib, but we decided to hide it because of challenges when moving the rows.
In particular, when we move a row in the table, we need to update the number of all cells between the source row and the destination row. The code below works great when all of the rows to update are on the screen, but it fails when there are rows that need to update but are not currently visible.
// update the row numbering
letfirst=min(sourceIndexPath.row, destinationIndexPath.row)letlast=max(sourceIndexPath.row, destinationIndexPath.row)letupdate=(sourceIndexPath.row < destinationIndexPath.row)?-1:1forrowin first...last {letindexPath=IndexPath(row: row, section:0)iflet cell = tableView.cellForRow(at: indexPath)as?VideoQueueTableViewCell{if row == sourceIndexPath.row {
cell.number ="\(destinationIndexPath.row +1)" // set number of moved row
}else{
cell.number ="\(row +1+ update)" // set number of intermediate row
}}}
The following code does not work, however. It causes visual glitches by trying to reload rows before the move takes place. For the same reason, I suspect simply reloading all rows would fail, too.
// update the video numbers
letfirst=min(sourceIndexPath.row, destinationIndexPath.row)letlast=max(sourceIndexPath.row, destinationIndexPath.row)letrows=[Int](first...last).map(){ row inIndexPath(row: row, section:0)}
tableView.reloadRows(at: rows, with:.automatic)
Previous Video Challenges
There's a particular edge case that is not handled by the current code:
Create a stream with 5 videos: [A, B, C, D, E].
Select video C to highlight it.
Notice how video B hides its separator, as desired.
Delete video B.
Notice how video A now hides its separator, as desired.
Scroll down to move video A off the screen.
Scroll back up to move video A onto the screen.
Notice how video A now shows its separator. Why?
Using break points, I've found that video A gets removed when scrolled off screen, then reloaded with the cellForRowAt function when scrolled back on screen. But as far as I can tell, the isPreviousVideo property is properly getting set to true. So why isn't the separator being hidden?
The text was updated successfully, but these errors were encountered:
The numbering issues and previous video issues may be related. The off-screen rows should be reloaded by cellForRowAt, which should properly set the number and isPreviousVideo properties. But instead, it almost seems like the cells are being set from a cache...
Numbering Challenges
The number label is already included in the xib, but we decided to hide it because of challenges when moving the rows.
In particular, when we move a row in the table, we need to update the number of all cells between the source row and the destination row. The code below works great when all of the rows to update are on the screen, but it fails when there are rows that need to update but are not currently visible.
The following code does not work, however. It causes visual glitches by trying to reload rows before the move takes place. For the same reason, I suspect simply reloading all rows would fail, too.
Previous Video Challenges
There's a particular edge case that is not handled by the current code:
Using break points, I've found that video A gets removed when scrolled off screen, then reloaded with the
cellForRowAt
function when scrolled back on screen. But as far as I can tell, theisPreviousVideo
property is properly getting set totrue
. So why isn't the separator being hidden?The text was updated successfully, but these errors were encountered: