 import UIKit
 import SnapKit
 
+public protocol SwipeToRevealViewDelegate {
+  func swipeToRevealView(view: SwipeToRevealView, didClose animated: Bool)
+  func swipeToRevealView(view: SwipeToRevealView, didRevealRight animated: Bool)
+}
+
 /// Swipe-to-reveal view
-public class SwipeToRevealView: UIView {
+open class SwipeToRevealView: UIView {
+  
+    public var delegate: SwipeToRevealViewDelegate?
 
     /// Create SwipeToRevealView
     ///

    public func revealRight(animated: Bool) {
        contentOffset = rightRevealedOffset
        layoutIfNeeded(animated: animated)
    }

    // MARK: Subviews

    public func close(animated: Bool) {
        contentOffset = closedOffset
        layoutIfNeeded(animated: animated)
        delegate?.swipeToRevealView(view: self, didClose: animated)
    }

    /// Reveal right view
