レルムオブジェクトの名前に基づいて値を設定しようとしてLadder {
いますが、セルではなくテキストとして表示され続けますname
。ここに私のコードがあります
<<< MultipleSelectorRow<Ladder>("Rank") {
$0.hidden = Condition.predicate(NSPredicate(format: "$Game == nil"))
$0.title = $0.tag
}.cellUpdate { cell, row in
let formvalues = self.form.values()
let game = formvalues["Game"] as! Game
let ranks = Array(game.ranks)
row.options = ranks
row.displayValueFor = { (rowValue: Set<Ladder>?) in
return rowValue?.map({ $0.name }).sorted().joined(separator: ", ")
}
cell.textLabel?.font = UIFont(name: "Avenir-Book", size: 16)
cell.preservesSuperviewLayoutMargins = false
cell.separatorInset = UIEdgeInsets.zero
cell.layoutMargins = UIEdgeInsets.zero
}
ランク出力
[Ladder {
id = 58268b08f5f51a16b8d53472;
name = Bronze;
}, Ladder {
id = 58268b08f5f51a16b8d53473;
name = Silver;
}, Ladder {
id = 58268b08f5f51a16b8d53474;
name = Gold;
}, Ladder {
id = 58268b08f5f51a16b8d53475;
name = Platinium;
}, Ladder {
id = 58268b08f5f51a16b8d53476;
name = Diamond;
}, Ladder {
id = 58268b08f5f51a16b8d53477;
name = Master;
}, Ladder {
id = 58268b08f5f51a16b8d53478;
name = Challenger;
}]
領域モデル
class Ladder: Object {
dynamic var id = ""
dynamic var name = ""
override static func primaryKey() -> String? {
return "id"
}
}