Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion Example/Example/MPCoachMarks/MPCoachMarks.m
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ - (void)goToCoachMarkIndexed:(NSUInteger)index {
// Coach mark definition
NSDictionary *markDef = [self.coachMarks objectAtIndex:index];
NSString *markCaption = [markDef objectForKey:@"caption"];
NSAttributedString *attributedMarkCaption = [markDef objectForKey:@"attributedCaption"];
BOOL isAttributed = [markDef objectForKey:@"isAttributed"];
CGRect markRect = [[markDef objectForKey:@"rect"] CGRectValue];

MaskShape shape = DEFAULT;
Expand Down Expand Up @@ -271,7 +273,12 @@ - (void)goToCoachMarkIndexed:(NSUInteger)index {
// Calculate the caption position and size
self.lblCaption.alpha = 0.0f;
self.lblCaption.frame = (CGRect){{0.0f, 0.0f}, {self.maxLblWidth, 0.0f}};
self.lblCaption.text = markCaption;
if (isAttributed) {
self.lblCaption.attributedText = attributedMarkCaption;
}
else {
self.lblCaption.text = markCaption;
}
[self.lblCaption sizeToFit];
CGFloat y;
CGFloat x;
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ coachMarksView.enableContinueLabel = NO;
[coachMarksView start];
```

You can add attributed text in your label like so:

```objective-c
NSArray *coachMarks = @[
@{
@"attributedCaption": @"You can put marks over images",
@"isAttributed": [NSNumber numberWithBool:YES]
},
];
```
For the attributed text to be adapted, isAttributed property is necessary.


Example of how to show the coach marks to your user only once (assumes `coachMarksView` is instantiated in `viewDidLoad`):

```objective-c
Expand Down