All Projects â†’ freshOS â†’ Sketchtoswift

freshOS / Sketchtoswift

Licence: mit
📲 Generate Swift from Sketch

Programming Languages

javascript
184084 projects - #8 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Sketchtoswift

open design system
Open Source Design System using Sketch. It's early days of my project.
Stars: ✭ 22 (-91.24%)
Mutual labels:  sketch, uikit
Macos Ui Kit
💎 The most detailed and accurate macOS UI Kit for Sketch. This Sketch Library includes common Mac interface elements, cursors, and a Touch Bar UI Kit.
Stars: ✭ 551 (+119.52%)
Mutual labels:  uikit, sketch
SketchGen
A Swift command line tool for generating source code from sketch files
Stars: ✭ 27 (-89.24%)
Mutual labels:  code-generator, sketch
Tailwindcss Sketch Kit
💎 Sketch UI kit for Tailwind CSS
Stars: ✭ 68 (-72.91%)
Mutual labels:  uikit, sketch
Movie Trailers SwiftUI
A simple app which shows the lastest movies trailers based on different genres developed using SwiftUI.
Stars: ✭ 51 (-79.68%)
Mutual labels:  integration, uikit
Weui Sketch
weui sketch by ZTfer
Stars: ✭ 116 (-53.78%)
Mutual labels:  uikit, sketch
Miaow
A set of plugins for Sketch include drawing links & marks, UI Kit & Color sync, font & text replacing.
Stars: ✭ 2,536 (+910.36%)
Mutual labels:  sketch
Laracrud
Laravel Code Generator based on MySQL Database
Stars: ✭ 238 (-5.18%)
Mutual labels:  code-generator
Kyaml2go
K8s Go client code generator from Kubernetes resource yamls
Stars: ✭ 226 (-9.96%)
Mutual labels:  code-generator
Swift Essentials
A set of essential Swift stuff I use in every single iOS app.
Stars: ✭ 223 (-11.16%)
Mutual labels:  uikit
Weui Design
Design package for WeUI
Stars: ✭ 2,758 (+998.8%)
Mutual labels:  sketch
Api Generator
PHP-code generator for Laravel framework, with complete support of JSON-API data format
Stars: ✭ 244 (-2.79%)
Mutual labels:  code-generator
Sketch Feather
Sketch library for Feather icons
Stars: ✭ 237 (-5.58%)
Mutual labels:  sketch
Multigraph transformer
transformer, multi-graph transformer, graph, graph classification, sketch recognition, sketch classification, free-hand sketch, official code of the paper "Multi-Graph Transformer for Free-Hand Sketch Recognition"
Stars: ✭ 231 (-7.97%)
Mutual labels:  sketch
Sketchsheets
Free ready to print sketch sheet templates for UX designers
Stars: ✭ 241 (-3.98%)
Mutual labels:  sketch
Uicollectionviewsplitlayout
UICollectionViewSplitLayout makes collection view more responsive.
Stars: ✭ 226 (-9.96%)
Mutual labels:  uikit
Dropdownmenukit
UIKit drop down menu, simple yet flexible and written in Swift
Stars: ✭ 246 (-1.99%)
Mutual labels:  uikit
Miscord
Facebook Messenger to Discord bridge
Stars: ✭ 225 (-10.36%)
Mutual labels:  integration
Accessibilitysnapshot
Easy regression testing for iOS accessibility
Stars: ✭ 236 (-5.98%)
Mutual labels:  uikit
Squaremosaiclayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations 🔶
Stars: ✭ 243 (-3.19%)
Mutual labels:  uikit

SketchToSwift

Demo

Language: Javascript License: MIT Release version

Why

Because integrating views form Sketch has no added value, its just back and forth translating sketch values to swift code. There must be a way to automate this time costly and low added value labor.

How

By generating the swift UIKit code from a Sketch Artboard. We can save hours of time \o/

What

A Sketch plugin with a simple shortcut that generates basic Swift code form wich you can kickstart developing your view.

About

This is a proof of concept that we can generate UIVIew swift code from Sketch Artboards. Be aware that this is very early in development.

Yes this will never be perfect (huh wait for AI!), because we all have our coding styles etc. But this is not the goal anyway, the goal is to kickstart view dev and save 80% of integration time. Then you are free to change the code as you like :)

Usage

  • Install (double click) plugin
  • Select Artboard
  • cmd + alt + K for UIKit code
  • cmd + alt + L for Stevia code
  • Paste swift Uikit UIView subclass in Xcode \o/

Get the best out of it

Here are some rules you can follow to get the best export possible :

  • Name your Artboard proprely: For instance an Artboard named "Profile" will generate class ProfileView: UIView
  • Resize Artboard for your iPhone size (ex: we usually use 375Width for iPhone 7) By resizing the artboard with the scale tool, you'll make sure the script will generate the good font sizes etc.
  • Name your sketch layers right in order to get sexy variable names
  • After the scale, you probably have float margins and font size. Making sure these are clean ext 16p instead of 16,01543 will generate cleaner code :)
  • The same Applies to margins and sizes in general
  • Flatten the view hierarchy, extract the items inside groups and bring them to the top level.
  • Order them (usually from the to to the bottom), the generated code will keep the view hierarchy order.

Improvements

Fonts

  • Find a way to export fonts ?

Text

  • Detect Text in style caps -> apply uppercased
  • Detect character spacing in fonts -> AttributedString
  • Detech line spacing -> AttributedString
  • Detect Multiline (contains \n) -> Append \n and set label to mutiline
  • Detect text alignment all cases
  • Multicolor -> Generate AttributedString

Colors

  • UIColors replace by custom ones?
  • UIColors oftenThe same refactor in one variable

Radius

  • Detect UIButton corner Radius

Borders

  • Button border color
  • Button border radius

Sketch Groups

  • groups -> greate UIViewSubclasses?
  • UIButton set title belongs in content section

layout

  • Detect fillscontainer and do not use width and height but right and bottom laike a human would do
  • Implement relative layout, like more visually to the right -> align on right rather tahn left , more natural

Export

  • Handle single Element Export

UITableViewCell

  • Artboard name Suffixed by Cell -> UITableViewCell subclass

Images

  • Find a wa to detect images and create UIImageView instead

Groups

  • Think about how to handle them proprely

Known issues

This plugin only supports Sketch v41 and higher at the moment.

Issues

Have a layout that breaks the plugin? Send it to [email protected] for review + open Issue

Author

Sacha Durand Saint Omer, [email protected]

Contributing

Contributions to SketchToSwift are very welcomed and encouraged! Feel free to try and tackle one of the Improvements above

License

SketchToSwift is available under the MIT license. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].