Xcode 使用 SegmentedRow 的 Eureka Loop 在选择选项时崩溃

Xcode Eureka Loop with SegmentedRow crashes when selecting an option

我正在为 xcode swift 使用 Eureka 插件,并且在选择选项 "OTHER" 时遇到应用程序崩溃问题。如果选择 "OTHER",它应该在日期下方有一个 TextRow。

错误:线程 1:断言失败:重复标记段

我很确定问题出在 <<< SegmentedRow<String>("segments"){ 没有递增 "segments1"、"segments2" 等...每个循环行。我也不知道如果必须增加段,我怎么能让 [=14=].hidden 行工作:[=15=].hidden = "$segments != 'OTHER'"

form
            +++ Section()

            for (index, date) in fdates.enumerated() {
                form.last!
                <<< SegmentedRow<String>("segments"){
                    [=11=].title = date
                    [=11=].options = ["FULL", "AM", "PM", "OTHER"]
                    [=11=].value = "FULL"
                    }.cellUpdate { cell, row in

                        cell.segmentedControl.setContentHuggingPriority(.defaultHigh, for: .horizontal)

                        if (self.type == "Lieu") {
                            cell.segmentedControl.setWidth(CGFloat(47), forSegmentAt: 0)
                            cell.segmentedControl.setWidth(CGFloat(40), forSegmentAt: 1)
                            cell.segmentedControl.setWidth(CGFloat(40), forSegmentAt: 2)
                            cell.segmentedControl.setWidth(CGFloat(57), forSegmentAt: 3)
                        }

                        //print(index)
                    }

                +++ Section(){
                    [=11=].tag = "other_\(index)"
                    [=11=].hidden = "$segments != 'OTHER'" 
                }
                <<< TextRow(){
                    [=11=].title = "This will be changed to a time picker after..."
                }
            }

** EDIT ** 我设法通过将索引行与 "segments" 一起使用来阻止崩溃,但是单击 [= 时 TextRow 仍然没有显示30=]:

let tag = "segments\(index)"
<<< SegmentedRow<String>(tag){

+++ Section(){
    [=12=].tag = "other\(index)"
    [=12=].hidden = Condition(stringLiteral: "$segments\(index) != 'OTHER'")
}

作者告诉我将 form +++ Section() 移动到 <<< SegmentedRow<String>(tag){ 之前的循环中,这行得通。

for (index, date) in fdates.enumerated() {
    form +++ Section()
    let tag = "segments\(index)"
     <<< SegmentedRow<String>(tag){
         [=10=].title = date