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

Add support for iOS 13 actions #98

Merged
merged 1 commit into from
May 4, 2020
Merged

Add support for iOS 13 actions #98

merged 1 commit into from
May 4, 2020

Conversation

mrtokii
Copy link
Contributor

@mrtokii mrtokii commented May 3, 2020

Support for iOS 13

Added two-finger cell selection actions

shouldBeginMultipleSelection, didBeginMultipleSelection

Added action for displaying context menu

showContextMenu

Example usage:

if #available(iOS 13.0, *) {
    tableRow.on(.showContextMenu) { options -> UIContextMenuConfiguration? in
        UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { _ in
            let key = TableKitUserInfoKeys.ContextMenuInvokePoint
            let point = options.userInfo?[key] as? CGPoint ?? CGPoint()

            let action = UIAction(title: "\(point.x):\(point.y)", handler: { _ in })

            return UIMenu(title: "Menu title", children: [action])
        }
    }
}

Looks like a solution for #58

@mrtokii mrtokii changed the title Added multiple selection actions & context menu action Add support for iOS 13 actions May 3, 2020
@maxsokolov
Copy link
Owner

@mrtokii Hey, nice, thank you!

@maxsokolov maxsokolov merged commit 3b266fb into maxsokolov:master May 4, 2020
@maxsokolov
Copy link
Owner

maxsokolov commented May 4, 2020

Bumped pod version to 2.11.0

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

Successfully merging this pull request may close these issues.

2 participants