How to disable the part that will be displayed as TVOut in iOS 5?

As we all know in iOS 5, we do not need to add separate lines of code for the TVOut function. They integrated this functionality as a built-in function.

What is my question: what if in my application there are some of my user presentations that I do not want to show as a TVOut presentation. It should only be displayed on the device, not on the projector board.

I checked the TVOut code that we use for iOS version <5.0, but there they capture the window image and transmit it. How to prevent skip screams for some custom small views.

Any suggestions or solutions are welcome.

Watch this video: http://www.youtube.com/watch?gl=US&v=GysMfb4_79A

How to achieve such a goal?

Edit : I used the ExternalDisplay code given by Apple. But I ran into one problem.

  • This code works for a single view controller, where we add all our views to a new window.
  • What if my application contains so many view controllers, and in some view controllers I have text elements for the user.
  • To avoid displaying these textual representations in an external window in the form of TVOut, a view without this textView should be displayed.

Please suggest me.

+4
source share
1 answer

From ExternalDisplay example code in the iOS Developer Library:

To display content on an external display, do the following:

  • Use the UIScreen class screen class method to determine if an external display is available.

  • If an external screen is available, get a display object and look at the values ​​in the availableModes property. This property contains the configurations supported by the screen.

  • Select the UIScreenMode object corresponding to the required resolution and assign the object to the current screen property.

  • Create a new window object (UIWindow) to display your content.

  • Set the display object to the screen property of your new window.

  • Customize the window (by adding views or customizing the rendering context of OpenGL ES).

  • Show window.

Looking at the sample code, you will have two UIWindow objects, each of which will display the views that you would like to show on this display. Thus, you can have a UIViewController with the isExternalScreen flag, and when true, it will not show certain views.

+3
source

Source: https://habr.com/ru/post/903339/


All Articles