Question: i created Menu using **SWRevealViewController** it connected to whole application but when i choose any row from menu in any view it go to home page first.
any one know the why and how to solve this problem.

the couse of the problem is that i use dispatch\_async(dispatch\_get\_main\_queue(),{
)}

[![enter image description here](https://i.stack.imgur.com/R1VwT.png)](https://i.stack.imgur.com/R1VwT.png)

menu code

```
extension UIViewController {
func addMenu() {
    navigationController?.navigationBar.barTintColor = UIColor.redColor()
    var image : UIImage = UIImage(named:"menu")!

    if (varView == 0) {

    }
    else if (varView == 1) {
        dispatch_async(dispatch_get_main_queue(),{

             let update = storyboard!.instantiateViewControllerWithIdentifier("updateuser") as! UpdateUserProfileViewController          

              self.navigationController?.pushViewController(update, animated: false)
      )}
    }

  }
  }

```

Answer: 
Take a transparent view with top constraint 0 to topView(lable) and bottom constraint 0 to bottom view(Button). Now add the view in that view which you want vertically centre to both view. And add it constraints as horizontal and vertical centre to the parent view.
You can try stackview here. Put all items in to stack view and provide equal spacing