         }
     }
 
-    /// Bottom margin. Default is 4
+    /// Bottom margin. Default is 4, only work when snackbar is at bottom
     public dynamic var bottomMargin: CGFloat = 4 {
         didSet {
             bottomMarginConstraint?.constant = -bottomMargin
+            self.layoutIfNeeded()
+        }
+    }
+    
+    /// Top margin. Default is 4, only work when snackbar is at top
+    public dynamic var topMargin: CGFloat = 4 {
+        didSet {
+            topMarginConstraint?.constant = topMargin
             self.layoutIfNeeded()
         }
     }

    case SlideFromBottomBackToBottom
    case SlideFromLeftToRight
    case SlideFromRightToLeft
}

public class TTGSnackbar: UIView {

    private var leftMarginConstraint: NSLayoutConstraint? = nil
    private var rightMarginConstraint: NSLayoutConstraint? = nil
    private var bottomMarginConstraint: NSLayoutConstraint? = nil
    private var topMarginConstraint: NSLayoutConstraint? = nil
    private var iconImageViewWidthConstraint: NSLayoutConstraint? = nil
    private var actionButtonWidthConstraint: NSLayoutConstraint? = nil
    private var secondActionButtonWidthConstraint: NSLayoutConstraint? = nil
