Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13799313
PostCellView.swift
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
929 B
Subscribers
None
PostCellView.swift
View Options
import
SwiftUI
struct
PostCellView
:
View
{
@
EnvironmentObject
var
postStore
:
PostStore
@
ObservedObject
var
post
:
Post
var
body
:
some
View
{
HStack
{
VStack
(
alignment
:
.
leading
)
{
Text
(
post
.
title
)
.
font
(.
headline
)
.
lineLimit
(
1
)
Text
(
buildDateString
(
from
:
post
.
createdDate
))
.
font
(.
caption
)
.
lineLimit
(
1
)
}
Spacer
()
PostStatusBadgeView
(
post
:
post
)
}
.
padding
(
5
)
}
func
buildDateString
(
from
date
:
Date
)
->
String
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateStyle
=
.
long
dateFormatter
.
timeStyle
=
.
short
return
dateFormatter
.
string
(
from
:
date
)
}
}
struct
PostCell_Previews
:
PreviewProvider
{
static
var
previews
:
some
View
{
PostCellView
(
post
:
testPost
)
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Fri, Feb 6, 10:36 AM (14 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3619909
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment