Skip to content

Instantly share code, notes, and snippets.

View ceeK's full-sized avatar

Chris Howell ceeK

View GitHub Profile
@ceeK
ceeK / AutoBuildable.stencil
Last active March 8, 2018 18:10
AutoBuildable stencil
{#
AutoBuildable let's you create builders for your types. By conforming to AutoBuildable and running sourcery, you get the ability to build your object:
let car = CarBuilder()
.set(wheels: 4)
.set(doors: 5)
.make()
#}// swiftlint:disable file_length, redundant_optional_initialization
{% for type in types.implementing.AutoBuildable|!enum %}
public final class {{type.name}}Builder {