Need help with nmoutlineview?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

gkopel
130 Stars 8 Forks MIT License 8 Commits 0 Opened issues

Description

Hierarchical Menu for iOS

Services available

!
?

Need anything else?

Contributors list

# 537,688
Swift
6 commits

NMOutlineView: Hierarchical Menu for iOS

Preview

NMOutlineView preview

Description

NMOutlineView is a simple implementation of hierarchical menu for iOS. Menu items can be collapsed/expanded and are displayed on different indentation levels. NMOutlineView is internally implemented as UITableView object, it's items (cells) are subclasses of UITableViewCell class, so it's easy to customize their appearance with UITableViewCell API. NMOutlineView exposes a datasource protocol. The protocol methods are similar to NSOutlineViewDatasource protocol available on macOS. See example app for implementation details.

Installation and Setup

  • Add NMOutlineView.swift and NMoutlineViewCell.swift to your project
  • Set your view controller as a datasource object of NMOutlineView instance.
  • Implement datasource protocol methods described below.

Requirements

  • Swift 5.0 or later

Datasource Methods

/* 
Returns the number of child items encompassed by the given item.
*/
func outlineView(_ outlineView: NMOutlineView, numberOfChildrenOfCell parentCell: NMOutlineViewCell?) -> Int  
/*
Returns a Boolean value that indicates whether the given item is expandable.  
*/
func outlineView(_ outlineView: NMOutlineView, isCellExpandable cell: NMOutlineViewCell) -> Bool 
/*
Invoked by outlineView to return the child cell object of the given parent item. 
*/
func outlineView(_ outlineView: NMOutlineView, childCell index: Int, ofParentAtIndexPath parentIndexPath: IndexPath?) -> NMOutlineViewCell
/*
Tells the datasource object that the specified row is now selected.
*/
func outlineView(_ outlineView: NMOutlineView, didSelectCell cell: NMOutlineViewCell);

License

NMoutlineView is available under the MIT license. See the LICENSE file for more info.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.