Created
August 1, 2016 12:07
-
-
Save MTattin/81e36df77321be258dc148f772e3db9f to your computer and use it in GitHub Desktop.
UIPopoverPresentationControllerの画面回転対応メモ ref: http://qiita.com/MTattin/items/39f578610b295e9535b3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// 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