Question: I am trying to understand how does Facebook Messenger create a button at the button of the screen which stays on top of the `UITableView` and follows the scrolling as well?

![Picture taken from the iTunes Store](https://i.stack.imgur.com/6eEQu.jpg)

I want to implement the blue button on the bottom right. What should be my approach to achieve something like that?

Any push in the right direction will be highly appreciated.

Answer: 
There are a few avenues to take when adding the overlay view:

* As a subview of the wrapping `UINavigationController`, which means it won't scroll with the content of the table
* As a section footer of a plain-style `UITableView` that has only 1 section
* As a subview of the `UITableView` and use `UIScrollViewDelegate`'s `scrollViewDidScroll:` to continuously update the view's frame as the user scroll's the table (which makes it appear to stay motionless)
In your UIViewController subclass do this : 

```
[self.view insertSubview:myButton aboveSubview:self.tableView];

```

NOTE : if your UIViewController is a UITableViewController, this code may not work, since UITableViewController place its table view as its root view, which make a lot of programmer stay away from it, because of the limitation that this imply.