Helpscreen that will only showup once - UIImageView? - ios

I want to show an UIImage with helpful tips when the user opens my app for the first time. I thought about putting a UIImageView and a button on top of the relevant ViewController and the image will be dismissed with a tap (alpha from 1 to 0) but I'm not sure that it's such a good idea to have a button and an UIImageview on top of my app at all times if it's only going to be used once. I want the image to be on top of the current ViewController so i can point to buttons etc' with arrows.
Is there a more elegant way accomplishing my goal?
And another thing, I want my app to remember that the picture was already shows. Should I use NSUserDefaults for that or is it there another solution I'm not aware of?
Thanks guys

Yes, use NSUserDefaults. Check this in the appDelegate and if not yet shown, show your image. Forget alpha, just present a view controller (modally, popover, however you like) and include a "dismiss" or "close" button that dismisses the view controller.

Related

iOS Navigation Controller Background Glitch

OK, Ive looked everywhere for an answer, and I am unsure of what you may call this by a name - but I have detailed what my issue is below.
In my main.storyboard file, I have a view as a child from a navigation controller (i.e., allowing nav bar navigation) - being a MKMapView, which when you tap on a pin, it brings up the next scene.. This is all as it should be... (lets call it the "map" and the "detail" scene)
BUT!!!
When you hit the back button, the map view glitches and overlays the detail views background image over the mkmapview for about half a second. Would anyone be able to suggest what this problem is? Thanks soo much!
Due to stack overflow, I can't upload a picture just yet (reputation).. are you allowed to link externally?
Your help is very much appreciated.
EDIT: Ive uploaded a screenshot: http://tinypic.com/r/e19gtx/8
Try
self.view.backgroundColor = [UIColor whiteColor];
in ViewDidLoad.
Basically make sure your glitchy view has a background colour.
Did you use segue? Try manually pusing the "detail" view controller onto the map using
[self.navigationController pushViewController:#yourDetailViewController# animated:YES]
hope this works, i encountered this before.

iOS How to implement a countdown screen before the user sees the view

I was wondering what is the best way to implement a countdown screen before showing the user the game view. For a more detailed example, I want the user to see a screen that displays 3...2...1...GO ! and than the game will appear.
Currently in my application I am using a navigation controller as my main menu where you can select multiple games to choose from. When a user selects one of the game buttons this is where I want the countdown screen to appear before my game interfaces does.
Solutions that I have thought about:
1) should I implement a new view controller that i push on the navigation controller to perform the count down ( seems like a waste)
2) is there a way to blank everything on a view and show a countdown first?
Thanks in advance for your help and cooperation !
Ryan
The best way i think is as soon as user selects a game, add your 3..2..1. Go screen on the same view..as soon as u present this u can also start preparing to create your game interface(but do not present). After GO appears, remove this countdown view and present your game..
It depends on the effect you are after. If you push a view controller onto the navigation stack, you'll need to use a pop transition.
My suggestion would be to open the game view controller and put a full-screen sized overlay view on top of it with your countdown message. Have the game VC manage the countdown view. When the countdown is complete, you could fade it, shrink it to a point, do some sort of clock wipe or keyhole animation, or whatever you want, easily and simply. (Some things are obviously easier than others. Cross-fades, shrinks and the like are trivial. clock wipes and keyhole transitions are much harder and require pretty advanced Core Animation skills.
What platform will this be for? For a full screen overlay I would try UIPopoverViewController if on an iPad. Otherwise, try a view controller presented modally. I believe you can set the transparency of either type to less than 1 so the underlying view shows through. In this case it would be nice to display the selected game's opening screen during the countdown. Of course it would be dark because of the overlying view. But it would provide a glimpse into what is to come.

hide keyboard in secondary viewcontrollers when pressing background storyboard

I've been scourging the internet and saw several promising answers but none that worked for me. The problem I have is that I have many ViewControllers that I placed in Storyboard mode.
Lets say in my 5th view controller I have some TextViews and TextFields that pops up a keyboard for user input when pressed. However I want to be able to hide the keyboard when I press the background.
I tried following the first and second responses here: How to dismiss number pad keyboard by tapping anywhere
But I dont think my set up is exactly the same as theirs.
Can someone please help me? Please be VERY SPECIFIC if possible and dont assume I know how to fill in the dots.
Thanks so much!!
edit. sorry for not being clear but I meant I want the app to dismiss the keyboard when the user presses anywhere on the screen (thats not another Text field/view). The link I show does this but my problem is that I am storyboarding so I have multiple UIViewControllers and I'm not sure how to get IBOutlets/IBActions to work for the "secondary" viewcontrollers. They only show up under the first/main one...
In your application delegate file,
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[self.window endEditing:YES];
}
you can use [self.view endEditing:YES];
have a look at the Apple docs for Ending a View Editing Session

