Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this library support MacOS? #443

Open
jadebowl opened this issue May 3, 2022 · 0 comments
Open

Does this library support MacOS? #443

jadebowl opened this issue May 3, 2022 · 0 comments

Comments

@jadebowl
Copy link

jadebowl commented May 3, 2022

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
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant