From 9af4118dfcce60a292bbcab5687507955a16c1ea Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 15 Mar 2020 11:56:41 -0400 Subject: [PATCH] Show truncated note in account cell --- .../Account Cell/AccountTableViewCell.swift | 8 +++++- .../Account Cell/AccountTableViewCell.xib | 26 ++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Tusker/Views/Account Cell/AccountTableViewCell.swift b/Tusker/Views/Account Cell/AccountTableViewCell.swift index 1fe639e0..ad8066e8 100644 --- a/Tusker/Views/Account Cell/AccountTableViewCell.swift +++ b/Tusker/Views/Account Cell/AccountTableViewCell.swift @@ -7,6 +7,7 @@ // import UIKit +import SwiftSoup class AccountTableViewCell: UITableViewCell { @@ -16,6 +17,7 @@ class AccountTableViewCell: UITableViewCell { @IBOutlet weak var avatarImageView: UIImageView! @IBOutlet weak var displayNameLabel: EmojiLabel! @IBOutlet weak var usernameLabel: UILabel! + @IBOutlet weak var noteLabel: EmojiLabel! var accountID: String! @@ -25,7 +27,7 @@ class AccountTableViewCell: UITableViewCell { super.awakeFromNib() avatarImageView.layer.masksToBounds = true - + NotificationCenter.default.addObserver(self, selector: #selector(updateUIForPrefrences), name: .preferencesChanged, object: nil) } @@ -54,6 +56,10 @@ class AccountTableViewCell: UITableViewCell { usernameLabel.text = "@\(account.acct)" + let doc = try! SwiftSoup.parse(account.note) + noteLabel.text = try! doc.text() + noteLabel.setEmojis(account.emojis, identifier: account.id) + updateUIForPrefrences() } diff --git a/Tusker/Views/Account Cell/AccountTableViewCell.xib b/Tusker/Views/Account Cell/AccountTableViewCell.xib index 4a829b20..20fb4ef2 100644 --- a/Tusker/Views/Account Cell/AccountTableViewCell.xib +++ b/Tusker/Views/Account Cell/AccountTableViewCell.xib @@ -9,40 +9,45 @@ - - + + - + - + - + - - @@ -55,9 +60,10 @@ + - +