You don’t need it at all. I only wrote it to make the rest of my code more succinct & readable. If you’d rather type
if section == 0 {
do something to itemStore.over50Items
} else {
do the same something to itemStore.under50Items
}
over & over, go ahead. But anytime I find myself typing the same thing repeatedly, I start thinking about wrapping it in a function instead.
It was almost a month ago, so I don’t recall now exactly how I got to that. I will say that I don’t do any searching directly on the Apple web site, I do all my searches on Google.
If I do a Google search on UITableViewDelegate, Apple’s web site for that protocol is the first search result. I might have looked at that & then scanned it for something mentioning “swipe”.
Or I might have just typed something like “swift table view swipe right” into Google & started reading.
As for the error messages: The first one is because you forgot the “:” after for in your getSectionItems call. The second one I think is because the argument list for the closure has an extra x,’ on the end of the third argument. It should be (action, view, completionHandler).