Как ограничить строку для вставки с помощью MultivaluedSection в Eureka - PullRequest
0 голосов
/ 28 августа 2018

Я добавляю строку в форму Eureka, используя MultivaluedSection, я хочу добавить только 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

`

...