         let combinedHeight = ([sizeTitle, sizeDetail].reduce(.zero, +) < sizeTextField).height
         return CGSize(width: size.width, height: combinedHeight + 4*margin + padding)
     }
-    
+
     override func layoutSubviews() {
         super.layoutSubviews()
-        
+
         let usableSize = (CGSize(width: contentView.bounds.size.width - 2*margin,
                                  height: .greatestFiniteMagnitude))
         let sizes = viewSizes(for: [labelPropertyTitle, labelPropertyType],
                               fitting: usableSize)
-        
+
         let sizeTitle = sizes[0]
         let sizeDetail = sizes[1]
-        
+
         let sizeCircle = (CGSize(width: sizeTitle.height/2, height: sizeTitle.height/2))
         let originCircle = (CGPoint(x: margin, y: margin + (sizeTitle.height-sizeCircle.height)/2))
         circleView.frame = (CGRect(origin: originCircle, size: sizeCircle))
         circleView.layer.cornerRadius = sizeCircle.height/2
-        
+
         let originTitle = CGPoint(x: circleView.bottomRight.y + padding/2, y: margin)
         labelPropertyTitle.frame = (CGRect(origin: originTitle, size: sizeTitle))
-        
+
         let originDetail = (CGPoint(x: originTitle.x, y: labelPropertyTitle.bottomRight.y + padding))
         labelPropertyType.frame = (CGRect(origin: originDetail, size: sizeDetail))
-        
+
         let usableTextFieldWidth = contentView.bounds.size.width
                                     - sizeCircle.width
                                     - labelPropertyTitle.bounds.size.width
                                     - 3*margin
-        
+
         let usableTextFieldSize = (CGSize(width: usableTextFieldWidth,
                                           height: .greatestFiniteMagnitude))
         let sizeTextField = textFieldPropValue.sizeThatFits(usableTextFieldSize)
-        let minWidth = min(sizeTextField.width,usableTextFieldSize.width)
+        let minWidth = min(sizeTextField.width, usableTextFieldSize.width)
         let originTextField = (CGPoint(x: contentView.bounds.size.width-minWidth-margin,
                                        y: margin))
         if let prop = property {

            textFieldPropValue.layer.borderWidth = 0.0
        }
    }
    
    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, let delegate = delegate else { return }
        if property.type == .bool {
            let isEqual: Bool = (textField.text! as String == "false")
            textField.text = isEqual.humanReadable
            
            delegate.textFieldDidFinishEdit("\(isEqual.rawValue)", property: property)
            setNeedsLayout()
            textField.resignFirstResponder()
        }
    }
    
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        textField.isUserInteractionEnabled = false
        return true
    }
    
    func textFieldDidEndEditing(_ textField: UITextField) {
        guard let property = property else { return }
        if  property.type != .bool {

        toggle.addTarget(self, action: .toggleSwitch, for: .valueChanged)
        return toggle
    }()

    private var property: Property?
    weak var delegate: RBSRealmPropertyCellDelegate?

    private let margin: CGFloat = 20.0
    private let padding: CGFloat = 10.0
    private var disposables: [NSKeyValueObservation] = []
    @objc private dynamic var isEditingAllowed = false

    override init(style: CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        selectionStyle = .none
