title: Swift - Type '(String, JSON)' cannot conform to 'StringProtocol'; only struct/enum/class types can conform to protocols
body: <p>I'm using <strong>SwiftyJSON</strong>. Ultimately I want to see if the <code>&quot;date&quot;</code> value equals the value of <code>selectedDate</code> and if so, print the <code>&quot;event&quot;</code> value.</p>
  <p>But I haven't even got that far yet. I'm getting an error on my <code>if</code> statement.</p>
  <p>The error I'm receiving says <code>Type '(String, JSON)' cannot conform to 'StringProtocol'; only struct/enum/class types can conform to protocols</code>.</p>
  <p>data.json</p>
  <pre><code>[
   {
        &quot;date&quot;: &quot;01.01&quot;,
        &quot;event&quot;: &quot;Mom birthday&quot;,
       
    },
  ]
  </code></pre>
  <p>ViewController.swift</p>
  <pre><code>var json:JSON = false    
  var selectedDate:String = &quot;01.01&quot;
  
  func updateView() {
      
      json.forEach { (key, data) in
          if key == &quot;date&quot;, data.stringValue == selectedDate {
              print(&quot;found it!&quot;)
          } else {
              print(&quot;no matches&quot;)
          }
      }
      
  }
  </code></pre>
  <p>override func viewDidLoad() {
  super.viewDidLoad()</p>
  <pre><code>    // Get JSON data
      if let path = Bundle.main.path(forResource: &quot;Devotions&quot;, ofType: &quot;json&quot;) {
          do {
              let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .alwaysMapped)
              json = try JSON(data: data)
          } catch let error {
              print(&quot;parse error: \(error.localizedDescription)&quot;)
          }
      } else {
          print(&quot;Invalid filename/path.&quot;)
      }
      
      updateView()
      
  }
  </code></pre>