# Added and Deleting TODO items

**URL:** <https://forums.kodeco.com/t/added-and-deleting-todo-items/38544>\
**Category:** iOS Apprentice\
**Created:** [January 13, 2018, 4:40am UTC](https://forums.kodeco.com/t/added-and-deleting-todo-items/38544 "2018-01-13T04:40:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harrybrock](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/harrybrock/32/73819_2.png) [@harrybrock](https://forums.kodeco.com/u/harrybrock)\
**Post date:** [January 13, 2018, 4:40am UTC](https://forums.kodeco.com/t/added-and-deleting-todo-items/38544/1 "2018-01-13T04:40:24Z")

</div>

Maybe I’m thinking ahead here. But is there a way to use the observer pattern so that the data in the array/collection is tied to the tableview cells? That way when the collection is updated the cells are refreshed.

---

<div class="post-metadata">

**Author:** ![fahim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/fahim/32/110943_2.png) [@fahim](https://forums.kodeco.com/u/fahim)\
**Post date:** [January 13, 2018, 8:45am UTC](https://forums.kodeco.com/t/added-and-deleting-todo-items/38544/2 "2018-01-13T08:45:46Z")

</div>

> [@harrybrock](#):
>
> But is there a way to use the observer pattern so that the data in the array/collection is tied to the tableview cells? That way when the collection is updated the cells are refreshed.

I don’t know if this solution works with Swift 4 since I have not tried this approach previously, but you could try something similar to what is detailed in this SO post:

> <https://stackoverflow.com/questions/41118406/how-do-i-know-if-a-value-of-an-element-inside-an-array-was-changed>

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [June 28, 2018, 8:48pm UTC](https://forums.kodeco.com/t/added-and-deleting-todo-items/38544/3 "2018-06-28T20:48:38Z")

</div>

This topic was automatically closed after 166 days. New replies are no longer allowed.
