2017-10-30 6 views
0

PushRow와 연결된 각 ListCheckCell에 이미지와 텍스트를 포함하고 싶습니다. 기본 동작은 각 옵션의 텍스트 만 표시하는 것입니다. 이상적으로 그냥 ListCheckCell update() 함수를 재정의하지만 ListCheckCell이 SelectorViewController를 통해 PushRow에 내장 된 방식 때문에이 작업을 수행 할 수있는 확실한 방법을 찾지 못했습니다.PushRow 셀에 UIImageView 포함

답변

0

해결책을 찾았습니다. PushRow ViewController 내에서 셀을 변경하려면 selectableController에 selectableRowCellUpdate라는 var가 있습니다. PushRow의 모습은 다음과 같습니다.

<<< PushRow<SomeType>() { 
      $0.title = "Category" 

      $0.selectorTitle = "Category" 

      }.onPresent { from, to in 
       to.selectableRowCellUpdate = { (cell, row) in 
        let text = row.selectableValue?.toString() 
        let imageName = row.selectableValue?.rawValue 
        cell.imageView?.image = UIImage(named: imageName!) 
        cell.textLabel?.text = text 
       } 
    }