title: How to rotate button when device orientation changes in swift?
body: <p>How can I just rotate the buttons when my device is in portrait or landscape mode? I know something like that: </p>
  
  <pre><code>button.transform = CGAffineTransformMakeRotation(CGFloat(M_PI))
  </code></pre>
  
  <p>But where I have to call it up in my code?<br>
  I don't want to set my device in landscape mode, I just want to rotate the icons when it should be in landscape mode.<br>
  Thanks in advance!</p>