Created
June 29, 2018 13:55
-
-
Save regularberry/ee1ed860a3b82e2eff107c72158ca7c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let structBuilder = StructSpec.builder(for: "TestStruct") | |
let fieldBuilder = FieldSpec.builder(for: "myField", type: .StringType, construct: nil) | |
structBuilder.add(field: fieldBuilder.build()) | |
let poet = PoetFile(list: [structBuilder.build()], generatorInfo: nil) | |
print(poet.fileContents) | |
/// OUTPUT | |
----------- | |
// | |
// TestStruct.swift | |
// | |
// Contains: | |
// struct TestStruct | |
// | |
// Generated by SwiftPoet on 6/29/18 | |
// | |
struct TestStruct { | |
let myField: String | |
/** | |
:param: myField | |
*/ | |
internal init(myField: String) { | |
self.myField = myField | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment