     case TTGSnackbarDurationMiddle = 3.0
     case TTGSnackbarDurationLong = 5.0
     case TTGSnackbarDurationForever = 9999999999.0 // Must dismiss manually.
+}
+
+public enum TTGSnackbarAnimationType {
+    case TTGSnackbarAnimationFadeInFadeOut
+    case TTGSnackbarAnimationSlideFromBottomToTop
+    case TTGSnackbarAnimationSlideFromBottomBackToBottom
+    case TTGSnackbarAnimationSlideFromLeftToRight
+    case TTGSnackbarAnimationSlideFromRightToLeft
 }
 
 public class TTGSnackbar: UIView {

        }
        return topController
    }
    
    private func dismissAnimated(animated: Bool) {
        invalidDismissTimer()
        activityIndicatorView.stopAnimating()
        TTGSnackbar.currentInstance = nil
        
        if animated {
            bottomMarginConstraint?.constant = TTGSnackbar.snackbarHeight
            self.setNeedsLayout()
            UIView.animateWithDuration(TTGSnackbar.snackbarAnimationDuration, animations: { () -> Void in
                self.layoutIfNeeded()
                }, completion: { (Bool finished) -> Void in
                    self.dismissBlock?(snackbar: self)
                    self.removeFromSuperview()
            })
        } else {
            dismissBlock?(snackbar: self)
            self.removeFromSuperview()
        }
    }
    
    // Button action
    func doAction() {
        // Call action block first
        actionBlock?(snackbar: self)
        
        // Show activity indicator
        if duration == TTGSnackbarDuration.TTGSnackbarDurationForever && actionButton.hidden == false{
            actionButton.hidden = true

    public required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    // --Public methods--
    public func show() {
        // Only show once
        if self.superview != nil {
            return
        }

        // Dismiss last bar
        TTGSnackbar.currentInstance?.dismissAnimated(false)

        // Save current show instance
        TTGSnackbar.currentInstance = self

        // Create dismiss timer
        dismissTimer = NSTimer.scheduledTimerWithTimeInterval(duration.rawValue, target: self, selector: "dismiss", userInfo: nil, repeats: false)

        // Show or hide action button
        actionButton.hidden = actionText.isEmpty || actionBlock == nil
        seperateView.hidden = actionButton.hidden
        actionButtonWidthConstraint?.constant = actionButton.hidden ? 0 : TTGSnackbar.snackbarActionButtonWidth

        // Find current stop viewcontroller
        if let topController = getTopViewController() {
            let superView: UIView = topController.view
            superView.addSubview(self)

            // Snackbar height constraint
            let heightConstraint: NSLayoutConstraint = NSLayoutConstraint.init(item: self, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: TTGSnackbar.snackbarHeight)

            // Snackbar width constraint
            let widthConstraint: NSLayoutConstraint = NSLayoutConstraint.init(item: self, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.NotAnAttribute, multiplier: 1, constant: superView.bounds.width - 2 * TTGSnackbar.snackbarHorizonMargin)

            // Center X constraint
            centerXConstraint = NSLayoutConstraint.init(item: self, attribute: NSLayoutAttribute.CenterX, relatedBy: NSLayoutRelation.Equal, toItem: superView, attribute: NSLayoutAttribute.CenterX, multiplier: 1, constant: 0)

            // Bottom margin constraint
            bottomMarginConstraint = NSLayoutConstraint.init(item: self, attribute: NSLayoutAttribute.Bottom, relatedBy: NSLayoutRelation.Equal, toItem: superview, attribute: NSLayoutAttribute.Bottom, multiplier: 1, constant: 0)

            // Add constraints
            self.addConstraint(heightConstraint)
            self.addConstraint(widthConstraint)
            superView.addConstraint(bottomMarginConstraint!)
            superView.addConstraint(centerXConstraint!)

            // Show 
            showWithAnimation()
        }
    }

    public func dismiss() {
        // On main thread
        dispatch_async(dispatch_get_main_queue()) { () -> Void in
            self.dismissAnimated(true)
        }
    }

    // --Private methods--
    private func configure() {
        self.translatesAutoresizingMaskIntoConstraints = false
        self.backgroundColor = UIColor.init(white: 0, alpha: 0.8)
        self.layer.cornerRadius = 4
        self.layer.masksToBounds = true

        messageLabel = UILabel()
        messageLabel.translatesAutoresizingMaskIntoConstraints = false
        messageLabel.textColor = UIColor.whiteColor()
