gringoireDM / LNZTreeView

A swift TreeView
MIT License
236 stars 47 forks source link

Demo App #10

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi,

I noticed the following in the demo.

class Node: NSObject, TreeNodeProtocol {
    var identifier: String
    var isExpandable: Bool {
        return children != nil
    }

It might be worth adding this additional check. Not sure if this solves issues some others have reported.

class Node: NSObject, TreeNodeProtocol {
    var identifier: String
    var isExpandable: Bool {
        guard children != nil, children!.count > 0 else {
            return false
          }
      return true
    }
gringoireDM commented 6 years ago

Children can be an empty array. This would mean that the parent IS a folder but that for now it's empty.