Remove dead code
This commit is contained in:
parent
c78f152670
commit
421881d461
|
@ -245,34 +245,6 @@ extension ProfileViewController: ProfileHeaderViewDelegate {
|
||||||
view.pagesSegmentedControl.isUserInteractionEnabled = true
|
view.pagesSegmentedControl.isUserInteractionEnabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func profileHeader(_ view: ProfileHeaderView, showMoreOptionsFor accountID: String, sourceView: UIView) {
|
|
||||||
let account = mastodonController.persistentContainer.account(for: accountID)!
|
|
||||||
|
|
||||||
func showActivityController(activities: [UIActivity]) {
|
|
||||||
let activityController = UIActivityViewController(activityItems: [account.url, AccountActivityItemSource(account)], applicationActivities: activities)
|
|
||||||
activityController.completionWithItemsHandler = OpenInSafariActivity.completionHandler(navigator: self, url: account.url)
|
|
||||||
activityController.popoverPresentationController?.sourceView = sourceView
|
|
||||||
self.present(activityController, animated: true)
|
|
||||||
}
|
|
||||||
|
|
||||||
if account.id == mastodonController.account.id {
|
|
||||||
showActivityController(activities: [OpenInSafariActivity()])
|
|
||||||
} else {
|
|
||||||
let request = Client.getRelationships(accounts: [account.id])
|
|
||||||
mastodonController.run(request) { (response) in
|
|
||||||
var customActivities: [UIActivity] = [OpenInSafariActivity()]
|
|
||||||
if case let .success(results, _) = response, let relationship = results.first {
|
|
||||||
let toggleFollowActivity = relationship.following ? UnfollowAccountActivity() : FollowAccountActivity()
|
|
||||||
customActivities.insert(toggleFollowActivity, at: 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
showActivityController(activities: customActivities)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ProfileViewController: TabBarScrollableViewController {
|
extension ProfileViewController: TabBarScrollableViewController {
|
||||||
|
|
|
@ -12,8 +12,6 @@ import Combine
|
||||||
|
|
||||||
protocol ProfileHeaderViewDelegate: TuskerNavigationDelegate {
|
protocol ProfileHeaderViewDelegate: TuskerNavigationDelegate {
|
||||||
func profileHeader(_ headerView: ProfileHeaderView, selectedPostsIndexChangedTo newIndex: Int)
|
func profileHeader(_ headerView: ProfileHeaderView, selectedPostsIndexChangedTo newIndex: Int)
|
||||||
|
|
||||||
func profileHeader(_ headerView: ProfileHeaderView, showMoreOptionsFor accountID: String, sourceView: UIView)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProfileHeaderView: UIView {
|
class ProfileHeaderView: UIView {
|
||||||
|
|
Loading…
Reference in New Issue