         var labelSize = propertyTitle.sizeThatFits(CGSize(width: self.bounds.size.width - 2*borderOffset, height: 2000.0))
         propertyTitle.frame = (CGRect(x: borderOffset, y: (self.bounds.size.height-labelSize.height)/2.0, width: labelSize.width, height: labelSize.height))
         
-        let textFieldWidth = self.bounds.size.width-4*borderOffset-labelSize.width
-        
-        
-        if  let text = propertyValueLabel.text {
-            labelSize = propertyValueLabel.sizeThatFits(CGSize(width: textFieldWidth, height: 2000.0))
-            propertyValueLabel.frame = (CGRect(x:self.bounds.size.width-labelSize.width-borderOffset, y: (self.bounds.size.height-labelSize.height)/2, width:labelSize.width, height: labelSize.height))
-        }else {
-            let labelWidth = self.bounds.size.width-propertyTitle.bounds.size.width-2*borderOffset
-            labelSize = propertyValue.sizeThatFits(CGSize(width: labelWidth, height: 2000.0))
-            propertyValue.frame = (CGRect(x:self.bounds.size.width-labelWidth-borderOffset, y: (self.bounds.size.height-labelSize.height)/2, width:labelWidth, height: labelSize.height))
-        }
+        let labelWidth = self.bounds.size.width-propertyTitle.bounds.size.width-2*borderOffset
+        labelSize = propertyValueTextField.sizeThatFits(CGSize(width: labelWidth, height: 2000.0))
+        propertyValueTextField.frame = (CGRect(x:self.bounds.size.width-labelWidth-borderOffset, y: (self.bounds.size.height-labelSize.height)/2, width:labelWidth, height: labelSize.height))
     }
     
     //MARK: private method

    
    override func prepareForReuse() {
        super.prepareForReuse()
        propertyValue.text = ""
        propertyTitle.text = ""
        propertyTitle.removeFromSuperview()
    }
    
    func cellWithAttributes(_ propertyTitle: String, propertyValue: String, editMode: Bool, property: Property, isArray:Bool) {
        self.propertyTitle = self.labelWithAttributes(14, weight:0.3, text: propertyTitle)
        self.contentView.addSubview(self.propertyTitle)
        
        
        if isArray {
            propertyValueLabel = self.labelWithAttributes(14, weight:0.3, text: propertyValue)
            self.contentView.addSubview(propertyValueLabel)
        } else {
            self.propertyValue.isUserInteractionEnabled = editMode
            self.isUserInteractionEnabled = editMode
            if property.type == .bool {
                //            self.propertyValue.userInteractionEnabled = false
            }
            if property.type == .float || property.type == .double {
                self.propertyValue.keyboardType = UIKeyboardType.decimalPad
            } else if property.type == .int {
                self.propertyValue.keyboardType = UIKeyboardType.numberPad
            }
            
            self.propertyValue.delegate = self
            self.propertyValue.backgroundColor = .black
            self.propertyValue.returnKeyType = .done
            self.propertyValue.backgroundColor = .white
            self.propertyValue.textAlignment = .right
            
            self.propertyValue.text = propertyValue
            
            self.contentView.addSubview(self.propertyValue)
        }
        self.property = property
        self.setNeedsLayout()
        self.isUserInteractionEnabled = true
    }
    
    override func layoutSubviews() {


class RBSRealmPropertyCell: UITableViewCell, UITextFieldDelegate {
    private var propertyTitle = UILabel()
    private var propertyValueTextField = UITextField()
    private var property: Property! = nil
    var delegate: RBSRealmPropertyCellDelegate! = nil
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        selectionStyle = .none
    }
    
    required init?(coder aDecoder: NSCoder) {
