cwRichardKim/RKNotificationHub

Cannot change the notification's font

r-shayestehpour opened this issue · 4 comments

I'm trying to change the font with the following line but the notification's font won't change.
(there is no problem with loading the font, I'm using it elsewhere in the app)
hub.countLabelFont = UIFont(name: "MyFont", size: 8)

So sorry for the late response. I tried with these two and it seems to work fine:

[hub setCountLabelFont:[UIFont fontWithName:@"Helvetica" size:10]];
hub.countLabelFont = [UIFont fontWithName:@"Times New Roman" size:15];

I can only assume that something is happening with the swift / objc communication. Can you try calling the setter directly?

Sorry, what do you mean by calling setter directly?
In my case (I'm using exact swift / objc) I can't set font size bigger then half circle size 'cause you cap it in line 209 for some reason with

[countLabel setFont:[UIFont fontWithName:font.fontName size:redCircle.frame.size.width/2]];
Unfortunately this size is too small for me.
This limitation seems a bit extra for me taking into account that you have default font size in setCircleAtFrame method.
Why wouldn't give users chance to set any size font outside the lib?
Something like this, just:

- (void)setCountLabelFont:(UIFont *)font
{
    [countLabel setFont:font];
}

PS. Great lib by the way thanks!

It was just a design choice. Someone complained about the text reaching outside of the bubble on large numbers. Setting the size based on the width ensured that regardless of the font and regardless of the number, the text will always be in the bubble

also, that code is only called when you use setCircleAtFrame. If you're calling that somewhere, make sure the font-size changing part is called after that and you should be able to control it however you like