     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return sections[section].length
+        return sections[section].entries.count
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    }
    
    private func generateSections(item: [PasswordsTableEntry]) {
        sections.removeAll()
        guard item.count != 0 else {
            return
        }
        var index = 0
        for i in 0 ..< item.count {
            let title = item[index].title.uppercased()
            let commonPrefix = item[i].title.commonPrefix(with: title, options: .caseInsensitive)
            if commonPrefix.characters.count == 0 {
                let firstCharacter = title[title.startIndex]
                let newSection = (index: index, length: i - index, title: "\(firstCharacter)")
                sections.append(newSection)
                index = i
            }
        }
        let title = item[index].title.uppercased()
        let firstCharacter = title[title.startIndex]
        let newSection = (index: index, length: item.count - index, title: "\(firstCharacter)")
        sections.append(newSection)
    }
    
    func actOnSearchNotification() {

import SwiftyUserDefaults
import PasscodeLock

fileprivate class PasswordsTableEntry : NSObject {
    var title: String
    var isDir: Bool
    var passwordEntity: PasswordEntity?
    init(title: String, isDir: Bool, passwordEntity: PasswordEntity?) {
        self.title = title
        self.isDir = isDir
        self.passwordEntity = passwordEntity
    }
}

class PasswordsViewController: UIViewController, UITableViewDataSource, UITableViewDelegate, UITabBarControllerDelegate {
