iOS 8轮换方法弃用 - 向后兼容性 [英] iOS 8 Rotation Methods Deprecation - Backwards Compatibility

查看:100
本文介绍了iOS 8轮换方法弃用 - 向后兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 8中,界面轮换的方法是弃用。这包括:

In iOS 8, the methods for interface rotation are deprecated. This includes:


  • willRotateToInterfaceOrientation:duration:

  • didRotateFromInterfaceOrientation:

  • willAnimateRotationToInterfaceOrientation:duration:

  • willRotateToInterfaceOrientation:duration:
  • didRotateFromInterfaceOrientation:
  • willAnimateRotationToInterfaceOrientation:duration:

替换方法包括:


  • willTransitionToTraitCollection:withTransitionCoordinator:

  • viewWillTransitionToSize:withTransitionCoordinator:

  • willTransitionToTraitCollection:withTransitionCoordinator:
  • viewWillTransitionToSize:withTransitionCoordinator:

如果没有实现新的轮换方法,并且使用iOS 8 SDK编译项目,则视图控制器将不接收呼叫 - 不推荐的轮换方法。

If the new rotation methods are not implemented, and a project is compiled with the iOS 8 SDK, the view controllers -will not receive calls- to the deprecated rotation methods.

我担心的是:使用iOS 7 SDK构建的AppStore中的应用程序会发生什么变化?是否仍会在iOS 8设备上调用已弃用的轮播方法?

编辑:

仍在调用旋转方法,但iOS 8中存在一些更改/问题/错误。

The rotation methods are still called, but there exist some changes/issues/bugs in iOS 8.

此外 UIScreen 现在面向界面

Also UIScreen is now interface oriented

推荐答案

在iOS 8 SDK中不推荐使用旋转方法。这对使用iOS 7 SDK构建的应用程序完全没有影响,甚至可以在iOS 8和iOS的未来版本中运行。

The rotation methods are deprecated in the iOS 8 SDK. This will have no effect at all on apps built with the iOS 7 SDK, even running in iOS 8 and probably several future versions of iOS.

作为示例, font 属性 UIButton 自iOS 3.0起已被弃用,并且仍可在iOS 7.0中使用。

As an example, the font property of UIButton has been deprecated since iOS 3.0 and is still available in iOS 7.0.

这篇关于iOS 8轮换方法弃用 - 向后兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