diff --git a/ProductTour.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ProductTour.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ProductTour.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ProductTour/CRViewController.m b/ProductTour/CRViewController.m index 4305159..afb11d6 100644 --- a/ProductTour/CRViewController.m +++ b/ProductTour/CRViewController.m @@ -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]; @@ -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. } diff --git a/ProductTour/CRViewController2.m b/ProductTour/CRViewController2.m index d56e997..da707bc 100644 --- a/ProductTour/CRViewController2.m +++ b/ProductTour/CRViewController2.m @@ -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]; diff --git a/ProductTour/ProductTour/CRBubble.h b/ProductTour/ProductTour/CRBubble.h index a414cbd..f4279c3 100644 --- a/ProductTour/ProductTour/CRBubble.h +++ b/ProductTour/ProductTour/CRBubble.h @@ -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 diff --git a/ProductTour/ProductTour/CRBubble.m b/ProductTour/ProductTour/CRBubble.m index d13b3f6..49a9660 100644 --- a/ProductTour/ProductTour/CRBubble.m +++ b/ProductTour/ProductTour/CRBubble.m @@ -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; @@ -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]; @@ -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]; diff --git a/README.md b/README.md index 794faf5..f029ec9 100644 --- a/README.md +++ b/README.md @@ -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];