swift3 - iOS eureka-forms LabelRow hidden condition not evaluating -
setup
- swift 3.1
- ios 10.0
- eureka 3.0
problem
can not make labelrow
hide textarearow
hidden state. label defined before adding both section. gets added on top of text.
code
after few different ways define condition
, when debugging, seems function not getting called. in first 2 gets called once, not when textarearow
changes hide or show
let switchrowtag = "switchrowtag" form +++ section <<< switchrow(switchrowtag) { row in row.title = "select me"} // test hiding functions ======================== let tag = "textarea" let title = "test hiding" let labeltag = "\(tag)_label" let textarea = textarearow(tag) { $0.title = title $0.tag = tag $0.placeholder = title $0.textareaheight = .dynamic(initialtextviewheight: 110) $0.hidden = condition.predicate(nspredicate(format: "$\(switchrowtag) == false")) } let labelrow = labelrow(labeltag) { $0.title = title $0.tag = labeltag /* try setting function after adding section $0.hidden = condition.function([tag], { form in if let textrow = form.rowby(tag: tag) as? textarearow { return textrow.ishidden } else { return false } }) */ } section <<< labelrow <<< textarea // never evaluated /* labelrow.hidden = condition.function([tag], { form in if let textrow = form.rowby(tag: tag) as? textarearow { return textrow.ishidden } else { return false } }) */ if let labelrow = form.rowby(tag: labeltag) as? labelrow { labelrow.hidden = condition.function([tag], { form in if let textrow = form.rowby(tag: tag) as? textarearow { return textrow.ishidden } else { return false } }) }
it not supported.
eureka supports reevaluating hidden conditions, when row related tag depended upon has change of value only. not change of visibility (ref).
Comments
Post a Comment