marcisme / sketch-preview

Sketch plugin to preview mockups in Skala Preview
MIT License
611 stars 37 forks source link

Update for Sketch 3 #8

Closed TomasLinhart closed 10 years ago

TomasLinhart commented 10 years ago

Bohemian Coding removed allSlices and slices methods in Sketch 3 so the plugin was not working anymore. Unfortunately this change is not documented in their documentation.

Using class-dump I have discovered something called exportableLayers that includes slices and all layers that were made exportable.

I used this property and changed code occurences of slices to exportable layers. Because name slice is not relevant anymore.

I also added myself to contributors. I hope you don't mind.

Grawl commented 10 years ago

Agree: worked for me.

davidklaw commented 10 years ago

:+1: Nice job @TomasLinhart

marcisme commented 10 years ago

Thanks for the contribution.

Does the currently selected artboard preview, without a specially named layer, work in Sketch 3?

I'm away from my laptop until Tuesday, so I can't test myself.

Grawl commented 10 years ago

Yes, I just select artboard and press hotkey and viola! Skala gets an image.

marcisme commented 10 years ago

@TomasLinhart I took a slightly different approach, as I wanted to preserve compatibility with Sketch 2. Thanks for the class-dump snooping and the PR. I've added you to the contributors section.

davidklaw commented 10 years ago

Nice work fellas.