         toggleUI()
     }
     
+    func filterClearButtonTapped(sender: UIButton) {
+        textField.resignFirstResponder()
+        if !isEmpty(textField.text) {
+            filterText = nil
+        }
+        textField.text = nil
+    }
+    
+    // MARK: - UITextFieldDelegate
+    
+    func textFieldShouldReturn(textField: UITextField) -> Bool {
+        textField.resignFirstResponder()
+        if !isEmpty(textField.text) {
+            filterText = textField.text
+        }
+        return true
+    }
+    
     // MARK: - Helpers
     
     private func widthForLine(line: String) -> CGFloat {

        }
    }
    
    private var filteredLines: [AELogLine] {
        guard let filter = filterText else { return lines }
        let filtered = lines.filter({ $0.description.containsString(filter) })
        return filtered
    }
    
    private var filterText: String? {
        didSet {
            if let text = filterText {
                let characterSet = NSCharacterSet.whitespaceAndNewlineCharacterSet()
                let emptyText = text.stringByTrimmingCharactersInSet(characterSet) == ""
                if !emptyText {
                    filterActive = true
                }
            } else {
                filterActive = false
            }
        }
    }
    
    private var filterActive = false {
        didSet {
            updateUI()
        }
    }

    private var opacity: CGFloat = 1.0 {

    private func configureFilterTextField() {
        let textColor = settings.consoleTextColor
        textField.delegate = self
        textField.autocapitalizationType = .None
        textField.tintColor = textColor
        textField.font = UIFont.systemFontOfSize(14)
        textField.textColor = textColor
