Reputation: 2147
I am building a pretty complex app, and for the first time of use i'd like to show tips on how to use certain features of the app. For example, when you sign up with instagram or twitter, there are tips and tutorials for how to post a photo, follow users, etc. I'm not looking for a detailed answer, i'm just wondering on how to get started with that.
Upvotes: 2
Views: 245
Reputation: 25261
Part 1: You need to detect if it's the first time the user logged in. You can use NSUserDefault
like this to record this info locally, or if you have a server, it will be great to record this info in your server so that when the user reinstall the app, he won't see the instruction again.
Part 2: To show the tutorials, my favorite way is to have a single view controller with a image view inside. Set both view controller and image view to have background transparency 0.8 so that the user can still see through the tutorial image. Then set a on click listener to the image view. Now you need a set of image tutorials, with transparent background and white color text & images telling user what to do. Put these image to your main bundle. Every time when you need to show these images, simply pass the image names to that view controller by
let vc = YourViewController()
vc.imgList = ["img1", "img2"]
self.present(vc, animated: false, completion: nil)
In the listener of your tutorial view controller, when user clicked on the last image, dismiss the view controller
dismiss(animated: true, completion: nil)
You can also use a scroll view with images views so that you can scroll it back and forth. Here is the github sample code for that.
Upvotes: 1
Reputation: 11
Your question is confusing. What you want?
If you want to know how to guide user, than you can use Sequence of Image if user came first time in you app. (pictorial way is a best way to guide user.)
And to check it's first time or not, use any tag.
Upvotes: 1
Reputation: 481
Use UserDefaults to save user's info.
UserDefaults.standard.set("User Welcomed", forKey: "onboarded")
Check app is installed for first time, if yes then display overlay(show tutorial) else not.
if UserDefaults.standard.value(forKey: "onboarded").isEmpty {
//display tutorial
}
Upvotes: 1
Reputation: 1535
Set a flag to check that user has installed and open application first time or not. And save flag value to NSUserDefault and on next launch check flag value and show your tutorial according.
Upvotes: 0