Skip to content

Commit

Permalink
Added select at index
Browse files Browse the repository at this point in the history
  • Loading branch information
arvincheung committed Jan 12, 2017
1 parent 2c08c85 commit 0139a13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/BTNavigationDropdownMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ open class BTNavigationDropdownMenu: UIView {
}
}

open func select(_ index: Int){
self.tableView.selectedIndexPath = index;
self.tableView.reloadData();
if self.shouldChangeTitleText!{
self.setMenuTitle(self.tableView.items[index] as! String);
}
}

func setupDefaultConfiguration() {
self.menuTitleColor = self.navigationController?.navigationBar.titleTextAttributes?[NSForegroundColorAttributeName] as? UIColor
self.cellBackgroundColor = self.navigationController?.navigationBar.barTintColor
Expand Down

0 comments on commit 0139a13

Please sign in to comment.