-
Notifications
You must be signed in to change notification settings - Fork 815
Open
Description
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
Labels
No labels