I'm trying to change the font for my uitableviewcells,
I'm trying to use this at the moment with not success:
cell.textLabel.font = [UIFont .preferredFontForTextStyle("Avenir")];
Now i've read a lot on this and it seems I should use this instead :
cell.textLabel.font = [UIFont fontWithName: "Avenir" size:22];
Problem is fontWithName does not seem to exist in iOS 8
any ideas??
thanks
The thing is that this is not Swift (it is a kind of horrifying bastardization of Objective-C):
cell.textLabel.font = [UIFont fontWithName: "Avenir" size:22];
This would be Swift:
cell.textLabel.font = UIFont(name:"Avenir", size:22)
Try the following casting way:
cell.textLabel.font = UIFont(name: "Avenir", size:22);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With