Show a splash screen while loading a view controller from another view controller

I have an app that opens with a splash screen (Default.png), then loads the first view (ViewController1) in a navigation controller. Straight away, an instance of ViewController2 (VC2) is created, and pushed onto the navigation controller:
[self.navigationController pushViewController:VC2 animated:NO];
So when I run the app, the default image is displayed, then the view of ViewController1 is briefly displayed until ViewController2 is loaded (and then displayed).
How can I stop the brief display of ViewController1? Can I extend the display of Default.png until VC2 is displayed, or cover ViewController1 with the Default.png image until VC2 shows?
Thanks so much.
If the only thing you want to do is to show VC2 without showing VC1, in the viewDidLoad method of your VC1 you can do self.view.hidden = YES; then push the VC2 without animation
I think in your case, you want VC2 to be your starting point with VC1 as your ad-hoc splash screen. The default.png images should be a way to mirror the look of your app to give the impression your app is starting and working faster than it may appear. (This is taken from Apple's HIG)
You may want to consider making VC1 your new splashscreen/loading screen. You could make it into a simple waiting or loading page then load VC2 once everything in your app has been taken care of. Default.png could be an image of the loading screen and would give the impression your app is loading right away.
There are many differing opinions of how to approach this issue. You will ultimately have to decide which method is best for you and your application.
One final thought, you could load directly to VC2 and just present a loading progress view. I have used MBProgressHUD to lock the user out while I load information or perform tasks they need to wait for. This could be another option. Hope this information helps.
You can add a UIImageView to VC1 with Default.png, then remove it in viewDidDisappear:.
I don't think you can modify the Default.png behaviour. I would suggest you create an UIImageView in ViewController1 with Default.png as its image. Give it the exact same size as the screen and add it as a subview that completetely covers it. That way you will see Deafult.png twice and after it will go to ViewController2

UIView being cached?

Ok this is a little hard to explain but here I go. On "View1" I use a UIView animation to go to "View2". The animation I do is a fade through black, switching views. I get to View2 by doing -addSubview. Now lets say we are on View2, and my action gets called to go to View3 using presentModalView. Since I need to remove the "View2" view, I do [self.view removeFromSuperview]; in my viewDidDisappear method so that the animation going to View3 is not screwed up.
Here is the problem, when I go from my "View3" back to "View1" I use a presentModalView again with an animation flip. Now you know when you usually flip views, you see a background in the back of a color (usually white), instead it is my "View2". So it is like it is being cached in a way.
Does anyone know why this is? If I need to post code, I can.
You can actually check this tutorial about using the UINavigationController:
http://www.icodeblog.com/2008/08/03/iphone-programming-tutorial-transitioning-between-views/
To hide your Navigation Bar you can actually see this post:
Is it possible use UINavigationController but hide its navigation bar (replace it with customized toolbar) and go back button
Edit 1:
Uploaded the project now here: http://www.2shared.com/file/qU-QT8fl/Project.html
Read the ReadMe.text file. :P

Resources