title: Convert UIView to UIImage without first displaying the UIView?
body: <p>I am looking for a way to present two rows of text, each differently sized and colored, within each UITabBarItem of my app. For this reason, I am looking for a way to make easy custom TabBarItems whose text can be dynamically updated within the app. For example, one button could tell the user "Menu" up top and below tell the user how many "votes" she has left for the day (a number that will change during the session in response to user actions).</p>
  
  <p>I thought an obvious approach would be to make UITabBarItem custom images out of UIViews. I hoped this could be an easy and low-overhead way to include custom tab bar buttons with dynamic text content. But I haven't been able to find a method to convert a non-presented UIView into a UIImage. How can I do this?</p>
  
  <p>There are many posts on converting already presented UIViews to images listed below, but I haven't been able to find any on converting the view without presenting it:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/24307451/uiimage-from-uiview-if-uiview-is-outside-window-bounds">link</a></li>
  <li><a href="https://stackoverflow.com/questions/9177754/how-to-convert-uiview-to-uiimage-and-save-to-photo-gallery">link</a></li>
  <li><a href="https://stackoverflow.com/questions/9177754/how-to-convert-uiview-to-uiimage-and-save-to-photo-gallery">link</a></li>
  <li><a href="https://stackoverflow.com/questions/18229251/converting-uiview-to-uiimage-gives-poor-quality">link</a></li>
  <li><a href="https://stackoverflow.com/questions/5469351/how-to-convert-uiview-as-uiimage">link</a></li>
  <li><a href="https://stackoverflow.com/questions/22310433/uitabbaritem-image-created-in-code-doesn-t-appear">link</a></li>
  </ul>
  
  <p>If this is simply not possible, I would also appreciate any recommendations for easily (coding wise and computationally) generating custom buttons with dynamically generated text. Thank you for any suggestions! </p>