PublishSubject cell issue RXswift
Problem:
class myCell: UITableViewCell {
@IBOutlet weak var NameFld: TextField!
var disposeBag = DisposeBag()
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
The above is my code It produces error that if i tried for reuse that cell all values collapsed
Solution:
override func prepareForReuse() {
disposeBag = DisposeBag()
}
You have to add the above code in your cell.Because if you are using only one disposebag the value conflicts with another while reuse for the cell.For every reuse you have to use seperate dispose bag.
Comments
Post a Comment