Beta 98 - changes to MSSymbolInstance

Hello,

We have a Sketch plugin the exports the data from a Sketch file. We have noticed that one of the changes in beta 98 is what can be accessed on MSSymbolInstance. Can you share any more details on that?

The issue I am seeing is that I can no longer get the ‘influencingSymbolIDs’ from a layer. This means I am not able to work out what symbols are nested in a layer (artboard/master symbol)

If there a more updated way to get the symbols that are nested on a artboard/master symbol?

Thanks

There’s one approach I’ve been using recently: the idea is to use the API Sketch itself relies on when copying & pasting layers between documents – which automatically collects and brings all of their dependencies (including nested symbols) to a new document.

let layer = ... // any MSLayer instance, including an artboard

let pb = [MSPasteboardLayers pasteboardLayersWithLayers:[selected]]
let allReferencedSymbolIDs;
{
  let local = pb.localSymbols().allKeys()
  let foreign = pb.foreignSymbols().allKeys()
  allReferencedSymbolIDs = [local arrayByAddingObjectsFromArray:foreign]
}
2 Likes

Looks like that has done the trick! Thanks for the speedy and helpful response!

2 Likes