Skip to content

Instantly share code, notes, and snippets.

@dinobei
Last active July 4, 2018 07:19
Show Gist options
  • Save dinobei/76c653a2e9df926570ff0ac8dce66006 to your computer and use it in GitHub Desktop.
Save dinobei/76c653a2e9df926570ff0ac8dce66006 to your computer and use it in GitHub Desktop.
Prevent resizing a view controller which is presented as a sheet (swift 4.0, cocoa in macOS)
class SomeSheetViewController.swift {
...
override func viewDidLoad() {
...
// referenced by https://stackoverflow.com/a/30112516/6770674
self.preferredContentSize = self.view.frame.size
...
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment