5

CADisplayLink having this method makes sense, but I'm curious why UIScreen would also have it.

meisel
  • 2,151
  • 2
  • 21
  • 38

1 Answers1

3

Documentation says that the display link provided by the screen is tied to that screen. However, looking at the official documentation, there is no apparent relation to any screens; the display link is added to a runloop and that's it.

Digging deeper in the private headers, there is a display property, of type CADisplay, which is also found for UIScreen. So it seems, that indeed, you can create display links specific to screens. Normally on iOS and tvOS, there is only one screen, but that is not always the case (such as connecting a monitor to an iOS device). If your app supports external monitors, and you find the need to use a display link, you should use the -[UIScreen displayLinkWithTarget:selector:] method.

Consider opening a bug report with Apple with a documentation enhancement request to clarify the above behavior.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
  • 1
    The comment above the method in `CADisplayLink.h` does specify that it creates a new display link object "for the main display" which is the display for `[UIScreen mainScreen]`. Apple likes putting useful information in the header files and leaving it out of the documentation for some reason. – dan Jan 10 '17 at 21:59