iPhone App Appearance Swap? - ios

In my app I want to have an option available so that the user can alter the appearance of the app. This would simply be the visual style -- navigation bar, cell, font, and button images.
The user hits a button and then the app loads in the appropriate images or whatever.
What are the ways to approach this?

In iOS 5 and later you can use the UIAppearance class method appearance, which returns the appearance proxy for the receiver, and set it there. For instance, if you wanted to make all UIView background colors green, you would simply say:
[[UIView appearance] setBackgroundColor:[UIColor greenColor]];
This would, of course, only be good for the single user session. Once the app quit, you'd be back to white or whatever background color you set as the default.
The comment suggesting this SO question: Best way to apply a theme to an iPhone app provides a much more in-depth answer, and is probably more along the lines of what you're looking for.

Related

Suggestions needed for application dark mode ios

I am making a dark mode setting for my app.
Currently, the dark mode is nearly working on a single scene. While adding the dark mode though, I noticed that I need a lot of IBOutletCollection to properly change the colors that I want (ex. labels should become white, background black, the title should be a very dark gray...).
Now, this seems inefficient and time consuming. Isn't there a way to load everything, for() it, and set the correct color for each specific object? (If there is, how?)
UIAppearance is what you are looking for, it’s meant to be used for changing the appearance of a class https://developer.apple.com/documentation/uikit/uiappearance?language=objc
For example a label would be styled like this:
[[UILabel appearance] setTextColor: [UIColor whiteColor]];
See also related question on how to do the actual switching of the themes Using UIAppearance and switching themes

Application NightTime Mode

I have just finished creating my first application and would like to add some additional customisations to it. That is, in my settingsViewController I have added a switch which allows to set the colours to a nighttime mode. My questions is how can I actually get my application to do this.
Thanks in advance for your responses.
You can't expect this thing to be handled by iOS itself because its an app feature that you will have to implement.
You can change background colors to dark and all those UILabel UIButton UITextView dark colored as well to have a feature called dark mode(Dark theme) upon user selection.

iOS custom keyboard blur view as background

This is really simple, but maybe not easy?
I'm trying to build a custom keyboard app for iOS, and so far I've made a concept work pretty well. But I really want to have the whole container/background view to be a blur view (frosted glass effect built in iOS), much like the system keyboard. It's very subtle, but I really want that effect.
Any idea how to apply it? Help!
One solution I found (which is great but not ideal) is to simply set the background color of the ViewController to transparent. By giving it a color with alpha = 0, it has the same color as the system keyboard background.
But this doesn't let you go any further in terms of transparency, so the blur is very subtle.

How can I add the user background into the app as a translucent background in iOS 7?

I want to know if its possible to have the user set background as the actual app background in iOS 7; similarly to how Newsstand gives the user background as a translucent element when one doesn't have any magazines set in it.
In the plist set UIApplicationIsOpaque to NO (false), then set, self.window.opaque = NO and self.window.backgroundColor = UIColor.clearColor.
Lastly set all view controllers you want to show background to default color (clear), this will show the background not give it the blur effect, that's a different story.
I will warn you, it works like a charm, but a lot of developers are experiencing an issue, that plist property is not being validated and a solution hasn't been found/posted yet. So for personal apps it's cool, for submitting apps you might have to wait or possibly just not do it for now.

Notification bar in iPhone apps

I would like to create a notice bar, like the active-phone-call notice bar, whenever my user losses connection to my server.
Is there an easy way to do this? Can't find it in the API, but there must be some supported way - or should I program it manually?
Example: The difference being I want it to be active while in my app and I want to define the text myself.
There is no direct API available for doing this, but you can change the status bar color like this
self.window.backgroundColor = [UIColor colorWithRed:0.78f green:0.13f blue:0.11f alpha:1];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];
and add another view below with your custom text.
Or, if you just want so put some information in the status bar with a custom color, take a look at KGStatusBar or MTStatusBarOverlay.
You can set a window at the statusbar level and actually replace the phone's status bar with your own, if this is what you are asking. The way this can be implemented is found here
However keep in mind that your app may be rejected by Apple in that case.
A lot of apps, are using this for showing for a brief moment some information on the status bar position, then they show the status bar again. The Groupon App was actually doing this and was displaying a UIPageControl when you swiped through their different UITableViews to show you how many UITableViews are available.
Here's a decent library I came across the other day called "KGStatusBar, A minimal status bar for iOS." https://github.com/kevingibbon/KGStatusBar. I haven't tried it yet but glancing at the source it seems solid.

Resources