title: Getting an error: Type 'String' has no member 'foregroundColor' in Swift 4
body: <p>I am new to Swift. I created an app in Swift 4, but when I change the SWIFT_VERSION to Swift 3.0, I get an error in my code.</p>
  
  <blockquote>
    <p>Type 'String' has no member 'foregroundColor'.</p>
  </blockquote>
  
  <p>How can I convert this to current Swift syntax? </p>
  
  <p>Code:</p>
  
  <pre><code>    if let p = placeholder {
  
        let place = NSAttributedString(string: p, attributes: //error --&gt;[.foregroundColor: #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)])
  
  
          attributedPlaceholder = place
  
          textColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
  </code></pre>