Post
public class Post : Codable, Identifiable, @unchecked Sendable
extension Post: Hashable
Represents a post posted by an account.
-
init(id:uri: createdAt: account: content: visibility: sensitive: spoilerText: mediaAttachments: application: mentions: tags: emojis: repostsCount: favouritesCount: repliesCount: url: inReplyToId: inReplyToAccountId: repost: poll: card: language: text: favourited: reposted: muted: bookmarked: pinned: ) Undocumented
Declaration
Swift
public init(id: String, uri: String, createdAt: Date, account: Account, content: String? = nil, visibility: Post.Visibility, sensitive: Bool, spoilerText: String, mediaAttachments: [MediaAttachment], application: TootApplication, mentions: [Mention], tags: [Tag], emojis: [Emoji], repostsCount: Int, favouritesCount: Int, repliesCount: Int, url: String? = nil, inReplyToId: String? = nil, inReplyToAccountId: String? = nil, repost: Post? = nil, poll: Poll? = nil, card: Card? = nil, language: String? = nil, text: String? = nil, favourited: Bool? = nil, reposted: Bool? = nil, muted: Bool? = nil, bookmarked: Bool? = nil, pinned: Bool? = nil) -
ID of the post in the database.
Declaration
Swift
public var id: String -
URI of the post used for federation.
Declaration
Swift
public var uri: String -
The date when this post was created.
Declaration
Swift
public var createdAt: Date -
The account that authored this post.
Declaration
Swift
public var account: Account -
HTML-encoded post content.
Declaration
Swift
public var content: String? -
Visibility of this post.
Declaration
Swift
public var visibility: Visibility -
Is this post marked as sensitive content?
Declaration
Swift
public var sensitive: Bool -
Subject or summary line, below which post content is collapsed until expanded.
Declaration
Swift
public var spoilerText: String -
Media that is attached to this post.
Declaration
Swift
public var mediaAttachments: [MediaAttachment] -
The application used to post this post.
Declaration
Swift
public var application: TootApplication? -
Mentions of users within the post content.
Declaration
Swift
public var mentions: [Mention] -
Hashtags used within the post content.
Declaration
Swift
public var tags: [Tag] -
Custom emoji to be used when rendering post content.
Declaration
Swift
public var emojis: [Emoji] -
How many reposts this post has received.
Declaration
Swift
public var repostsCount: Int -
How many favourites this post has received.
Declaration
Swift
public var favouritesCount: Int -
How many replies this post has received.
Declaration
Swift
public var repliesCount: Int -
A link to the post’s HTML representation.
Declaration
Swift
public var url: String? -
ID of the post being replied.
Declaration
Swift
public var inReplyToId: String? -
ID of the account being replied to.
Declaration
Swift
public var inReplyToAccountId: String? -
The post being reposted.
Declaration
Swift
public var repost: Post? -
The poll attached to the post.
Declaration
Swift
public var poll: Poll? -
Preview card for links included within post content.
Declaration
Swift
public var card: Card? -
Primary language of this post.
Declaration
Swift
public var language: String? -
Plain-text source of a post. Returned instead of content when post is deleted so the user may redraft from the source text without the client having to reverse-engineer the original text from the HTML content.
Declaration
Swift
public var text: String? -
Have you favourited this post?
Declaration
Swift
public var favourited: Bool? -
Have you reposted this post?
Declaration
Swift
public var reposted: Bool? -
Have you muted notifications for this post’s conversation?
Declaration
Swift
public var muted: Bool? -
Have you bookmarked this post?
Declaration
Swift
public var bookmarked: Bool? -
Have you pinned this post? Only appears if the post is pinnable.
Declaration
Swift
public var pinned: Bool? -
Undocumented
See moreDeclaration
Swift
public enum Visibility : String, Codable, CaseIterable, Sendable -
Declaration
Swift
public static func == (lhs: Post, rhs: Post) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher) -
Convenience var for which post to display. This can be used by clients instead of if/then checking the repost value itself
Declaration
Swift
public var displayPost: Post { get } -
Indicates whether displayPost is a repost or not
Declaration
Swift
public var displayingRepost: Bool { get }
Post Class Reference