0

I have created a reorder-able UITableView. I am loading data from Realm, and showing that data into UITableView. My UITableView has Section and rows.

now User can hold Any cell in any section and can reorder them in 2 ways

  1. User can reorder cell with in the same section.
  2. User can reorder cell across the different section.

What I need:

Once the user has made the order he should see same item in same order when he come back to App. For any type of reordering I have to do indexing. But I do not have clue how to reorder them in database.

My Idea to resolve the requirement

My idea is to include the String type value in the Model where I can replace something like (1,10) that will indicate section 1, row 10.

But I do not have idea how to tackle this and how to save the reordering as i need here. Any idea about that?? please share

Kathiresan Murugan
  • 2,783
  • 3
  • 23
  • 44
A.s.ALI
  • 1,992
  • 3
  • 22
  • 54
  • Possible duplicate of [How to get notified of UITableViewCell move start and end](https://stackoverflow.com/questions/9898388/how-to-get-notified-of-uitableviewcell-move-start-and-end) – hardik parmar Jan 16 '19 at 13:35
  • Why don't you keep the section and the row within the database and get your list of data ordered by these values? – Francis.Beauchamp Jan 16 '19 at 14:53
  • @Francis.Beauchamp did asa you said already and solved in that way. My only confusion was how to save in DB in real time – A.s.ALI Jan 17 '19 at 07:54

0 Answers0