     }
     
     private func configureKeyboard(for propertyType:PropertyType) {
-        if property.type == .float || property.type == .double {
+        if propertyType == .float || propertyType == .double {
             textFieldPropValue.keyboardType = .decimalPad
-        } else if property.type == .int {
+        } else if propertyType == .int {
             textFieldPropValue.keyboardType = .numberPad
         } else if propertyType == .string {
             textFieldPropValue.keyboardType = .alphabet
         }
-        let allowEditing = shouldAllowEditing()
+        let allowEditing = shouldAllowEditing(for: propertyType)
         if  allowEditing {
             textFieldPropValue.layer.borderColor = RealmStyle.tintColor.cgColor
             textFieldPropValue.layer.borderWidth = 1.0

    }
}

protocol RBSRealmPropertyCellDelegate: class {
    func textFieldDidFinishEdit(_ input: String, property: Property)
}

    // MARK: - UITextFieldDelegate
    
    func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
        guard let property = property else { print("No properzy set"); return false }
        return shouldAllowEditing(for: property.type)
    }
    
    private func shouldAllowEditing(for propertyType: PropertyType) -> Bool {
        return !(propertyType == .linkingObjects ||
            propertyType == .data ||
                propertyType == .linkingObjects ||
                propertyType == .object)
    }
    
    func textFieldDidBeginEditing(_ textField: UITextField) {
        guard let property = property else { return }
        if property.type == .bool {
            var isEqual: Bool = (textFieldPropValue.text! as String == "false")
            isEqual.toggle()
            textField.text = isEqual.humanReadable
            
            guard let delegate = delegate, let text = textField.text else {
                print("delegate not set")
                return
            }
            delegate.textFieldDidFinishEdit(text, property: property)
            textField.resignFirstResponder()
            setNeedsLayout()
        }
