Reachability graphic overlay - iphone

The app I'm writing depends on having a network connection (both to the internet in general and to a specific host). The app works completely offline but the user needs to know it's offline.
I am using Reachability to watch for changes to the connection.
I was thinking of using a traffic light type system...
Red = no connection to the internet.
Yellow = connection to the internet but no connection to the host.
Green = connection to host.
At the moment I am changing the tint colour of the UINavigationBar (until I can get something better). I was thinking of putting a coloured circle into the UIStatusBar to show red, yellow, green but I'm not sure if this is possible?
I don't want to hide anything on the status bar, just add my own graphic.
Is that possible? Could anyone explain how to do this? Or is there a better way of doing this that anyone could suggest?

You can't add anything to the status bar, however this project may be of interest to you: https://github.com/myell0w/MTStatusBarOverlay and this question and it's answers: Write some text in (or on) UIStatusBar

Related

Background color won't change xcode

I just opened up a new default swift project, and no matter what I do, this background color will not change. As you can see, I have it set to the system yellow color but it's still on the default black color it comes with. The internal error warning keeps coming up as you can see in the photo below, and even if I clear the derived data it's still there so it may have something to do with that. It may also be important to mention that I'm running xcode off of an external ssd which I figured out how to do using these instructions. It does say that I may run into issues as the answer is for older versions of xcode, so that could be something, I'm not sure. Thanks in advance!
I don't have 10 reputation yet so here's the photo link

Question about UIWindow backgrounds

I have written a powerful trig calculator, but I want to use the "linen" background. I have been able to implement this in interface builder, but I get a 'yellow triangle' warning in Xcode that says it is not compatible with something like iOS 3.2 and earlier. And I'm afraid Apple will reject it if says that. I want to know the code that I can use to change both the text color (from black to white) and the background texture (from blue and white vertical stripes to the darker linen). I already know a few ways to test and apply info about the users current firmware version, but I'm always open to suggestions. Any help will be GREATLY APPRECIATED!!! I have just read the first 3 answers and duh I feel kinda stupid, that makes sense. But I would also like to know how to do this and make it like a user configurable "setting" just to make it feel nicer :-) thanks
The linen background is a tiling UIColor. You can create a tile color programmatically and apply this tiled background anywhere you would set a backgroundColor. Even on UIWindow.
If you want to maintain compatibility to old iOS versions, replace the built in background "color" (such as linen) with an UIImageView showing an image of it.
Write a simple app, filling the entire screen with the background, make a screenshot, then place it behind all other UI elements.

Black screen in iphone simulator

ok, like an idiot, in Interface Builder i started messing around with the connections and deleted a few connections (ie. delegates, controllers) and now when i build and run, all i get is a black screen. I know you cant see my code but could someone guess at what i would need to reinstate to get a working app back!
Thanks
First guess would be that the window outlet is not connected. Then I'd check all the other connections that should be there.
Oh, and use a source control management system, i.e. git. :-)

How can I use images provided by the iPhone OS?

First, let me state what brought this question about: I saw the green checkmark icon in this post and I would like to use it in my own application. However, since it looks so much like the UITableViewCellAccessoryDetailDisclosureButton my assumption is that this green checkmark icon is provided by the iPhone OS in some form or fashion.
So, my question is: how can I use the green checkmark icon and/or other OS-provided images in my own applications?
As a side question: where can I find a list of the OS-provided images (if they even exist)?
Thanks very much for any input :-)
This is not one of the standard images.
To see what you have available, you can add a UIBarButton in interface builder and try different system icons.

What's the best way to show the user something is loading on the iPhone?

Recently I've been looking to create some way of showing a user that something is being loaded. I'm sure anyone with an iPhone has seen this is apps before but what is the best way of doing it?
I started using UIProgressHUD, however it was pointed out to me that you shouldn't really use private (undocumented) API's.
I then I moved onto this which is a custom version called MBProgressHUD, however in my experience with this is wouldn't show the loading part when trying to call it not from a button and I found it very buggy (It wasn't very hard to crash the example code given by just clicking away).
I then went on to find this by James Brannan from his book, however I'm not quite sure why he claims this is the "proper way" of doing it when I've seen many apps in the past with what looks like the UIProgressHUD.
Does anyone have any ideas?
EDIT: This is pretty good...
Thanks
There is no one "best" way. Another way to do this is to simply put a UIView atop your main view's subviews, mark its userInteraction property and grey it out when needed. You could even add a UIActivityIndicator as a subview of this "foreground" UIView, starting its animation when needed. When your loading has finished, hide/stop the activity indicator and clear the foreground view's color.
If you are talking about loading over a network, one good thing to start with is to enable the status bar network activity indicator:
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
Note that you have to set it to NO when you are done! That should only be used to indicate network activity.
That's a bit subtle though, it's a great idea to have some kind of progress indicator IF you can tell exactly how long something is going to take - downloads where you know the size and count incoming bytes, or uploads where you also monitor bytes outgoing and know the total size.
If your call length is very small or the size is not really known (web service call is a great example) then some kind of overlay with a UIActivityIndicator can be very relaxing (you can also make a custom variant with a set of images added to a UIImage view to animate). The key is, that if possible it should not block the user from doing other things if possible.
Also if you have multiple things going on, you might want to add messages describing what state you are in (like, "adjusting image", "uploading image", etc).