Skip to content

Does this library support MacOS? #443

@jadebowl

Description

@jadebowl

I implemented it easily on iOS, but the code doesn't work for mac. Am I doing something wrong or is it not supported yet?

Here's my code:

  func collectionView(_ collectionView: UICollectionView, editActionsForItemAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]? {
        guard orientation == .left else { return nil }
        let item = fetchedResultsController.object(at: indexPath)
        let unreadAction = SwipeAction(style: .default, title: item.isUnread ? "Read" : "Unread") { action, indexPath in
            item.isUnread = !item.isUnread
        }
        unreadAction.backgroundColor = .clear
        unreadAction.textColor = .bookmark01
        unreadAction.image = item.isUnread ? UIImage(named: "read") : UIImage(named: "unread")
        return [unreadAction]
    }
    
    func collectionView(_ collectionView: UICollectionView, editActionsOptionsForItemAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeOptions {
        var options = SwipeOptions()
        options.expansionStyle = .selection
        options.transitionStyle = .border
        options.backgroundColor = .clear
        return options
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions