Created
May 17, 2020 16:50
-
-
Save prafullakumar/35727a7797b9a660256d50eb029e0fe8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import SwiftUI | |
struct ContentView: View { | |
private static let formatter: DateFormatter = { | |
let formatter = DateFormatter() | |
formatter.dateStyle = .short | |
formatter.timeStyle = .short | |
return formatter | |
}() | |
let likes: UInt = 10 | |
let publishedAt = Date() | |
let author = "Jhon Doe" | |
var body: some View { | |
VStack(alignment: .leading, spacing: 8) { | |
HStack { | |
Text("\(publishedAt, formatter: Self.formatter)") | |
.foregroundColor(.secondary) | |
.font(.caption) | |
Spacer() | |
Text("Author_Name \(self.author)") | |
.foregroundColor(.secondary) | |
.font(.caption).onTapGesture { | |
} | |
} | |
Text("Quotes") | |
.font(.headline) | |
Text("Content") | |
.font(.body) | |
Text("\(likes) Like(s)") | |
.font(.subheadline) | |
}.frame(idealHeight: .greatestFiniteMagnitude) | |
.padding() | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment