mastodon-ios/Mastodon/Scene/HomeTimeline/HomeTimelineViewController+...

42 lines
1.2 KiB
Swift
Raw Normal View History

2021-02-05 08:58:48 +01:00
//
2021-02-07 07:42:50 +01:00
// HomeTimelineViewController+DebugAction.swift
2021-02-05 08:58:48 +01:00
// Mastodon
//
// Created by MainasuK Cirno on 2021-2-5.
//
import os.log
import UIKit
#if DEBUG
2021-02-07 07:42:50 +01:00
extension HomeTimelineViewController {
2021-02-05 08:58:48 +01:00
var debugMenu: UIMenu {
let menu = UIMenu(
title: "Debug Tools",
image: nil,
identifier: nil,
options: .displayInline,
children: [
2021-02-24 11:07:11 +01:00
UIAction(title: "Show Public Timeline", image: UIImage(systemName: "list.dash"), attributes: []) { [weak self] action in
guard let self = self else { return }
self.showPublicTimelineAction(action)
},
2021-02-05 08:58:48 +01:00
UIAction(title: "Sign Out", image: UIImage(systemName: "escape"), attributes: .destructive) { [weak self] action in
guard let self = self else { return }
self.signOutAction(action)
}
]
)
return menu
}
}
2021-02-07 07:42:50 +01:00
extension HomeTimelineViewController {
2021-02-05 08:58:48 +01:00
2021-02-24 11:07:11 +01:00
@objc private func showPublicTimelineAction(_ sender: UIAction) {
coordinator.present(scene: .publicTimeline, from: self, transition: .show)
}
2021-02-05 08:58:48 +01:00
}
#endif