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

Adding delegate as an optional param to UIViewController extension #19

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ContextMenu/UIViewController+Extensions.swift
Original file line number Diff line number Diff line change
@@ -17,17 +17,20 @@ extension UIViewController {
/// - viewController: A content view controller to use inside the menu.
/// - options: Display and behavior options for a menu.
/// - sourceView: A source view for menu context. If nil, menu displays from the center of the screen.
/// - delegate: A delegate the receives events when the menu changes.
public func showContextualMenu(
_ viewController: UIViewController,
options: ContextMenu.Options = ContextMenu.Options(),
sourceView: UIView? = nil
sourceView: UIView? = nil,
delegate: ContextMenuDelegate? = nil
) {

ContextMenu.shared.show(
sourceViewController: self,
viewController: viewController,
options: options,
sourceView: sourceView
sourceView: sourceView,
delegate: delegate
)
}
}