title: Change modalPresentationStyle on iOS13 on all UIViewController instances at once using method swizzling
body: <p><strong>[Q&amp;A] <em>Is it possible to change <code>UIViewController.modalPresentationStyle</code> value globally on iOS 13 so it behaves like it used to on iOS 12 (or earlier)?</em></strong></p>
  
  <hr>
  
  <p>Why?</p>
  
  <p>In iOS 13 SDK the default value of <code>UIViewController.modalPresentationStyle</code> property has been changed from <code>UIModalPresentationFullScreen</code> to <code>UIModalPresentationAutomatic</code> which is, as far as I know, resolved to <code>UIModalPresentationPageSheet</code> on iOS devices or at least on iPhones. </p>
  
  <p>Since the project I've been working for several years has become quite big, there are tens of places where a view controller is presented. The new presentation style doesn't always match our app designs and sometimes it causes the UI to fall apart. Which is why, we deciced to change <code>UIViewController.modalPresentationStyle</code> back to <code>UIModalPresentationFullScreen</code> as it was is pre-iOS13 SDK's versions.</p>
  
  <p>But adding <code>viewController.modalPresentationStyle = UIModalPresentationFullScreen</code> before calling <code>presentViewController:animated:completion:</code> in every single place where a controller is presented seemed like an overkill. Moreover, we had more serious matters to deal with at that time, which is why, for the time being or at least until we update our designs and fix all the UI issues, we decided to go with method swizzling approach.</p>
  
  <p><strong>The working solution is presented in my answer, but I would appreciate any feedback telling me what downsides or consequences of such an approach might be.</strong></p>