title: How to set a button to most right side of navigation
body: <p>I set a button to right side of navigation bar:</p>
  
  <p><a href="https://i.stack.imgur.com/52Y30.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/52Y30.png" alt="enter image description here"></a></p>
  
  <p>I want to set a burger icon,red cycle and a label  to this button. like this:</p>
  
  <p><a href="https://i.stack.imgur.com/dSJ8s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dSJ8s.png" alt="enter image description here"></a></p>
  
  <p>my code:</p>
  
  <pre><code>    self.navigationController?.navigationBar.barTintColor = self.utilities.hexStringToUIColor(hex: "#00b8de")
  
      var imageview2 = UIImage(named: "menulogo")
  
      imageview2 = imageview2?.imageResize(sizeChange: CGSize(width: 25, height: 25))
  
      btnMenu.setImage(imageview2,for:UIControlState.normal)
      btnMenu.setTitle("", for: .normal)
  
  
      // setup the red circle UIView
      let redCircleView = UIView(frame: CGRect(x: 0, y: 0, width: 20, height: 20))
      redCircleView.backgroundColor = UIColor.red
      redCircleView.layer.cornerRadius = view.frame.size.width / 2
  
      // setup the number UILabel
      let label = UILabel(frame: CGRect(x: 30, y: 0, width: 20, height: 20))
      label.textColor = UIColor.white
      label.font = UIFont.systemFont(ofSize: 10)
      label.text = "16"
  
      // adding the label into the red circle
      redCircleView.addSubview(label)
  
      // adding the red circle into the menu button
      btnMenu.addSubview(redCircleView)
  </code></pre>
  
  <p>with above codes I have three problems:</p>
  
  <ol>
  <li>my burger image isn't in most right side of navigation.</li>
  <li>my cycle view doesn't show</li>
  <li>my icon is white, but it shows blue!</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/OT06j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OT06j.png" alt="enter image description here"></a></p>