plugin/: Contains the sketch plugin
app/: Contains the code for the core app
assets/: Contains assets for running tests
- Run
npm installin thepixelcode-skpmdirectory. - Make a
globals.jsfile in thepixelcode-skpm/src/directory (look atglobals.js.template). - Make a
routes.jsfile in thepixelcode-skpm/plugin.sketchplugin/Contents/Resourcesdirectory (look atroutes.js.template). - Run
sh update.shin thepixelcode-skpmdirectory
To install the plugin, run update in the plugin/ directory.
Next, make sure that this repository is located in ~/Documents/pixelcode/.
Install fswatch and xargs (information on installation can be found online).
cd app/
chmod +x run.sh
sh run.sh
Any artboards exported using the plugin should have .svg files created in app/exports, and their xcode files generated with an .swift extension.
We use SnapKit to implement concise AutoLayout code. To setup SnapKit:
- Go to project directory and run
pod init. - Go into the generated
Podfileand paste:
# Uncomment the next line to define a global platform for your project
# platform :ios, '11.0'
target '`Your project name`' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for '`Your project name`'
pod 'SnapKit'
end
- Run
pod installin your project directory. - Done!
To import fonts into Xcode, you can follow the steps below or the ones detailed here.
- Download a font in OTF (OpenTypeFormat), i.e.
.otf - Drag
.otffile into XCode. - Click on the
.otffile in XCode and make sure that your app is checked under "Target Membership" (on the right hand side) - Go to "Build Phases" -> "Bundle Resources" and make sure you see your
.otffile listed. - Go to your Info.plist and add a new key called: "Fonts provided by application"
- Click the arrow right next to "Fonts provided by application" where you should then see "Item 0".
- Type the name of your
.otffile (with the ".otf" at the end) as the value of "Item 0" - Done!