How to achieve the same functionality as the application for iOS Mail using a cell with a checker?

I am trying to reproduce the same type of functionality as the iOS mailbox application when a user views a tableview cell, as shown in the figure:

enter image description here

There are 3 options: more, flag and archive. When the user clicks on any of 3, the background color changes to indicate it in the selected state. However, the icon and text do not change color.

I am trying to achieve the same effect.

I follow this tutorial to create a custom tableview cell using swipeable using gestures:

How to make a panel for viewing a table with the possibility of actions with actions - without using nuts with a scroll list

I currently have this setting:

enter image description here

3 UIViews, UIView UIImageView UILabel, Dirty, Edit, Delete.

3 UIViews :

let dirtyButtonView = cell.viewWithTag(7)
let editButtonView = cell.viewWithTag(8)
let deleteButtonView = cell.viewWithTag(9)

let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(MyVC.buttonPressed))
tapRecognizer.numberOfTapsRequired = 1
dirtyButtonView?.addGestureRecognizer(tapRecognizer)
editButtonView?.addGestureRecognizer(tapRecognizer)
deleteButtonView?.addGestureRecognizer(tapRecognizer)

, , Mail, .

, , .. UIView ?

- iOS Mail?

+4
3

, , SwipeCellKit, by jerkoch. , iOS . UIViews UIButtons.

, SwipeTableViewCellDelegate editActionsForRowAt :

func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? {
    guard orientation == .right else { return nil }

    let deleteAction = SwipeAction(style: .destructive, title: "Delete") { action, indexPath in
        // handle action by updating model with deletion
    }

    // customize the action appearance
    deleteAction.image = UIImage(named: "delete")

    return [deleteAction]
}

SwipeTableViewCell : cell.delegate = self.

+2

SWTableViewCell CEWendel. , , .

0

It may be late to answer this, but if someone else is looking, think that it is read to answer the question: https://www.raywenderlich.com/62435/make-swipeable-table-view- cell-actions-without-going-nuts-scroll-views

-1
source

Source: https://habr.com/ru/post/1672684/


All Articles