title: Swift 3 - Force autorotation
body: <p>I am using <a href="https://stackoverflow.com/questions/25651969/setting-device-orientation-in-swift-ios">this</a> code.</p>
  <p>For example, I have view1 (portrait only) and view2 (portrait+landscape). When you are in view1 and click a button, you open view2 with popup on the whole screen. When you close view2 and view1 become visible, I want to automatically turn it to portrait mode, if view 2 was in landscape. Any suggestions?</p>