title: Building predicate (NSExpression) to determine icon color for Mapbox SymbolStyle layer
body: <p>I've recently started working with the Mapbox SDK on iOS and I've got some markers that I want to add to my map.  Each marker represents an object that has several properties, among them: a type property (which backs to an enum) and a boolean property.  I have a <code>MGLSymbolStyleLayer</code> defined and I've set most of the icon-related properties accordingly.  Currently, I'm  setting the icon color based solely on the "type" of the object like this:</p>
  
  <pre><code>let defaultColor = UIColor.blue
  layer.iconColor = NSExpression(format: "MGL_MATCH(type, 'type1', %@, 'type2', %@, 'type3', %@, %@)", UIColor.orange, UIColor.purple, UIColor.yellow, defaultColor)
  </code></pre>
  
  <p>This is working well but now I need to add an additional piece of logic in the <code>NSExpression</code> to check the boolean property on each object and if it's true, then set the icon color to red; else, determine the icon color for each object based on it's type (using the logic defined above).  So in a nutshell, I need an <code>NSExpression</code> that functions like this:</p>
  
  <pre><code>if feature.booleanProperty == true {
     // set icon color to red
  } else {
     // set icon color based on the feature type
  }
  </code></pre>
  
  <p>I've looked through the Mapbox <a href="https://www.mapbox.com/ios-sdk/api/4.6.0/predicates-and-expressions.html" rel="nofollow noreferrer">Predicates and Expressions Reference</a> doc but it's still not clear to me how I would implement this sort of conditional logic in an <code>NSExpression</code>.  Can anyone tell me if this is possible to do and if so, how?</p>