Skip to content

Instantly share code, notes, and snippets.

@jdewind
Created April 23, 2012 00:12
Show Gist options
  • Save jdewind/2467675 to your computer and use it in GitHub Desktop.
Save jdewind/2467675 to your computer and use it in GitHub Desktop.
iOS mirroring selection
// Make sure MediaPlayer.framework has been added and the MPAudioVideoRoutingPopoverController interface has been declared.
@interface MyViewController ()
@property (strong, nonatomic) MPAudioVideoRoutingPopoverController *airplayPopoverController;
@end
- (void)someButtonTapped:(id)sender {
self.airplayPopoverController = [[MPAudioVideoRoutingPopoverController alloc] initWithType:0 includeMirroring:YES];
self.airplayPopoverController.delegate = self;
[self.airplayPopoverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment