diff --git a/KILabel/Source/KILabel.m b/KILabel/Source/KILabel.m index 37dbbff..e1f0801 100644 --- a/KILabel/Source/KILabel.m +++ b/KILabel/Source/KILabel.m @@ -353,11 +353,17 @@ - (NSDictionary *)attributesFromProperties paragraph.alignment = self.textAlignment; // Create the dictionary - NSDictionary *attributes = @{NSFontAttributeName : self.font, - NSForegroundColorAttributeName : color, - NSShadowAttributeName : shadow, - NSParagraphStyleAttributeName : paragraph, - }; + NSMutableDictionary *attributes = @{ + NSFontAttributeName : self.font, + NSShadowAttributeName : shadow, + NSParagraphStyleAttributeName : paragraph, + }.mutableCopy; + + if (color) + { + attributes[NSForegroundColorAttributeName] = color; + } + return attributes; } @@ -681,10 +687,6 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event [self receivedActionForLinkType:linkType string:touchedSubstring range:range]; } - else - { - [super touchesBegan:touches withEvent:event]; - } self.selectedRange = NSMakeRange(0, 0); } diff --git a/KILabelDemo/KILabelDemo/Base.lproj/Main.storyboard b/KILabelDemo/KILabelDemo/Base.lproj/Main.storyboard index 1279791..0027379 100644 --- a/KILabelDemo/KILabelDemo/Base.lproj/Main.storyboard +++ b/KILabelDemo/KILabelDemo/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -18,6 +19,7 @@ + @@ -128,23 +140,28 @@ - + + - + + + + @@ -152,6 +169,7 @@ + @@ -177,6 +195,7 @@ + @@ -189,9 +208,4 @@ - - - - - diff --git a/KILabelDemo/KILabelDemo/KILabelTableViewController.m b/KILabelDemo/KILabelDemo/KILabelTableViewController.m index 27417bf..70228b9 100644 --- a/KILabelDemo/KILabelDemo/KILabelTableViewController.m +++ b/KILabelDemo/KILabelDemo/KILabelTableViewController.m @@ -94,6 +94,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N return cell; } +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSLog(@"Selected row indexPath: %@", indexPath); +} + /** * Called when a link is tapped. *