Skip to content

Instantly share code, notes, and snippets.

@MTattin
Created August 1, 2016 12:07
Show Gist options
  • Save MTattin/81e36df77321be258dc148f772e3db9f to your computer and use it in GitHub Desktop.
Save MTattin/81e36df77321be258dc148f772e3db9f to your computer and use it in GitHub Desktop.
UIPopoverPresentationControllerの画面回転対応メモ ref: http://qiita.com/MTattin/items/39f578610b295e9535b3
///
/// UIPopoverPresentationControllerDelegate
///
/// 画面の回転対応
///
func popoverPresentationController(_ popoverPresentationController: UIPopoverPresentationController, willRepositionPopoverTo rect: UnsafeMutablePointer<CGRect>, in view: AutoreleasingUnsafeMutablePointer<UIView>) {
let baseView = 起点としたいView
view.pointee = baseView
rect.pointee = baseView.bounds
popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirection.unknown
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment