Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F13819725
PostCellView.swift
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
PostCellView.swift
View Options
import
SwiftUI
struct
PostCellView
:
View
{
@
ObservedObject
var
post
:
WFAPost
var
body
:
some
View
{
HStack
{
VStack
(
alignment
:
.
leading
)
{
Text
(
post
.
title
)
.
font
(.
headline
)
.
lineLimit
(
1
)
Text
(
buildDateString
(
from
:
post
.
createdDate
??
Date
()))
.
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 {
// let testPost = Post(
// title: "Test Post Title",
// body: "Here's some cool sample body text.",
// createdDate: Date()
// )
// return PostCellView(post: testPost)
// }
//}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Mon, Feb 16, 4:15 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3629227
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment