Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions WSCoachMarksView.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ - (void)goToCoachMarkIndexed:(NSUInteger)index {
NSString *markCaption = [markDef objectForKey:@"caption"];
CGRect markRect = [[markDef objectForKey:@"rect"] CGRectValue];

// Delegate (coachMarksView:willNavigateTo:atIndex:)
if ([self.delegate respondsToSelector:@selector(coachMarksView:willNavigateToIndex:)]) {
[self.delegate coachMarksView:self willNavigateToIndex:markIndex];
}

// Calculate the caption position and size
self.lblCaption.alpha = 0.0f;
self.lblCaption.frame = (CGRect){{0.0f, 0.0f}, {self.maxLblWidth, 0.0f}};
Expand All @@ -205,6 +200,12 @@ - (void)goToCoachMarkIndexed:(NSUInteger)index {
self.lblCaption.alpha = 1.0f;
}];

// call delegate here so lblCaption frame can be used by delegate
// Delegate (coachMarksView:willNavigateTo:atIndex:)
if ([self.delegate respondsToSelector:@selector(coachMarksView:willNavigateToIndex:)]) {
[self.delegate coachMarksView:self willNavigateToIndex:markIndex];
}

// If first mark, set the cutout to the center of first mark
if (markIndex == 0) {
CGPoint center = CGPointMake(floorf(markRect.origin.x + (markRect.size.width / 2.0f)), floorf(markRect.origin.y + (markRect.size.height / 2.0f)));
Expand Down