title: Make custom button on Tab Bar rounded
body: <p>Here is what I am trying to do:
  <a href="https://i.stack.imgur.com/abwu9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/abwu9.png" alt="enter image description here"></a></p>
  
  <p>Note: The screenshot is taken from an earlier version of iOS</p>
  
  <p>What I have been able to achieve:
  <a href="https://i.stack.imgur.com/N8LtN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/N8LtN.png" alt="enter image description here"></a></p>
  
  <p>Code:</p>
  
  <pre><code> override func viewWillAppear(animated: Bool) {
      // Creates image of the Button
      let imageCameraButton: UIImage! = UIImage(named: "cameraIcon")
  
      // Creates a Button
      let cameraButton = UIButton(type: .Custom)
      // Sets width and height to the Button
      cameraButton.frame = CGRectMake(0.0, 0.0, imageCameraButton.size.width, imageCameraButton.size.height);
      // Sets image to the Button
      cameraButton.setBackgroundImage(imageCameraButton, forState: .Normal)
      // Sets the center of the Button to the center of the TabBar
      cameraButton.center = self.tabBar.center
      // Sets an action to the Button
      cameraButton.addTarget(self, action: "doSomething", forControlEvents: .TouchUpInside)
  
      // Adds the Button to the view
      self.view.addSubview(cameraButton)
  }
  </code></pre>
  
  <p>I did try to create a rounded button in the normal way, but this was the result:</p>
  
  <p><a href="https://i.stack.imgur.com/HR104.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HR104.png" alt="enter image description here"></a></p>
  
  <p>Code Snippet for rounded button:</p>
  
  <pre><code>//Creation of Ronded Button
      cameraButton.layer.cornerRadius = cameraButton.frame.size.width/2
      cameraButton.clipsToBounds = true
  </code></pre>