简体   繁体   中英

Walking Tour for the first time app user

I am implementing walking tour for the first time user in the application. I do not know is there a better way of doing it, but I have implemented the following approach which detects user taps via tap gesture recognition.

I wonder how could I handle if I have more than one image? Or is there any better or recommended approach for the walking tour?

- (BOOL)application:(UIApplication *)application 
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

    UIImageView *imageView = [[UIImageView alloc] 
    initWithImage:[UIImage imageNamed:@"yourimage.png"]];
    [self.window addSubview:imageView];

     UITapGestureRecognizer * recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
     recognizer.delegate = self;
    [imageView addGestureRecognizer:recognizer];
    imageView.userInteractionEnabled =  YES;
    self.imageView = imageView;
}

- (void) handleTap:(UITapGestureRecognizer *)recognize
{
     [self.imageView removeFromSuperView];
}

It is totally up to you how you want yo implement this. The approach you have mentioned have nothing wrong.

For your question if you have more than one images then you can create a container view on which you can add multiple imageViews . And On Touch on that container you can show hide image view based on your sequence.

Using PageViewController will be another good option for this. You can try this control.

PageViewController

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM