Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Change demo for support section for UITableView
  • Loading branch information
suricforever authored Oct 10, 2016
1 parent b100f4d commit 8bc74df
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ import DropdownMenu

### Add code for your action

#### Without Section

```swift
func showMenu(sender: UIBarButtonItem) {
let item1 = DropdownItem(title: "NO Image")
Expand All @@ -83,6 +85,24 @@ func showMenu(sender: UIBarButtonItem) {
}
```

#### With Section

```swift
@IBAction func showMenu(_ sender: UIBarButtonItem) {
let item1 = DropdownItem(title: "NO Image")
let item2 = DropdownItem(image: UIImage(named: "file")!, title: "File")
let item3 = DropdownItem(image: UIImage(named: "post")!, title: "Post", style: .highlight)
let item4 = DropdownItem(image: UIImage(named: "post")!, title: "Event", style: .highlight, accessoryImage: UIImage(named: "accessory")!)

let section0 = DropdownSection(sectionIdentifier: "Teambition", items: [item1, item2])
let section1 = DropdownSection(sectionIdentifier: "Space", items: [item3, item4])

let menuView = DropdownMenu(navigationController: navigationController!, sections: [section0, section1], selectedIndexPath: selectedIndexPath)
menuView?.delegate = self
menuView?.showMenu()
}
```

### Handle delegate

```swift
Expand Down

0 comments on commit 8bc74df

Please sign in to comment.