      
      - parameter animated: If dismiss with animation.
      */
-    public func dismissAnimated(animated: Bool) {
+    private func dismissAnimated(animated: Bool) {
         invalidDismissTimer()
         activityIndicatorView.stopAnimating()
 
-        let superViewWidth = (superview?.frame)!.width
+        let superViewWidth = CGRectGetWidth((superview?.frame)!)
 
         if !animated {
-            dismissBlock?(self)
+            dismissBlock?(snackbar: self)
             self.removeFromSuperview()
             return
         }

     */
    @objc func doAction(button: UIButton) {
        // Call action block first
        button == actionButton ? actionBlock?(self) : secondActionBlock?(self)

        // Show activity indicator
        if duration == .Forever && actionButton.isHidden == false {
            actionButton.isHidden = true
            secondActionButton.isHidden = true
            seperateView.isHidden = true
            activityIndicatorView.isHidden = false
            activityIndicatorView.startAnimating()
        } else {
            dismissAnimated(animated: true)
            
        }
    }
}

        leftMarginConstraint?.constant = leftMargin
        rightMarginConstraint?.constant = -rightMargin

        UIView.animateWithDuration(animationDuration, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 5, options: .CurveEaseInOut,
                animations: {
                    () -> Void in
                    animationBlock?()
