Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Add hide Menu Handler #39

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions Pod/Classes/AZDropdownMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ open class AZDropdownMenu: UIView {

/// The handler used when menu item is tapped
open var cellTapHandler : ((_ indexPath:IndexPath) -> Void)?

/// The handler used when menu is hide
open var hideMenuHandler : (() -> Void)?

// MARK: - Configuration options

Expand Down Expand Up @@ -321,6 +324,9 @@ open class AZDropdownMenu: UIView {
self.removeFromSuperview()
}
)
if let hideHandler = self.hideMenuHandler {
hideHandler()
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ menu.cellTapHandler = { [weak self] (indexPath: NSIndexPath) -> Void in
}
```

`hideMenuHandler` Menu hide handler

#### Create menu with icons
Pass in a AZDropdownMenuItemData in the initializer: `public init(dataSource:[AZDropdownMenuItemData])` and you are good to go.

Expand Down