RxDataSources icon indicating copy to clipboard operation
RxDataSources copied to clipboard

Override SectionedViewType behavior in UITableView subclasses

Open teodorpenkov opened this issue 6 years ago • 0 comments

Currently it's not possible to override SectionedViewType default method implementations in subclasses of UITableView. I'd like to prevent the default animations and just re-render the cell just like Apple suggests in reload rows Discussion https://developer.apple.com/documentation/uikit/uitableview/1614935-reloadrows.

Unfortunately when I try to override reloadItemsAtIndexPaths the compiler complains with Overriding non-@objc declarations from extensions is not supported.

That's because the default methods are added like this https://github.com/RxSwiftCommunity/RxDataSources/blob/76973cd78e853cdcf4e6781f8dde002a6518198d/Sources/RxDataSources/UI%2BSectionedViewType.swift#L22

Is this the intended behavior? If yes - what's the reasoning?

I can think of 2 possible solutions if this is not the desired behavior:

  1. Mark SectionedViewType with @objc
  2. Implement the default methods like this: extension SectionViewType where Self: UITableView

teodorpenkov avatar Jun 23 '19 16:06 teodorpenkov