首页 > 解决方案 > Multivalued Section and Trailing swipe

问题描述

I am unable to get trailing swipe working with MultivaluedSection. It works perfectly with Section.

internal func addSwipeAction(for row: ComponentTypeConditionRow) {
        let copyAction = SwipeAction(
            style: .normal,
            title: nil,
            handler: { [weak self] (action, row, completionHandler) in
                completionHandler?(true)
            })
        
        let deleteAction = SwipeAction(
            style: .destructive,
            title: nil,
            handler: { [self] (action, row, completionHandler) in
                completionHandler?(true)
            })
        
        copyAction.image = UIImage(systemName: "square.on.square", withConfiguration: UIImage.SymbolConfiguration(weight: .regular))
        copyAction.actionBackgroundColor = .systemBlue
        
        deleteAction.image = UIImage(systemName: "trash", withConfiguration: UIImage.SymbolConfiguration(weight: .regular))
        
        row.trailingSwipe.actions = [deleteAction,copyAction]
        row.trailingSwipe.performsFirstActionWithFullSwipe = false
    }
}

Do you have any idea?

Thanks

标签: swifteureka-forms

解决方案


推荐阅读