Skip to content

Commit

Permalink
Merge pull request #19 from marcuswu0814/feature/AddingDelegateAsPara…
Browse files Browse the repository at this point in the history
…mToHelperExtension

Adding delegate as an optional param to UIViewController extension
  • Loading branch information
rnystrom authored Mar 18, 2018
2 parents bac5362 + dea9bfd commit 188307e
Showing 1 changed file with 5 additions and 2 deletions.
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
)
}
}

0 comments on commit 188307e

Please sign in to comment.