Add default parameters for post title, body, and creation date

This commit is contained in:
Angelo Stavrow 2020-07-28 11:19:18 -04:00
parent 7f920e54dc
commit ca52aa9cef
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ struct ContentView: View {
.toolbar { .toolbar {
NavigationLink( NavigationLink(
destination: PostEditor( destination: PostEditor(
post: Post(title: "Title", body: "Write your post here...", createdDate: Date()) post: Post()
) )
) { ) {
Image(systemName: "plus") Image(systemName: "plus")

View File

@ -3,9 +3,9 @@ import WriteFreely
struct Post: Identifiable { struct Post: Identifiable {
var id = UUID() var id = UUID()
var title: String var title: String = "Title"
var body: String var body: String = "Write your post here..."
var createdDate: Date var createdDate: Date = Date()
var status: PostStatus = .draft var status: PostStatus = .draft
} }