Skip to content

Instantly share code, notes, and snippets.

@prafullakumar
Created May 17, 2020 16:50
Show Gist options
  • Save prafullakumar/35727a7797b9a660256d50eb029e0fe8 to your computer and use it in GitHub Desktop.
Save prafullakumar/35727a7797b9a660256d50eb029e0fe8 to your computer and use it in GitHub Desktop.
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