25

I've seen some apps for example (Vesper, or iPad's reminders app) make use of a user's home screen background image. How is that possible?

It must be some sort of clever trick to make a transparent View or Window or (Gulp!) Private API?

Anyone hazard a guess? enter image description here enter image description here

noelicus
  • 14,468
  • 3
  • 92
  • 111
mskw
  • 10,063
  • 9
  • 42
  • 64
  • Very similar question: http://stackoverflow.com/questions/18714305/how-can-i-add-the-user-background-into-the-app-as-a-translucent-background-in-io (interesting part: that one is -2, this one is +7) – zpasternack Sep 26 '13 at 19:24
  • Because he posted the question while SDK was still under NDA/Beta. And there are pretty pics here. – mskw Sep 26 '13 at 19:51
  • 1
    Stackoverflow is not responsible for enforcing any form of NDAs, so questions shouldn't be downvoted for it. – Tim Sep 27 '13 at 17:18
  • In iOS 13, this is finally possible! See my answer here: https://stackoverflow.com/a/56592568/7840155 – Tzar Jun 14 '19 at 06:50

2 Answers2

13

I haven't tried it myself, but I hear that the private method [[UIApplication sharedApplication] _setApplicationIsOpaque: NO] may do what you're after.

Simon
  • 25,468
  • 44
  • 152
  • 266
  • 2
    I can confirm that this method does work. Though I kinda doubt that's what the above apps are using (Apple doesn't typically take kindly to private API usage). – zpasternack Sep 26 '13 at 18:33
  • 4
    Turns out UIApplicationIsOpaque in info.plist has the same affect (and, I'm betting, same likelihood of being rejected). – zpasternack Sep 26 '13 at 19:25
  • 3
    Also you have to add one more thing: The view you are in must have backgroundcolor = clearcolor and for all superviews that are behind it. – mskw Sep 26 '13 at 20:57
  • 2
    Really wish this wasn't a private API, it is such a good effect and so prevalent in the iOS7 apps! It would make our apps so much more unified with the OS if they allowed it. Also, don't forget to remove any colouring for the window in AppDelegate if you let it auto generate, by default it is white. – Tim Sep 27 '13 at 17:50
  • 2
    I just notice the above app has removed this effect. They instead use the default wall paper(galaxy pic) and blurred it instead for maximum probability that someone is still using that BG. hahah. – mskw Sep 30 '13 at 01:24
  • 2
    Just an update on iOS 8.2 beta, this solution doesn't work any more – Tonny Xu Jan 03 '15 at 01:16
  • @TonnyXu Have they removed the method or does it fail silently? – Simon Jan 03 '15 at 12:12
  • 2
    @Simon, I don't know if they removed this method or not, but if you use this method, it just fails silently. I've tested this on all the simulators and devices I have – Tonny Xu Jan 03 '15 at 15:08
0

iOS 13 beta 1 supports setting UIApplicationIsOpaque to NO in Info.plist. But, it’s not documented so it will maybe be removed or not allowed on the App Store.

Emma Labbé
  • 667
  • 7
  • 18