     }
 
     private func handlePanBegan(point: CGFloat) {
-        pan = Pan(point: point, offset: horizontalOffset)
+        pan = Pan(point: point, offset: contentOffset)
     }
 
     private func handlePanChanged(point: CGFloat) {
         pan?.currentPoint = point
         guard let pan = pan else { return }
         let targetOffset = pan.startOffset + pan.delta
-        horizontalOffset = max(rightRevealedOffset, min(closedOffset, targetOffset))
+        contentOffset = max(rightRevealedOffset, min(closedOffset, targetOffset))
     }
 
     private func handlePanEnded() {
         guard let pan = pan else { return }
 
         if pan.lastDelta > 0 {
-            horizontalOffset = closedOffset
+            contentOffset = closedOffset
         } else {
-            horizontalOffset = rightRevealedOffset
+            contentOffset = rightRevealedOffset
         }
 
         layoutIfNeeded(animated: true)
         self.pan = nil
-    }
-
-    private let closedOffset = CGFloat(0)
-
-    private var rightRevealedOffset: CGFloat {
-        return -rightContainer.frame.width
     }
 
 }

/// Swipe-to-reveal view
public class SwipeToRevealView: UIView {

    override public init(frame: CGRect) {
        super.init(frame: frame)
        loadSubviews()

    ///
    /// - Parameter animated: perform with animation
    public func close(animated: Bool) {
        contentOffset = closedOffset
        layoutIfNeeded(animated: animated)
    }

    /// Reveal right view
    ///
    /// - Parameter animated: perform with animation
    public func revealRight(animated: Bool) {
        contentOffset = rightRevealedOffset
        layoutIfNeeded(animated: animated)
    }

