After studying the book I have tried to create a custom player component in xib file that includes buttons like play, pause, forward, backward etc. I have then used @IBDesignable class named Player that initializes this player in a view. All @IBOutlet for buttons are declared as public in this class with weak var reference.
I am using ViewController and trying to bind the player buttons from above custom component reactively in this way:
viewPlayer.btnPlayer.rx.tap
.subscribe(onNext: { [weak self] _ in
// other operational codes go here
}).disposed(by: disposeBag)
Now the issue is, when I close the controller btnPlayer tap subscription does not disposed off and it still occupy some resources. Whereas other controls which are defined in this ViewController file get disposed off automatically. Any idea why is this happening and how to overcome it?