开发者

Adding a UIView as a first run view only

开发者 https://www.devze.com 2023-01-22 04:26 出处:网络
I would like to add a Welcome view to my app which describes the instructions etc. I would like this to appear only once when the app is first launched... then with subsequent launches go to my app\'

I would like to add a Welcome view to my app which describes the instructions etc.

I would like this to appear only once when the app is first launched... then with subsequent launches go to my app's main view... which is a navigation controller.

What开发者_如何学C is the best way to track launches/ implement this idea?

Thanks.


In your root controller of a navigation controller (the view controller that is normally visible as first one), activate a modal controller with those initial instructions with presentModalViewController:animated:.

You probably want to call it from within viewWillAppear:. Do not animate presenting of modal view controller (otherwise you see what's below), but animate when dismissing it - it looks really elegant.

Use UserDefaults to store the information that it had already been shown, and do not show it anymore.


NSUserDefault is made exactly for these kind of things.


I would agree with JustSid. In my app, I set a NSUserDefault value for that use and then turned it off when the viewDidLoad. The app checks for the value but, unless the app is uninstalled, will not fire the message.

0

精彩评论

暂无评论...
验证码 换一张
取 消