From ca52aa9cef4c9479b97b39498770fc7c0b28f076 Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Tue, 28 Jul 2020 11:19:18 -0400 Subject: [PATCH] Add default parameters for post title, body, and creation date --- Shared/Navigation/ContentView.swift | 2 +- Shared/Post/Post.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index ec5b8f4..ae9fb98 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -11,7 +11,7 @@ struct ContentView: View { .toolbar { NavigationLink( destination: PostEditor( - post: Post(title: "Title", body: "Write your post here...", createdDate: Date()) + post: Post() ) ) { Image(systemName: "plus") diff --git a/Shared/Post/Post.swift b/Shared/Post/Post.swift index 52a5e20..53dc52c 100644 --- a/Shared/Post/Post.swift +++ b/Shared/Post/Post.swift @@ -3,9 +3,9 @@ import WriteFreely struct Post: Identifiable { var id = UUID() - var title: String - var body: String - var createdDate: Date + var title: String = "Title" + var body: String = "Write your post here..." + var createdDate: Date = Date() var status: PostStatus = .draft }