Diff logic for displaying, Interactor or Presenter?
<p>Considering <a href="https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html" rel="nofollow">Clean Architecture</a> from Uncle Bob, should a diff logic for calculating changes in the UI go in the presenter or in the Interactor?
I'll be more specific: (I'm more used to iOS so I'll use it as an example)</p>

<p>Let's say you are displaying messages in a UITableView, and when a new message arrives, you add it to the data source array and also insert a row in the UITableView (we definitely don't wanna reload the entire table view and make the user scroll back to the last message).</p>

<p><strong>Option 1: Logic in the UI</strong></p>

<p>The Interactor will send the updated list of messages (all messages, not just the one that arrived) and the presenter will diff between the current data source array and the new messages array, and then decide which operations to do on the View (insert row if a message was received, delete row if a message was deleted, reload row if a message changes status to seen) (much like <a href="https://facebook.github.io/react/" rel="nofollow">React</a> does).</p>

<p><strong>Option 2: Logic in the Interactor</strong></p>

<p>Move that logic to the Interactor, and have multiple delegate method in the Presenter (didUpdateMessage, didDeleteMessage, didReceiveMessage).</p>

<p>Since it is some logic that could be shared, my initial thought was to put it in the Interactor, but since I've seen React, it makes me think that it would be nice to have that in the Presenter (if I decide to go React Native instead of Native native, the logic wouldn't change if I choose option 1).</p>

<p>What is the correct approach here (by correct I mean even assuming I don't ever use React Native)?</p>