Code Generator

LayoutCode supports code generation for iOS Swift. To show Code Generation window, click Code Generator button at Toolbar at top right of the app.

Code Generator window

Code generator supports generate multiple files generation.Under the hood, artboards data from workspace are processed by code generator to produce readable and manageable code. The generated code then can be used or modified by a developer depend on their needs. Here are explanation of file category on the left Code Generator window.

  1. Artboards: Generate code for all artboards at Main tab. Each artboard generate a UIViewController file
  2. ShapeView: A fixed file that act as container for CAShapelayer to support layout constraint.
  3. Collection Cell: Generate code for all collection view cells. Each cell generate a file.
  4. Collection Datasource: Generate code in a single file that hold data for collection view datasource.
  5. Custom View: Generate code for all custom views. Each custom view a generate a single file, which the filename is set by the user.
  6. UIView+Gradient: An fixed file, that improve gradient support for basic view (UIView) and custom view.