PublishSubject cell issue RXswift

 Problem:

class myCellUITableViewCell {


    @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

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift