Steve cao Steve cao - 1 month ago 10
Swift Question

Scroll UITableView to dismiss UIView Above

I have a

UIViewController
with following:


  1. UIView
    as navigation (Button, Label, Button) Height: 60

  2. UIView
    with Information (Labels) height: 110

  3. UITableView



screenshot

I would like when the user scroll up, the 2nd
UIView
right above the
UITableVIew
to move with it and move off the screen, like this:

screenshot2.

Finally, when user scroll down again, the
UIView
will appear again back to initial screen.

Answer Source

Delete your 2nd information view from ViewController and set it as a header view of your tableView

tableView.tableHeaderView = informationView