ScreenOrientationManager
示例
要运行示例项目,首先克隆仓库,然后从 Example 目录中运行 pod install
要求
- iOS 10.0+
- Swift 3.2+
安装
ScreenOrientationManager 可通过 CocoaPods 访问。要安装,只需将以下行添加到 Podfile 中
pod 'ScreenOrientationManager'
设置
将 ScreenOrientationManager 添加为监听屏幕方向变化的库。在您的项目中添加此扩展,或者直接在 AppDelegate 类中添加方法。
extension AppDelegate {
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return ScreenOrientationManager.singleton.orientation
}
}
作者
Josue Meza Peña, [email protected]
许可证
ScreenOrientationManager 在 MIT 许可证下可用。查看 LICENSE 文件以获取更多信息。