title: Font Descriptors and Symbolic Traits
body: <pre><code>UIFontDescriptor *bodyFontDescriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody];
  UIFontDescriptor *italicBoldDescriptor = [bodyFontDescriptor fontDescriptorByAddingAttributes:@{UIFontDescriptorTraitsAttribute : @{ UIFontSymbolicTrait: @(UIFontDescriptorTraitItalic | UIFontDescriptorTraitBold)}}];
  UIFont *comboFont = [UIFont fontWithDescriptor:italicBoldDescriptor size:0.0];
  [self.body.textStorage addAttribute:NSFontAttributeName value:comboFont range:self.body.selectedRange];
  </code></pre>
  
  <p>My goal was to bold/italic selected text in a text view. After doing a bit of research, this is what I have and it works! However, I really do not understand the code, especially the second line. If someone could explain exactly what this code is doing I would greatly appreciate it. Also I do not understand the dictionary syntax that is happening in the second line. What is the syntax with the '|' character? I have never seen that before. Thank you very much for your time.</p>