我目前正在实施WSCoachMarksView框架,以便在首次使用该应用时向用户介绍功能。下面的代码在我的SearchViewController.m
中,并为该视图控制器做了它应该做的事情。
然而,当从这个视频转换到另一个视图控制器时,它将再次运行WSCoachMarksView
代码并使屏幕变暗,尽管目标视图控制器中没有代码告诉它这样做。为什么会这样?以下代码中是否有某些内容不包含仅SearchViewController
的操作?我应该补充一点,SearchViewController
位于导航视图中。
- (void)viewDidLoad
{
[super viewDidLoad];
// Setup coach marks
NSArray *coachMarks = @[
@{
@"rect": [NSValue valueWithCGRect:(CGRect){{50,168},{220,45}}],
@"caption": @"Just browsing? We'll only notify you periodically of new matches. Need it soon? We'll notify you more frequently, and match you with items that are closer to you."
},
];
WSCoachMarksView *coachMarksView = [[WSCoachMarksView alloc] initWithFrame:self.view.bounds coachMarks:coachMarks];
[self.view addSubview:coachMarksView];
coachMarksView.animationDuration = 0.5f;
coachMarksView.enableContinueLabel = YES;
[coachMarksView start];
}