plugin/
: Contains the sketch plugin
app/
: Contains the code for the core app
assets/
: Contains assets for running tests
- Run
npm install
in thepixelcode-skpm
directory. - Make a
globals.js
file in thepixelcode-skpm/src/
directory (look atglobals.js.template
). - Make a
routes.js
file in thepixelcode-skpm/plugin.sketchplugin/Contents/Resources
directory (look atroutes.js.template
). - Run
sh update.sh
in thepixelcode-skpm
directory
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
Podfile
and 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 install
in 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
.otf
file into XCode. - Click on the
.otf
file 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
.otf
file 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
.otf
file (with the ".otf" at the end) as the value of "Item 0" - Done!