0

これは、RSS フィード リーダーで通常のテーブル セルを生成するために使用するコードです。

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    // Function adds the title to each cell
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
    let item = feedItems[indexPath.row] as MWFeedItem

    cell.textLabel?.text = item.title
    return cell

}

上記の関数に if ステートメントを追加して、フィードがユーザーによって既に削除されている場合に、関数がテーブル セルを生成しないようにしたいと考えています。削除されたかどうかを確認する方法は知っていますが (if の後の括弧の中に何が入るか)、実際の if ステートメントの中に何を入れるかはわかりません。

if(/*table cell has been deleted*/)
{
/*code that stops this feed from being regenerated*/
}
4

1 に答える 1