I have a UITableViewCell
subclass NameInput
that connects to an xib with a custom init
method.
class NameInput: UITableViewCell {
class func make(label: String, placeholder: String) -> NameInput {
let input = NSBundle.mainBundle().loadNibNamed("NameInput", owner: nil, options: nil)[0] as NameInput
input.label.text = label
input.valueField.placeholder = placeholder
input.valueField.autocapitalizationType = .Words
return input
}
}
Is there a way I can initialize this cell in the viewDidLoad
method and still reuse it? Or do I have to register the class itself with a reuse identifier?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…