TSMessages
TSMessages copied to clipboard
modifying font in Swift
this does not translate to Swift:
#import <TSMessages/TSMessageView.h>
@implementation TSAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//If you want you can overidde some properties using UIAppearance
[[TSMessageView appearance] setTitleFont:[UIFont boldSystemFontOfSize:6]];
[[TSMessageView appearance] setContentFont:[UIFont boldSystemFontOfSize:10]];
return YES;
}
couldn't set notification font in Swift. Any advice?
Hi @idokleinman . I also wanted to translate the implementation to Swift.
I took a look to the Objective-c code and I found out this:
NSString *fontName = [current valueForKey:@"titleFontName"];
if (fontName != nil) {
[self.titleLabel setFont:[UIFont fontWithName:fontName size:fontSize]];
} else {
[self.titleLabel setFont:[UIFont boldSystemFontOfSize:fontSize]];
}
So I just added the parameter titleFontName to the TSMessagesDefaultDesign file and it worked for me. The name for the Subtitle text font is contentFontName

It works just like the other parameters do.