Skip to content

Instantly share code, notes, and snippets.

@cdl
Last active January 3, 2016 13:09
Show Gist options
  • Save cdl/8468023 to your computer and use it in GitHub Desktop.
Save cdl/8468023 to your computer and use it in GitHub Desktop.
answerLabel = [[UILabel alloc] initWithFrame:CGRectMake(35.0f, 132.0f, 260.0f, 54.0f)];
answerLabel.font = [UIFont fontWithName:@"AvenirNext-DemiBold" size:45.0f];
answerLabel.textAlignment = NSTextAlignmentRight;
answerLabel.numberOfLines = 1;
answerLabel.minimumScaleFactor = 8./answerLabel.font.labelFontSize;
answerLabel.text = @"BASKETBALL";
/*
* Failing on line 7 - error:
* Property 'labelFontSize' not found on object of type 'UIFont *'
*/
@LK
Copy link

LK commented Jan 17, 2014

labelFontSize is a class method, not an instance method. Here's the documentation: https://developer.apple.com/library/ios/documentation/uikit/reference/UIFont_Class/Reference/Reference.html#//apple_ref/occ/clm/UIFont/labelFontSize. Basically you'd just replace answerLabel.font.labelFontSize with [UIFont labelFontSize]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment