forked from shadowfacts/Tusker
Fix compose reply view missing MastodonController instance
This commit is contained in:
parent
12b6623113
commit
08086f1b18
|
@ -193,6 +193,7 @@ class ComposeViewController: UIViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
let replyView = ComposeStatusReplyView.create()
|
let replyView = ComposeStatusReplyView.create()
|
||||||
|
replyView.mastodonController = mastodonController
|
||||||
replyView.updateUI(for: inReplyTo)
|
replyView.updateUI(for: inReplyTo)
|
||||||
stackView.insertArrangedSubview(replyView, at: 0)
|
stackView.insertArrangedSubview(replyView, at: 0)
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@ import Pachyderm
|
||||||
|
|
||||||
class ComposeStatusReplyView: UIView {
|
class ComposeStatusReplyView: UIView {
|
||||||
|
|
||||||
|
weak var mastodonController: MastodonController?
|
||||||
|
|
||||||
@IBOutlet weak var avatarImageView: UIImageView!
|
@IBOutlet weak var avatarImageView: UIImageView!
|
||||||
@IBOutlet weak var displayNameLabel: UILabel!
|
@IBOutlet weak var displayNameLabel: UILabel!
|
||||||
@IBOutlet weak var usernameLabel: UILabel!
|
@IBOutlet weak var usernameLabel: UILabel!
|
||||||
|
@ -34,6 +36,7 @@ class ComposeStatusReplyView: UIView {
|
||||||
func updateUI(for status: Status) {
|
func updateUI(for status: Status) {
|
||||||
displayNameLabel.text = status.account.realDisplayName
|
displayNameLabel.text = status.account.realDisplayName
|
||||||
usernameLabel.text = "@\(status.account.acct)"
|
usernameLabel.text = "@\(status.account.acct)"
|
||||||
|
statusContentTextView.overrideMastodonController = mastodonController
|
||||||
statusContentTextView.statusID = status.id
|
statusContentTextView.statusID = status.id
|
||||||
|
|
||||||
ImageCache.avatars.get(status.account.avatar) { (data) in
|
ImageCache.avatars.get(status.account.avatar) { (data) in
|
||||||
|
|
|
@ -16,7 +16,8 @@ private let emojiRegex = try! NSRegularExpression(pattern: ":(\\w+):", options:
|
||||||
class ContentTextView: LinkTextView {
|
class ContentTextView: LinkTextView {
|
||||||
|
|
||||||
weak var navigationDelegate: TuskerNavigationDelegate?
|
weak var navigationDelegate: TuskerNavigationDelegate?
|
||||||
var mastodonController: MastodonController? { navigationDelegate?.apiController }
|
weak var overrideMastodonController: MastodonController?
|
||||||
|
var mastodonController: MastodonController? { overrideMastodonController ?? navigationDelegate?.apiController }
|
||||||
|
|
||||||
var defaultFont: UIFont = .systemFont(ofSize: 17)
|
var defaultFont: UIFont = .systemFont(ofSize: 17)
|
||||||
var defaultColor: UIColor = .label
|
var defaultColor: UIColor = .label
|
||||||
|
|
Loading…
Reference in New Issue