 import UIKit
 import SnapKit
 
-class SwipeToRevealView: UIView {
+public class SwipeToRevealView: UIView {
 
-    override init(frame: CGRect) {
+    override public init(frame: CGRect) {
         super.init(frame: frame)
         loadSubviews()
         setupLayout()


extension SwipeToRevealView: UIGestureRecognizerDelegate {

    func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer,
                           shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
        return true
    }

    override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        guard let pgr = gestureRecognizer as? UIPanGestureRecognizer else { fatalError() }
        let velocity = pgr.velocity(in: self)
        return fabs(velocity.x) > fabs(velocity.y)

        }
    }

    public var rightView: UIView? {
        didSet {
            if let oldValue = oldValue {
                oldValue.removeFromSuperview()
