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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.DS_Store
.DS_Store
31 changes: 31 additions & 0 deletions UIView+WSCoachMarks.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// UIView+WSCoachMarksAdditions.h
//
//
// Created by Fawkes Wei on 4/18/13.
// Copyright (c) 2013 Gogolook. All rights reserved.
//

#import <UIKit/UIKit.h>

/*
## Usage Example

NSArray *coachMarks = @[
@{
@"rect": [NSValue valueWithCGRect:[button rectToMarkInView:self.view]],
@"caption": @"This is some awesome button!"
}
];

WSCoachMarksView *coachMarksView = [[WSCoachMarksView alloc] initWithFrame:self.view.frame coachMarks:coachMarks];
[self.view addSubview:coachMarksView];
[coachMarksView start];
*/

@interface UIView (WSCoachMarks)

- (CGRect)rectToMarkInView:(UIView *)view;
- (CGRect)rectToMarkInView:(UIView *)view withInset:(UIEdgeInsets )inset;

@end
21 changes: 21 additions & 0 deletions UIView+WSCoachMarks.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// UIView+WSCoachMarksAdditions.m
//
//
// Created by Fawkes Wei on 4/18/13.
// Copyright (c) 2013 Gogolook. All rights reserved.
//

#import "UIView+WSCoachMarks.h"

@implementation UIView (WSCoachMarks)

- (CGRect)rectToMarkInView:(UIView *)view {
return [self rectToMarkInView:view withInset:UIEdgeInsetsZero];
}

- (CGRect)rectToMarkInView:(UIView *)view withInset:(UIEdgeInsets )inset {
return UIEdgeInsetsInsetRect([self convertRect:self.bounds toView:view], inset);
}

@end