Re: My app only shows a black screen in the recent apps list
Re: My app only shows a black screen in the recent apps list
- Subject: Re: My app only shows a black screen in the recent apps list
- From: Alex Zavatone <email@hidden>
- Date: Fri, 23 Dec 2016 08:01:22 -0600
Andreas, I've seen very interesting behaviour on iOS it you have not supplied a launch image or if you have not supplied one that has the screen dimensions that your device needs natively. It appears to fall back to check if a launch image of a smaller size is available and then the resolution takes the size of that other image and scales up to be full screen while preserving the aspect ratio of the image.
So, the dimensions of your launch image are directly related to the the screen size of your app. I could see how not having a launch image would cause a black screen shot.
What version of iOS and which device are you running this on? What happens in the simulator?
On Dec 23, 2016, at 7:35 AM, Andreas Falkenhahn wrote:
> On 22.12.2016 at 21:58 David Duncan wrote:
>
>> Do you do anything special when going into the background? The
>> snapshot is taken shortly after your application is placed in the
>> background, so if your view hierarchy changes that is what will actually be snapshotted.
>
> No, I'm actually not doing anything when the app is shutdown. All
> respective delegate methods are completely empty. I should add
> that the actual drawing is done by a worker thread, but of course
> this thread calls dispatch_sync() when exchanging the layer's
> contents to the new image, e.g.
>
> dispatch_sync(dispatch_get_main_queue(), ^{
> myView.layer.contents = (id) myImage;
> });
>
> So it could probably happen that this code is executed even after
> iOS runs methods like applicationWillResignActive() but certainly
> not at the same time because I use dispatch_sync() to change the
> layer's contents on the main thread.
>
> Upon closer observation, the behaviour is actually really strange.
> Now that I've added launch images (not a storyboard) the black screen
> is gone but the launch image is shown instead. But not always!
> Sometimes there's also a snapshot of my app. And what makes the
> confusion complete is the fact that iOS sometimes even alternates (!)
> between those two images when cycling through the recent apps list,
> e.g. when cycling through the recent apps list by swiping to the left
> my app shows the launch image. Then, without leaving the recent
> apps list, I'm cycling through the list again, but this time by swiping
> to the right, and suddenly my app shows the correct snapshot from
> the last frame it drew! This is really confusing. Smells like an
> iOS bug to me because why would it alternate between the launch image
> and a snapshot without me ever leaving the recent apps list?
>
> --
> Best regards,
> Andreas Falkenhahn mailto:email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden