function doesSymbolInstanceHaveTextLayers(symbolInstance) {
  if (!symbolInstance.symbolMaster()) {
    return true; // just in case
  }

  // TODO: cache true/false for a given master
  if (util.getAllLayersMatchingPredicate(
    symbolInstance.symbolMaster(),
    TEXT_LAYER_PREDICATE).length) {
    return true;
  }

  // check for symbol instance children that have text layers
  let symbolInstances = util.getAllLayersMatchingPredicate(
      symbolInstance.symbolMaster(),
      NSPredicate.predicateWithFormat('className == %@', 'MSSymbolInstance'));
  for (let symbolInstance of symbolInstances) {
    if (doesSymbolInstanceHaveTextLayers(symbolInstance)) {
      return true;
    }
  }

  return false;
}
/**
 * Returns true if the given MSSymbolInstance contains text layers
 */
Returns true if the given MSSymbolInstance contains text layers
Returns true if the given MSSymbolInstance contains text layers
function doesSymbolInstanceHaveTextLayers(symbolInstance) {
  if (!symbolInstance.symbolMaster()) {
    return true; 
  }
  if (util.getAllLayersMatchingPredicate(
    symbolInstance.symbolMaster(),
    TEXT_LAYER_PREDICATE).length) {
    return true;
  }
  let symbolInstances = util.getAllLayersMatchingPredicate(
      symbolInstance.symbolMaster(),
      NSPredicate.predicateWithFormat('className == %@', 'MSSymbolInstance'));
  for (let symbolInstance of symbolInstances) {
    if (doesSymbolInstanceHaveTextLayers(symbolInstance)) {
      return true;
    }
  }
  return false;
}
function doesSymbolInstanceHaveTextLayers ( symbolInstance ) { if ( ! symbolInstance . symbolMaster ( ) ) { return true ; } if ( util . getAllLayersMatchingPredicate ( symbolInstance . symbolMaster ( ) , TEXT_LAYER_PREDICATE ) . length ) { return true ; } let symbolInstances = util . getAllLayersMatchingPredicate ( symbolInstance . symbolMaster ( ) , NSPredicate . predicateWithFormat ( 'className == %@' , 'MSSymbolInstance' ) ) ; for ( let symbolInstance of symbolInstances ) { if ( doesSymbolInstanceHaveTextLayers ( symbolInstance ) ) { return true ; } } return false ; }
Returns true if the given MSSymbolInstance contains text layers
Returns true if the given MSSymbolInstance contains text layers
// just in case // TODO: cache true/false for a given master // check for symbol instance children that have text layers