How can I get a transparent background in my iOS app so I can see the Home Screen wallpaper? - ios

I’m fairly sure this is going to be straight forward in that it’s probably not possible.
Basically, I’d like to be able to lightly see the background wallpaper through my view in the same way that the new Newsstand app does.
I've tried changing the alpha value of the view, and the background color to clear, but neither of these seem to do it.

Apple has removed the ability to use this api in 7.0.3. What a shame.
You certainly can in iOS7, at least as of a few days ago. In our app once you set the following it makes your background transparent and shows the user wallpaper. If you try to programmatically take a screenshot, it will just show black instead.
Set UIApplicationIsOpaque to false in the project plist
In the app delegate load function:
self.window.backgroundColor = [UIColor clearColor];
self.window.opaque = NO;
Set the UIViewController.view's background color to [UIColor clearColor]

Good news. From iOS 13, the background transparency can finally be enabled for all third-party apps. It’s no longer a private API.
In your app’s Info.plist file, set the boolean value for
UIApplicationIsOpaque to NO.
And now the user’s wallpaper is visible inside your app.

It's not possible in iOS. While your app is running it does not mean that there is home screen behind your app.
However, If you do want to do it, there is a way that you make your app go in background, take screenshot and use that image as your background which will feel like home screen.
See this post. In this link, the accepted answer gives a way to take screenshot of home screen while your app is in background. But that's been achieved through a private API, which means your app probably will get rejected by App Store on time of submission.

Related

Make app background transparent [duplicate]

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?
I haven't tried it myself, but I hear that the private method [[UIApplication sharedApplication] _setApplicationIsOpaque: NO] may do what you're after.
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.

Set app-background as homescreen/springboard background

I know that pre-ios7 one could only get few things from outside of the sandbox, however... one thing that seems more common when using Apple's apps (!) is that they use a background which is the same as the springboard background.
One example is the "Reminders" app, which uses a translucent background of the springboards background.
I have search here and on Google, but can't find an answer to my question.
Is there anyway I can do this as well in my own app?
With default iOS background:
Onces the springboard background is changed:
Related post:
Use user's Background Image as "theme"
I'm pretty sure Apple uses a private API to do this. I don't think they provide a way for developers to get to it - which is unfortunate, because it's a nice effect.

How To Implement Apparently System-Wide Changes (Status Bar, Dock) in iOS7?

I recently noticed that there are some apps in the iOS app store which claim to be able to change the color of both the status bar and the dock of the iOS Springboard. This seems impossible because such system-wide changes are almost never allowed by Apple, and after some googling I have found no answer. Here is an example of a dock color changing app, and here is an example of a status bar changing app.
Searching SO appears to bring up code for changing the status bar in the app, which is not very difficult, but not outside of the app. However, this functionality has clearly existed for a while, for example in the Voice Memos native iOS app, which turns the status bar red while recording.
Lastly, apps such as voice Memos and the native Music app appear to bring up special controls or animations when in use on the lock screen. It is possible to use the built-in iPod lock screen controls for other music apps, (see here), but I have seen no examples of custom lock screen app controls that made it through the app store.
Sorry to pack so many questions in one, but these are all examples of apparent across-system functionalities which I and likely many others would like to replicate, and thus merit attention.
As a postscript, is it possible that the color changes in dock and status bar are done but changing those parts of the wallpaper extremely so that when seen through the translucent UI they look like less bright but still noticeable colors? Thanks!
All of the examples app you have given just change your background. Since the statusbar and dock are translucent they change color when you set the background made with these app as you background.
The red bar from the voice memos is a system indication that some app is recording, this is not something you can change. The The status bar will become green when you there is an active phone call going and you open any app. The same with tethering.
You can not add any custom lock screen controls, there is no option for this in the SDK.

iOS remove view before applicationWillEnterForeground

I'm developing an app on iOS 7 with a desired feature is that
When I home button, app enter background, I will add an image to current UIWindow. So when app enter background, if user double home button on iOS 7, os will show a small screenshot of current view of my app, so user can see my added image. :) (I did it)
When user return my app by clicking app icon, I want to remove this image immediately. In this situation, "immediately" means that user can NOT see this image anymore, user just see his/her current view when app enter foreground. I try to place the code remove image on the beginning of applicationWillEnterForeground delegate, but I'm still able to see this image for a short time after it disappears.
I also try to set hidden, alpha property for this imageview first, then removeFromSuperview, but it not works.
Can anyone help me to remove it "immediately" as my desire.
That is done automatically for all applications, you don't need to do anything in you code.
I don't think that you can do it faster, it depends of device performance. Sorry man.
Like other says it is really tricky how iOS handles these events. I've been researching and depends on the memory state of the device to do it faster or not. Indeed, in iPhone 4 and 4S may not show the image that you added on applicationWillEnterForeground method.
If I were you I would solve it by adding a smooth fade out animation of that image when the app becomes active again. With [UIView animateWithDuration: animations:] it could be nicely done! :)
If I find out something else I'll answer here!

iOS 7 - Display user wallpaper as UIWindow background

How would it be possible to have an iOS app display the user's wallpaper? Apple uses this in places like the tab view in Safari and the keypad in Phone. Setting the transparency of UIWindow proved to no avail...
This is no longer available. Too bad, because it allowed a sweet native looking effect
there are a few things you need to do to show the user wallpaper
1 - set UIApplicationIsOpaque to false in the project plist
2 - In the app delegate load function
self.window.backgroundColor = [UIColor clearColor];
self.window.opaque = NO;
3 - set the UIViewController.view background color to [UIColor clearColor]
This works for us currently. If you try to do a screen capture or actually use the wallpaper it just returns solid black (so privacy concerns don't apply since you can't do anything with the wallpaper).
This functionality is not available to third-party developers due to privacy concerns.
If you could do this in a third-party app, you could capture the background image without asking the user.

Resources