HelveticaNeue-Bold is the identifier. Here is a snippet of code you can use to list all the available fonts: NSArray *familyNames = [[NSArray alloc]initWithArray:[UIFont familyNames]]; for (NSString *familyName in familyNames) { NSLog(@"%@", familyName); NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName]; for (NSString *fontName in fontNames) { NSLog(@"\t%@", fontName); } } ...

UIFont.fontNamesForFamilyName(familyNames.objectAtIndex(indFamily)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ objectAtIndex, being a Objective-C method that returns id, returns a AnyObject instance in Swift, not a String. You could "cast" that to String. fontNames = NSArray(array: UIFont.fontNamesForFamilyName( familyNames.objectAtIndex(indFamily) as String)) This is how a version with more Swift and less Objective-C would look like: class func listAllFontsOnSystem2(){ let...

The slight difference is probably due to some fractional offset of the text itself. The pixels in the two characters look very close to the same, but with different amounts of grey or black. Try placing your Helvetica Neue Ultra Light text 0.5 pixels left or right and 0.5 up...

A label adds a little margin round the outside of the text, and you have not allowed for that. If, instead, you use a custom UIView exactly the size of the string rect, you will see that the text fits perfectly: Here's the code I used. In the view controller:...

Initially, I counted 4 open brackets and 3 close brackets, which will cause an error. Additionally, fontWithDescriptor: should be fontWithDescriptor:size:, which is probably the expected expression. Finally, using fontWithDescriptor:size: to define a font, then asking for its descriptor is redundant, so a cleaner version of the command is this: UIFontDescriptor...

In the documentation: fontSize The size (in points) to which the font is scaled. This value must be greater than 0.0. You are trying to implement behaviour which is not supported. An 'incorrect' result is to be expected....

I have decided to simply create a dummy label, set it's text property and set numberOfLines to 0 and say [label sizeToFit] that will allow you to get the frame of the label, which includes the height. It's not an ideal way, but it works. Apparently in iOS 8 there...

So basically you want to calculate height of text when you know text width. CGRect rect = [str boundingRectWithSize:CGSizeMake(cellWidth, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin context:nil]; Use resulting rect.size the way you want....

Since you're adding your own personal functionality to a Type, I think you should use an extension, declare this extension outside of your class: extension UIFont { // You can set a default value for the size if the user doesn't provide one. class func defaultFont(size: CGFloat = 12) ->...

I'm assuming that you have verified the font is loaded and set onto the label. If not you need to log all of the fonts loaded in the system, check it's there and find the correct font name to pass to UIFont. You need to set the label text to...

Usually it's done by defining behavior for each specific device. You can find out the device type in runtime: https://gist.github.com/Jaybles/1323251 Example code: UIDeviceHardware *h=[[UIDeviceHardware alloc] init]; if ( [h platformString] isEqualToString:@"iPhone4"] ) { // don't use blur } As for which devices support blur, you can use code from here:...

You can do it like. textView.font = UIFont(name: textView.font.fontName, size: 18) Here the font should be as same you defined but you can change the size as you want. If you want to fix the size then and change the name of font then you can use textView.font.pointSize...

museoSansRounded900 should be a class method as you're trying to call it directly on the UIFont class (which makes it basically a constructor). class func museoSansRounded900(size: CGFloat) -> UIFont ... ...