Reputation: 12951
How can i detect showing on Apple TV?
I've tried already to detect num of screens:
[[UIScreen screens] count]
But it remains on 1.
I've tried also to listen to an event:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(screenDidConnect:)
name:UIScreenDidConnectNotification
object:nil];
But the event never fire.
Any tips/tricks?
Thanks in advance!
Upvotes: 2
Views: 835
Reputation: 12951
Found the answer!
As simple as it could be:
Just do:
self.moviePlayer.isAirPlayVideoActive
It will return me whether the AirPlay is active/not active.
Thanks @rist
Upvotes: 4