-2

I am making an app, and I have written some code to tell me whether or not it is the first time that the user is opening it. If it is the first time, I want to display a a little "tour" of the app (similar to the app "Pages by Fifty Three", where the user swipes between pages, introducing you to the app).

How do I display a similar welcome message in my app?

TO CLARIFY: I have already got the code for determining whether or not this is the first time the app is launching. I just want to know how i get the initial welcome tour pop up, just like in the app, "Paper"?

user2397282
  • 3,798
  • 15
  • 48
  • 94
  • 1
    http://stackoverflow.com/questions/11237008/how-to-determine-that-user-runs-the-app-for-the-first-time – tikhop Dec 09 '13 at 16:43
  • Have you attempted anything? Basically you set a `NSUserDefaults` bolean variable determining if the intro message was seen or not. If not that show a message. – logixologist Dec 09 '13 at 16:45
  • i have edited my questions to say that I have already written the code for determining whether it is the first time the app is opening. I just want to know how to get the same welcome tour pop up, as in the app, "Paper"? – user2397282 Dec 09 '13 at 16:47

2 Answers2

2

You can save a BOOL variable (isOpenedFirstTime) in user defaults in didFinishLaunchingWithOptions: method and check it every time if this variable exists and if it's there it means that the app was previously opened. If not exist show the 'tour' and save the variable so next time it will be there.

Greg
  • 25,317
  • 6
  • 53
  • 62
2

Ok, so, delete your app from the app simulator then before you run it, make some edits in the code.

So in the viewDidLoad of your first View Controller, use this

[[NSUserDefaults standardUserDefaults]setBool:@"Yes" forKey:@"isFirstTime"];

Then you use an if statement checking if [[NSUserDefaults standardUserDefaults] boolForKey:@"isFirstTime"]; == @"Yes" if so, present your controller modally.

user2666705
  • 174
  • 10