Great video! But I think using the swap method in moveRowAt is wrong. For example, you move first row after fourth row and the rows will be: second, third, fourth, first. But the array will be: fourth, second, third, first. Try to print the array in the console every time rows are moved. I would do something like this: let removedElement = models.remove(at: sourceIndexPath.row) models.insert(removedElement, at: destinationIndexPath.row)
@tonyren.tr52 жыл бұрын
I have the same issue when I did this implementation. I think you're right
@shanq73732 жыл бұрын
Saved my homework, thanks a lot
@iOSAcademy2 жыл бұрын
Youre welcome
@alifarhadi57044 жыл бұрын
That's great. keep going man, I like the style of your video.
@iOSAcademy4 жыл бұрын
Thanks! I appreciate it :)
@nileshjdarji3 жыл бұрын
This is great but when you come back to the app again the new order is not saved. Do you have a video to show the saving part? Thanks
@iOSAcademy3 жыл бұрын
Youll need to persist in db or user defaults
@senwhich2 жыл бұрын
Hi, appreciate how clear way of explanation you are using. Would like to ask you two question. 1. in case I have to views - table and collection, after reordering the table cells how can I reflect the reordered array also in collection view? 2. how can I keep the reordered array/table cells also after adding a new item/table cell in the array?
@Oisinkelly3082 жыл бұрын
This implementation changes the core array. So if you want it to reflect on the collectionview do collectionView.reloadData(). 2. Just do array.append and this will add to the end of the array, keeping the reordered items in their reordered spots
@parneetk032 жыл бұрын
Great video! How can we delete the items? I can swap them, but when I click on the minus icon on the left of the sort, nothing happens. Please explain.
@수학쌤우리소쌤3 жыл бұрын
It’s wondering video^^ Please show me only program without storybord. I tried it but can’t
@bala_animeti3 жыл бұрын
Is it possible to change the default reorder icon while editing?
@АлинаЩиголева-и6ц3 жыл бұрын
Thank you a lot!
@iOSAcademy3 жыл бұрын
Youre welcome!
@akhtarabbas57602 жыл бұрын
thank you :)
@iOSAcademy2 жыл бұрын
Youre welcome
@gunter-s1x3 жыл бұрын
Would it be different for a table created in another view controller?
@iOSAcademy3 жыл бұрын
Nope
@fiazhussain16453 жыл бұрын
Good Job Sir
@iOSAcademy3 жыл бұрын
Thanks
@fiazhussain16453 жыл бұрын
@@iOSAcademy sir where from you???? i want to study from you live(face to face)
@allaboutnaturesound60334 жыл бұрын
nice video
@iOSAcademy4 жыл бұрын
Thanks!
@gandalfgrey913 жыл бұрын
how do you swap the index of core data entities?
@bitsurfer01013 жыл бұрын
can you change the name of the bar button (ex. done ) while it is being edited and then change it back to sort when it is done?
@oleh33753 жыл бұрын
Use method setEditing and in this method, u'll write editButtonItem.title = "Done" and change name
@vladwinter32463 жыл бұрын
@@oleh3375, don't know why but it doesn't work for me. The title stays the same(
@markme70924 жыл бұрын
Hey Please make a video to Save & display time & date in UITableView Cell Core Data?
@iOSAcademy4 жыл бұрын
On my list :) stay tuned
@vladwinter32463 жыл бұрын
Nice video, but how can I make my table delete elements? I mean we have the edit button with red minuses once it is pressed, but when I swipe the element left and click "delete" - nothing happens please help)
@vladimirpazdera49072 жыл бұрын
You need to define leadingSwipeActionsConfigurationForRowAt or trailingSwipeActionsConfigurationForRowAt method and after then it will work.