I am making my own custom swipeable cells where user can swipe a cell to show options. Currently all my subviews are added to the contentView
of the cell. And I have added my options to the backgroundView
of the cell.
Is it okay for me to add my custom content to the backgroundView
?
Is it okay for me to manually change the position of the frame of the contentView
when doing my swipe on the cell? And then I will reset it back to its original position after it's completed. Or should I use another view as a container?
Is it okay for me to add my custom content to the backgroundView?
No. The backgroundView
should be limited to a simple view whose basic properties, such as its backgroundColor
, you configure. It would be even better, nowadays, to use the cell's background configuration instead.
Is it okay for me to manually change the position of the frame of the contentView when doing my swipe on the cell?
No. Your content should be inside a view inside a scroll view (or other "slideable" view) inside the content view. Don't touch the content view itself.