abynim / sketch-headers Goto Github PK
View Code? Open in Web Editor NEWHeaders from Sketch app exported using class-dump
Headers from Sketch app exported using class-dump
Hi, what is the correct way to use the headers from an Xcode framework project? There always seem to be missing headers. Could you please elaborate on how to use this? Many thanks
I need to get headers for the Chocolat framework. Would be nice to have all the frameworks added to this repo!
In the 53 beta, there's a SketchModel framework in which class-dump finds MS* classes, but that framework doesn't exist in 52.X, and none of the other frameworks appear to contain MS*, either.
Would be great if you could include your invocation in the readme!
Hello @abynim ,
I develop a sketch plugin for my company, to help our UX team. Now with the sketch version 52, the plugin is broken because we use old headers.
Thanks for the headers update ๐we can fix our plugin with it.
We want to anticipate this on the next release, to prevent down time on the plugin ๐ช
How to do you manage to get the headers before the release ? Is there a dev newsletter ?
thank you for your answer ;)
cannot find function usedSymbolsInContainer_document in MSPasteboardLayersReaderWriter at sketch v88.1
when i run "class-dump -H sketchtool -o /output" , show error "This file does not contain any Objective-C runtime information." . please help me
when i import a library sketch file, the symbolMaster.createSymbolInstance API not work:
const document = context.document;
const symbolReferences = library.getImportableSymbolReferencesForDocument(document);
symbolReferences. forEach(ref => {
const symbolMaster = ref.import();
const instance = symbolMaster.createNewInstance();
})
this is work before sketch 67
When you open Headers
directory on GitHub, it doesn't show all files, warning message appears:
Sorry, we had to truncate this directory to 1,000 files. 482 entries were omitted from the list.
Of course, you can clone this repo. But very handy to use it through the web.
My suggestion is to divide it to sub directories. I see that every file has own prefix AF
, BC
, MF
and so on, maybe classify them by prefix.
Hello @abynim ๐, I build a plugin where I use textBehaviourLabelString
declared in MSTextLayer-UISupport.h
for getting textBehaviour name like 'Auto' / 'Fixed' or 'Auto Height'.
In the version 61 sketch use verticalAlignement / textAlignment for storing this information and now this data is store as int. Is there a new function or a new way to get the string according this number ?
Thank you for your help
would love to see a diff as a PR during the beta phase
hi, I need to monitor keyboard event and mouse event in my sketch plugin. And I find "MSNormalEventHandler" has a function: "- (void)trackMouse:(id)arg1;". I think the parameter "(id)arg1" may be a function in JS, so my code is:
document._object.eventHandlerManager().normalHandler().trackMouse(
function(event){
log("get an event = "+event);
});
But, I get the error : "-[MOJavaScriptObject trackingState]: unrecognized selector sent to instance 0x60000bf829a0".
Would please tell me how solve this problem? Thank you very much.
Hi,
Does anyone knows what they changed in exporting artboards in update 44?
I wrote a plugin to export artboards, but with the update the exported artboards are "empty".
I do see the PNG exported to the correct path (and everything is correct; the size, name, format etc.) but the PNG is "empty" (see screenshot)
The snippet I'm using to export the file is:
doc = context.document
var path // <-- assume this is a valid file URL
var layer // <-- assume this is a valid MSArtboardGroup
if (!layer.isLayerExportable()) {
print([NSString stringWithFormat:"The layer [%@] is not exportable!", layer.name()])
return
}
var requests = NSMutableArray.array()
for (var i = 0; i < layer.exportOptions().exportFormats().length; i++) {
var format = layer.exportOptions().exportFormats()[i]
var request = [MSExportRequest exportRequestFromExportFormat:format layer:layer inRect:layer.absoluteInfluenceRect() useIDForName:true]
request.name = (format.name()) ? format.name() : request.name()
requests.addObject(request)
}
// Loop all requests and export each of them
for(var k = 0; k < requests.length; k++) {
var request = requests[k]
exportName = request.name()
exportPath = [path stringByAppendingPathComponent:exportName]
exportPath = [exportPath stringByAppendingPathExtension:request.format()]
[doc saveArtboardOrSlice:request toFile:exportPath]
var msg = [NSString stringWithFormat:"Saved: %@ to %@", exportName, exportPath]
log(msg)
}
Before the snippet worked perfectly, but right now I do see the message that the file is saved/exported but encounter the problems I stated before.
Does anyone knows what must be changed to export correctly?
Every version of headers need it's own git tag
As of 2ed60ad, all the header filenames have changed (seems like each class has been split into sections) and it seems like some methods are missing. Not sure if this is working as intended?
how to use function setSymbols or setLocalSymbols in MSPasteboardLayers at sketch v88.1
Beta 56 is out and I am trying to export the headers. I am running class-dump -r SketchModel.framework
and receiving only errors. What command could I run to export those files?
PS: At the time of writing this the beta branch has not been updated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.