如何在Eureka中使用MultivaluedSection限制要插入的行

时间:2018-08-28 05:08:48

标签: swift eureka-forms

我正在使用MultivaluedSection将行添加到Eureka表单中,我想使用自定义Row仅添加4行,但是我无法限制该计数我该怎么做,这是我的代码,请检查

       `+++
        MultivaluedSection(multivaluedOptions: .Insert) { sec in
            sec.addButtonProvider = { _ in return ButtonRow("jgj") { row in
                row.tag = "Add Email"
                row.title = "+ Add Email"
                }.cellUpdate { cell, row in
                    cell.textLabel?.textAlignment = .left
                }
            }

            sec.multivaluedRowToInsertAt = { index in


                if index < 4 {
                    return AddInformationRow { row in
                        row.tag = "Add Email Address\(index)"
                        row.placeholder = "Add Email Address"
                       // print(index)
                        self.rowindex = index
                        print(self.rowindex)
                    }

                 }

               return AddInformationRow()
            }


            sec.showInsertIconInAddButton = false

`

0 个答案:

没有答案