             for tagView in tagViews {
                 tagView.paddingX = paddingX
             }
-            layoutIfNeeded()
+            rearrangeViews()
         }
     }
     @IBInspectable public var marginY: CGFloat = 2 {
         didSet {
-            layoutIfNeeded()
+            rearrangeViews()
         }
     }
     @IBInspectable public var marginX: CGFloat = 5 {
         didSet {
-            layoutIfNeeded()
+            rearrangeViews()
         }
     }
     public var textFont: UIFont = UIFont.systemFontOfSize(12) {

    // MARK: - Manage tags
    
    public override func intrinsicContentSize() -> CGSize {
        let height = CGFloat(rows) * (tagViewHeight + marginY) - marginY
        return CGSizeMake(frame.width, height)
    }
    
    public func addTag(title: String) {
        let tagView = TagView(title: title)

        tagView.textColor = textColor
        tagView.backgroundColor = tagBackgroundColor
        tagView.cornerRadius = cornerRadius

            tagPressed(sender.currentTitle ?? "")
        }
    }
    
}
