How to add floating button on top of the UITableView?

WeCan picture WeCan · May 6, 2016 · Viewed 19.9k times · Source

I need to add floating button on top of UITableViewController.

The following link is used for adding FloatingButton action on top of UIViewController

Creating a floating menu in an iOS application

I already tried to add this floating button to my UITableViewController but it is not visible.

please help me thank you inadvance

Answer

Ghulam Ali picture Ghulam Ali · May 6, 2016
  1. First add the UITableView and then the Button. So it should be like this in the XIB Structure (Button is after the Table not before otherwise it will be hidden):

XIB Structure

  1. Set the Button Constraints related to the Super View and not related to UITableView.

Button Constraints

See that button constraints are related to superview. This is important if you want the Floating Button.

If everything is done correctly it would show like this: enter image description here