Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated lib to get text color in title and description label #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
9 changes: 4 additions & 5 deletions ProductTour/CRViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ - (void)viewDidLoad

//SET BUBBLES TOUR VIEWS

CRBubble *bubbleButton1 = [[CRBubble alloc] initWithAttachedView:_button1 title:@"1. The First Button" description:@"Setup your bubbles and \ndraw whatever you want \nwith multiline text" arrowPosition:CRArrowPositionTop andColor:nil];
CRBubble *bubbleButton1 = [[CRBubble alloc] initWithAttachedView:_button1 title:@"1. The First Button" description:@"Setup your bubbles and \ndraw whatever you want \nwith multiline text" arrowPosition:CRArrowPositionTop color:nil textColor: [UIColor greenColor]];
//You can set the bubble title font.
//[bubbleButton1 setFontName:@"Baskerville"];

CRBubble *bubbleButton2 = [[CRBubble alloc] initWithAttachedView:_button2 title:@"2. The Second Button" description:@"Just click, nothing append" arrowPosition:CRArrowPositionLeft andColor:nil];
CRBubble *bubbleButton2 = [[CRBubble alloc] initWithAttachedView:_button2 title:@"2. The Second Button" description:@"Just click, nothing append" arrowPosition:CRArrowPositionLeft color:nil textColor: [UIColor whiteColor]];

CRBubble *bubbleButtonHelp = [[CRBubble alloc] initWithAttachedView:_buttonHelp title:@"Help toogle" description:@"You don't need help anymore ? \nDisable it." arrowPosition:CRArrowPositionRight andColor:nil];
CRBubble *bubbleButtonHelp = [[CRBubble alloc] initWithAttachedView:_buttonHelp title:@"Help toogle" description:@"You don't need help anymore ? \nDisable it." arrowPosition:CRArrowPositionRight color:nil textColor: [UIColor whiteColor]];

NSMutableArray *bubbleArray = [[NSMutableArray alloc] initWithObjects:bubbleButton1, bubbleButton2, bubbleButtonHelp, nil];

Expand All @@ -41,8 +41,7 @@ - (void)viewDidLoad
// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
Expand Down
2 changes: 1 addition & 1 deletion ProductTour/CRViewController2.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ - (void)viewDidLoad

//SET BUBBLES TOUR VIEWS

CRBubble *bubbleButton1 = [[CRBubble alloc] initWithAttachedView:_button1 title:@"Multiview control" description:@"You can activate/desactivate \nhelp from other view controllers \nit wi affect all your App \nProduct Tour bubbles" arrowPosition:CRArrowPositionBottom andColor:COLOR_DARK_MANGENTA];
CRBubble *bubbleButton1 = [[CRBubble alloc] initWithAttachedView:_button1 title:@"Multiview control" description:@"You can activate/desactivate \nhelp from other view controllers \nit wi affect all your App \nProduct Tour bubbles" arrowPosition:CRArrowPositionBottom color:COLOR_DARK_MANGENTA textColor: [UIColor whiteColor]];

NSMutableArray *bubbleArray = [[NSMutableArray alloc] initWithObjects:bubbleButton1, nil];

Expand Down
3 changes: 2 additions & 1 deletion ProductTour/ProductTour/CRBubble.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ typedef enum {
@property (nonatomic, strong) NSString *bubbleDescription;
@property (nonatomic, assign) CRArrowPosition arrowPosition;
@property (nonatomic, strong) UIColor *color;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, strong) NSString *fontName;
-(id)initWithAttachedView:(UIView*)view title:(NSString*)title description:(NSString*)buubleDescription arrowPosition:(CRArrowPosition)arrowPosition andColor:(UIColor*)color;
-(id)initWithAttachedView:(UIView*)view title:(NSString*)title description:(NSString*)buubleDescription arrowPosition:(CRArrowPosition)arrowPosition color:(UIColor*)color textColor:(UIColor*)textColor;
-(CGSize)size;
-(CGRect)frame;
@end
31 changes: 17 additions & 14 deletions ProductTour/ProductTour/CRBubble.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ @implementation CRBubble
#pragma mark - Constructor


-(id)initWithAttachedView:(UIView*)view title:(NSString*)title description:(NSString*)bubbleDescription arrowPosition:(CRArrowPosition)arrowPosition andColor:(UIColor*)color
{
-(id)initWithAttachedView:(UIView*)view title:(NSString*)title description:(NSString*)bubbleDescription arrowPosition:(CRArrowPosition)arrowPosition color:(UIColor*)color textColor:(UIColor*)textColor {
self = [super init];
if(self)
{
if(self) {

if(textColor!=nil)
self.textColor = textColor;
else
self.textColor = COLOR_DARK_GRAY;

if(color!=nil)
self.color=color;
self.color = color;
else
self.color=COLOR_GLUE_BLUE;
self.color = COLOR_GLUE_BLUE;
self.attachedView = view;
self.title = title;
self.bubbleDescription = bubbleDescription;
Expand All @@ -48,7 +52,7 @@ -(id)initWithAttachedView:(UIView*)view title:(NSString*)title description:(NSSt

if (self.title && ![self.title isEqualToString:@""]) {
titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(actualXPosition, actualYPosition, actualWidth, actualHeight)];
[titleLabel setTextColor:[UIColor blackColor]];
[titleLabel setTextColor: self.textColor];
[titleLabel setAlpha:0.6];
[titleLabel setFont:[UIFont fontWithName:fontName size:CR_TITLE_FONT_SIZE]];
[titleLabel setText:title];
Expand All @@ -70,18 +74,17 @@ -(id)initWithAttachedView:(UIView*)view title:(NSString*)title description:(NSSt
actualHeight =CR_DESCRIPTION_FONT_SIZE;

UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(actualXPosition, actualYPosition, actualWidth, actualHeight+CR_ARROW_SPACE)];
[descriptionLabel setTextColor:COLOR_DARK_GRAY];
[descriptionLabel setFont:[UIFont systemFontOfSize:CR_DESCRIPTION_FONT_SIZE]];
[descriptionLabel setText:descriptionLine];
[descriptionLabel setBackgroundColor:[UIColor clearColor]];
[self addSubview:descriptionLabel];
[descriptionLabel setTextColor: self.textColor];
[descriptionLabel setFont: [UIFont systemFontOfSize:CR_DESCRIPTION_FONT_SIZE]];
[descriptionLabel setText: descriptionLine];
[descriptionLabel setBackgroundColor: [UIColor clearColor]];
[self addSubview: descriptionLabel];

if (!self.title || [self.title isEqualToString:@""])
actualYPosition+=actualHeight;

}

if(SHOW_ZONE){
if(SHOW_ZONE) {
UIView *myview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.attachedView.frame.size.width, self.attachedView.frame.size.height)];
[myview setBackgroundColor:self.color];
[myview setAlpha:0.3];
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Integration
productTourView = [[CRProductTour alloc] initWithFrame:self.view.frame] ;

//Setup your bubbles
CRBubble *bubbleButton1 = [[CRBubble alloc] initWithAttachedView:_button1 title:@"My Title" description:@"A smal description" arrowPosition:CRArrowPositionBottom andColor:[UIColor redColor]];
CRBubble *bubbleButton1 = [[CRBubble alloc] initWithAttachedView:_button1 title:@"My Title" description:@"A smal description" arrowPosition:CRArrowPositionBottom color:[UIColor redColor] textColor:[UIColor greenColor]];

NSMutableArray *bubbleArray = [[NSMutableArray alloc] initWithObjects:bubbleButton1, nil];

Expand Down