title: Convert C to Swift: Add magnifying glass icon to UITextField
body: <p>How can I add a magnifying glass icon to the left of a <code>UITextField</code>?</p>
  
  <p>I found an answer to a similar question <a href="https://stackoverflow.com/questions/11811705/where-can-i-get-the-magnifying-glass-icon-used-in-uisearchbar">here</a> but I'm having trouble converting it to swift.</p>
  
  <p>The answer:</p>
  
  <blockquote>
    <p>So, here's the code with the unicode character:</p>
  
  <pre><code>UILabel *magnifyingGlass = [[UILabel alloc] init];
  [magnifyingGlass setText:[[NSString alloc] initWithUTF8String:"\xF0\x9F\x94\x8D"]];
  [magnifyingGlass sizeToFit];
  
  [textField setLeftView:magnifyingGlass];
  [textField setLeftViewMode:UITextFieldViewModeAlways];
  </code></pre>
    
    <p>Edit: For plain look that fits iOS 7 style, add Unicode variation selector \U000025B6.</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>let searchIconView = UILabel()
  // Doesn't work: searchIconView.text = NSString.init(UTF8String: "\xF0\x9F\x94\x8D")
  searchIconView.sizeToFit()
  searchTextField.leftView = searchIconView
  searchTextField.leftViewMode = .Always
  </code></pre>