Kodeco Forums

How To Make a Gesture-Driven To-Do List App Like Clear in Swift: Part 2/2

Learn how to make a gesture-driven to-do list app like Clear, complete with table view tricks, swipes, and pinches.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2152-how-to-make-a-gesture-driven-to-do-list-app-like-clear-in-swift-part-2-2

great! thanks for your share!!!

tks Ms. Audrey Tam, yr guide is really useful. Many tks. :thumbsup:

Great tutorial! Just one thing, when we continuously drag the scrollview up and down, the second time we drag it, there will be no placeholderCell appearing. To fix that, all we need to do is change
pullDownInProgress = false to pullDownInProgress = scrollViewContentOffsetY <= 0.0 ? true : false
at the end of the scrollViewDidScroll method to continuously monitor for behavior change.
Thanks for sharing!

Excellent tutorial.

P.S. In case anyone needs it I managed to upgrade to codebase to Swift 2.2 & iOS 9.3, source code available here:

I am missing an obvious point here, but when I close the app, the todo list reverts to the hardcoded elements. How do I save the changes on the device so that they can be updated after a power cycle or after the app closes out. I may be having an exit problem, but I cant see it in debugging.

hi mjmiski, the sample app doesn’t save the user’s data. Our site has an old tutorial about NSCoding, and a video series about saving data. Or look at Apple’s getting-started sample at Apple Developer Documentation

Note that you don’t need to write encodeWithCoder etc, as the archiver knows how to encode an array of String.

There are tutorials from other sites online: google NSCoding, saving data or persisting data.

Thx audrey. Funny found the apple example right after my post. But like your guys tools a lot better. Thx again.

Hi there, its a great tutorial, help me a lot. Question, it is possible upgrade the tutorial with save function, that data in the list stay saved?
Thx

that’s outside the scope of this tutorial, but you can do it yourself — see my post, just 2 up from yours.

Thanks for this tutorial!
I tried to follow it using Xcode 8.3.2 (swift 3, target iOS 10.3). Everything works fine until I change the Labels to TextFields.
Then the scroll doesn’t work anymore. Slide left to delete and slide right to complete still work, but scroll down (or up) the todo list does not work.
Perhaps the text fields “keep” the slide/pan gesture for themselves and do not send them to the parent view, but I can’t figure out how to resolve this issue.
Anyone tried with this version of Xcode ? Do you have the same behavior or did I make a mistake somewhere?

does the keyboard appear when you try to scroll? maybe make the text field not the full width of the cell, so you have room to touch the cell without making the text field first responder?

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]