external display black screen after crash, bug?

Hello.


I´m making use from external display on my app. The problem is when app crashed on iOS 12.


After a crash external display image is black, if the user launch again my app, the iPad doesnt detect the display (black screen), i have to launch other app and after the crashed app or unplug and plug again the HDMI.


Is this a bug? On iOS 11 is working, when app crashed iPad mirror its content and when launch again the crashed app, detect the display again.


See you

Replies

It is not very clear ; please explain precisely the sequence to recover display:


i have to launch other app and after the crashed app or unplug and plug again the HDMI.

When you launch other App, does external monitor work immediately ?

What do you mean 'after the crashed app' ?

or unplug and plug again the HDMI.

For other app or only your app ?


Do you experience the sampe issue when connecting through AIrplay ?


If not, and if it does not work with other app without disconnecting, that could be a hardware reason.


Is it a lightning or USB-C Connector ?

Effectively, things changed in IOS 12:

h ttps://medium.com/@hacknicity/external-display-support-on-ios-665cd1774511

See also https://support.apple.com/en-us/HT202044


If you need help with other issues

Disconnect and reconnect your adapter from your iPhone, iPad, or iPod touch and from your TV, monitor, or projector.

Example for iOS 12 on main UIViewController, you dont need even real external display programming.


- (void) viewDidAppear:(BOOL)animated

{

[super viewDidAppear:animated];


[self performSelector:@selector(checkExternalScreen) withObject:nil afterDelay:1.0];

}


- (void) checkExternalScreen

{

UIAlertController *alert= [UIAlertController

alertControllerWithTitle:@"Screens"

message:[NSString stringWithFormat:@"Screens connected:%ld ",UIScreen.screens.count]

preferredStyle:UIAlertControllerStyleAlert];


UIAlertAction* ok = [UIAlertAction

actionWithTitle:NSLocalizedString(@"AceptarKey", nil)

style:UIAlertActionStyleDefault

handler:^(UIAlertAction * action)

{

[self dismissViewControllerAnimated:YES completion:nil];

}];


[alert addAction:ok];


[self presentViewController:alert animated:YES completion:NULL];

}



-(IBAction) crashButton:(id)sender

{

@throw NSInternalInconsistencyException;

}


On iOS 12:


1) First Launch: Screens connected: 2

2) Press crashButton

3) Launch again the app: Screens connected: 1


On iOS 11:


1) First Launch: Screens connected: 2

2) Press crashButton

3) Launch again the app: Screens connected: 2


For detecting on iOS 12 the screen again, you need unplug and plug HDMI (lighting to HDMI). Or you can detect again the screen if you are launching other different app before your crashed app.


EDIT: For reproducing this bug, you must launch the app from dashboard and not from XCode.


Same issue with Airplay. Is not hardware fault. iOS 11 is working properly.


Thanks.

Don't know it it's a bug (you can report the problem anyway), or normal (even though unconvenient here) behavior.


But it is visibly known that this can occur as I noted above:

If you need help with other issues

Disconnect and reconnect your adapter from your iPhone, iPad, or iPod touch and from your TV, monitor, or projector.

Thanks, I have reported this like a bug.