-1

How do I set this to be uppercase?

- (void)drawSegmentedControl
{
    HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"First", @"Second", @"Third"]];
    segmentedControl.font = [UIFont fontWithName:@"Helvetica Neue" size:16];
}
jscs
  • 63,694
  • 13
  • 151
  • 195
Nick B
  • 9,267
  • 17
  • 64
  • 105
  • `HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"FIRST", @"SECOND", @"THIRD"]];`. Is that what you're wanting? I'm not quite sure I understand your question. – hgwhittle Jan 29 '15 at 20:01
  • You can just write the titles in upper case or call [@"First" uppercaseString]; and so on for other titles. – Abubakr Dar Jan 29 '15 at 20:04

1 Answers1

2
HMSegmentedControl *segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"FIRST", @"SECOND", @"THIRD"]];

The font will render the character you ask it to; you have to use an uppercase letter and not a lowercase one (they are different).

If the text isn't hardcoded, convert it with [NSString uppercaseString] before creating the control.

Your choice of font will decide how the individual glyphs are rendered to the screen (are they bold, italic; comic sans or courier etc). But you can't apply CSS-style styling to render them uppercase (much as you can't do that by formation the font using a word processor's font tool.

You simply need to uppercase the string you are passing in.

davbryn
  • 7,156
  • 2
  • 24
  • 47