Tusker/Tusker/Views/StatusTableViewCell.swift

30 lines
705 B
Swift

//
// StatusTableViewCell.swift
// Tusker
//
// Created by Shadowfacts on 8/16/18.
// Copyright © 2018 Shadowfacts. All rights reserved.
//
import UIKit
import MastodonKit
import SwiftSoup
class StatusTableViewCell: UITableViewCell {
@IBOutlet weak var displayNameLabel: UILabel!
@IBOutlet weak var usernameLabel: UILabel!
@IBOutlet weak var contentLabel: UILabel!
func updateUI(for status: Status) {
displayNameLabel.text = status.account.displayName
usernameLabel.text = "@\(status.account.acct)"
let doc = try! SwiftSoup.parse(status.content)
let text = (try! doc.body()?.text())!
contentLabel.text = text
}
}