Eureka: I want to remove a row, which api should I use?

Created on 23 Aug 2016  路  8Comments  路  Source: xmartlabs/Eureka

help wanted awaiting response question

Most helpful comment

section.removeAtIndex(rowIndex)
section.removeFirst()
section.removeLast()
//or
section.remove(:at) in swift 3

section[index] = nil may work too.

having a row is pretty simple to get its index. We can always get its section and the form by...

row.section?.form

section.indexOf(row)
section.index(of:) in swift 3.

and get its index is pretty simple as well.

Both Form and Section types conform to MutableCollection protocol.

Hope it helps.

All 8 comments

form.allRows returns all the rows, if you know the index you can call form.allRows.removeAtIndex

2016-08-24 8 04 56

You can access the section of the row and then remove the row from that section.

section.removeAtIndex(rowIndex)
section.removeFirst()
section.removeLast()
//or
section.remove(:at) in swift 3

section[index] = nil may work too.

having a row is pretty simple to get its index. We can always get its section and the form by...

row.section?.form

section.indexOf(row)
section.index(of:) in swift 3.

and get its index is pretty simple as well.

Both Form and Section types conform to MutableCollection protocol.

Hope it helps.

This is my code and UI, if i do this 'form[0].removeLast()', all row will hidden
2016-08-25 8 30 01
2016-08-25 8 29 44

try with this..

var section = form[0]
section.removeLast()

@huangboju Could you solve this?

Yeah, solved

Was this page helpful?
0 / 5 - 0 ratings