UITextView bug in iOS 7.0

Just stumbled upon an amusing bug in iOS 7. UITextView refused to change font size and color in Storyboard and xib files. Those storyboards were converted from iOS 5 format long time ago and so far I have not had any incompatibility issues until now. Whatever I was trying, UITextView controls did not want to change the font!

After hours of random experiments and googling I’ve found a workaround. Change font and color programmatically, but… you have to make UITextView editable first. You’ve heard that right. So code should look like this:

textView.editable = YES;
textView.font = [UIFont fontWithName:@"Arial" size:24];
textView.editable = NO;

P.S. Thanks Apple for all wasted hours!

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.