ios开发如何判断一个控制器是点击tab得到的还是下一界面返回得到的
展开全部
view1.tag = 1;
UITapGestureRecognizer *tapGestureRecognizer1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
[view1 addGestureRecognizer:tapGestureRecognizer];
view2.tag = 2;
UITapGestureRecognizer *tapGestureRecognizer2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
[view2 addGestureRecognizer:tapGestureRecognizer2];
- (void)tapped:(UITapGestureRecognizer *)gesture
{
UIView *targetview = gesture.view;
if(targetview.tag == 1) {
}
}
UITapGestureRecognizer *tapGestureRecognizer1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
[view1 addGestureRecognizer:tapGestureRecognizer];
view2.tag = 2;
UITapGestureRecognizer *tapGestureRecognizer2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
[view2 addGestureRecognizer:tapGestureRecognizer2];
- (void)tapped:(UITapGestureRecognizer *)gesture
{
UIView *targetview = gesture.view;
if(targetview.tag == 1) {
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |