Question: I am trying to create a very simplified layout, something like Stripe's iOS app has which you can see here: <https://stripe.com/img/dashboard_iphone/screencast.mp4>

At around 0:06s the table view is swiped up and it moves up to the top of the window. 

Are there any simple instructions in Swift that show this design pattern I see it everywhere but no idea how to create it

Answer: 
1. Add a UIView
2. Subclass that UIView with a custom class

In you custom UIView, you'll need a couple of variables and a few overrides. Make sure that user interaction is enabled on the UIView in your storyboard, then in your custom class add:

```
var startPosition: CGPoint?
var originalHeight: CGFloat?

```

After that, add the following:

```
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
    let touch = touches.first
    startPosition = touch?.locationInView(self)
    originalHeight = self.frame.height
}

override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
    let touch = touches.first
    let endPosition = touch?.locationInView(self)
    let difference = endPosition!.y - startPosition!.y
    let newFrame = CGRectMake(self.frame.origin.x, self.frame.origin.y + difference, self.frame.width, self.frame.height - difference)
    self.frame = newFrame
}

override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) {

}

```
In UIScrollView.h: 

```
// When the user taps the status bar, the scroll view beneath the touch which is closest to the status bar will be scrolled to top, but only if its `scrollsToTop` property is YES, its delegate does not return NO from `shouldScrollViewScrollToTop`, and it is not already at the top.
// On iPhone, we execute this gesture only if there's one on-screen scroll view with `scrollsToTop` == YES. If more than one is found, none will be scrolled.
var scrollsToTop: Bool // default is YES.

```

Initialize your scroll view delegate (unless you already have, probably in your viewDidLoad), and then set this to true.

Like this:

```
myScrollView.scrollsToTop = true

```

If you want to be sure your scroll view delegate allows this, check this method from UIScrollViewDelegate's protocol:

```
optional func scrollViewShouldScrollToTop(scrollView: UIScrollView) -> Bool // return a yes if you want to scroll to the top. if not defined, assumes YES

```

Please comment any concerns.