Skip to content

Commit

Permalink
Remove optionals... because Pring. (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbdavis authored and mickeyreiss committed Nov 13, 2018
1 parent d7589db commit 61b9d0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ This generated some Swift, some typescript and some go code. You'll find it in `

This is the standard firemodel workflow. Whenever you need to update your data model, you'll update the schema and regenerate the models.

## 3. Use the models
### 3. Use the models

The models are designed to be idiomatic for their target languages and the official Firestone SDKs.

Expand Down
6 changes: 3 additions & 3 deletions langs/ios/ios.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,19 @@ func toSwiftType(root bool, firetype firemodel.SchemaFieldType) string {
switch firetype := firetype.(type) {
case *firemodel.Boolean:
if root {
return "Bool?"
return "Bool = false"
} else {
return "Bool"
}
case *firemodel.Integer:
if root {
return "Int?"
return "Int = 0"
} else {
return "Int"
}
case *firemodel.Double:
if root {
return "Float?"
return "Float = 0"
} else {
return "Float"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extension TestEnum: CustomDebugStringConvertible {
// TODO: Add documentation to where in firemodel schema.
var where: String?
// TODO: Add documentation to how_much in firemodel schema.
var howMuch: Int?
var howMuch: Int = 0
// TODO: Add documentation to some_enum in firemodel schema.
var someEnum: TestEnum?

Expand Down Expand Up @@ -86,13 +86,13 @@ override class var path: String { return "test_models" }
// The name.
dynamic var name: String?
// The age.
dynamic var age: Int?
dynamic var age: Int = 0
// The number pi.
dynamic var pi: Float?
dynamic var pi: Float = 0
// The birth date.
dynamic var birthdate: Date?
// True if it is good.
dynamic var isGood: Bool?
dynamic var isGood: Bool = false
// TODO: Add documentation to data in firemodel schema.
dynamic var data: Data?
// TODO: Add documentation to friend in firemodel schema.
Expand Down

0 comments on commit 61b9d0f

Please sign in to comment.