简体   繁体   中英

Using UIDeviceOrientation change notification instead of viewillTransistionToSize

I have managed to support Portrait and Landscape orientations for my app.

However, my implementation is based on UIDeviceOrientationChangeNotification . I do not use viewillTransistionToSize

Offical Apple sample code for AlternateViews does use notification based approach. So I assumed it should be fine.

  • Is there any significant advantage/disadvantage of using one over another?
  • Would it ever happen that my app will not get deviceOrientationChangenotification ?

Please clarify.

I am using a combination of both. But to me it looks like viewillTransistionToSize gives more control as you can execute code

  • before rotation begins
  • during rotation
  • after rotation

while in case of Notification you only execute code after rotation.

Not sure but I found this thru experimentation and not thru docs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM