I have a two different ways of representing data in my app: via UITableView
or UIScrollView
.
So I have 2 main classes: AppTableView: UITableView
and AppScrollView: UIScrollView
.
And I want to implement the same additions to both views. So I wrote two classes: SomeAdditionsTableView: UITableView
and SomeAdditionsScrollView: UIScrollView
. The code of this classes is the same.
Main classes now looks like
AppTableView: SomeAdditionsTableView
and AppScrollView: SomeAdditionsScrollView
.
How to avoid this code duplicate? Thanks in advance.