You can use an initializer to set default property values:
struct Example {
var upvotes: Int
init() {
upvotes = 42
}
}
let myExample = Example() // call the initializer
print(myExample.upvotes) // prints: 42
Or, specify default property values as a part of the property...