title: Change iOS UIBarButtonItem Programmatically
body: <p>Is it possible to change the button type of a UIBarButton in iOS programmatically?</p>
  
  <p>What I mean would be if you had a view with a navigation bar up the top and you have dragged on a UIBarButton which you have set to the "Compose" type so that it shows the icon of the pencil and paper, could you then drag an outlet of this to the view's ViewController and change the button to another type such as "Edit"?</p>
  
  <p>Pseudo code, it might look like:</p>
  
  <pre><code>myBarButton.type = UIBarButtonType.Compose
  </code></pre>
  
  <p>Or something? Does such a functionality exist for <strong>iOS 8 in Xcode with Swift 1.2</strong>?</p>