chore: isolate ASDK build
This commit is contained in:
parent
2c21f00183
commit
0a622f6ca8
File diff suppressed because it is too large
Load Diff
|
@ -12,7 +12,7 @@
|
||||||
<key>CoreDataStack.xcscheme_^#shared#^_</key>
|
<key>CoreDataStack.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>31</integer>
|
<integer>39</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>Mastodon - ASDK.xcscheme_^#shared#^_</key>
|
<key>Mastodon - ASDK.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<key>NotificationService.xcscheme_^#shared#^_</key>
|
<key>NotificationService.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>30</integer>
|
<integer>40</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SuppressBuildableAutocreation</key>
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
|
|
@ -48,8 +48,10 @@ extension SceneCoordinator {
|
||||||
case mastodonResendEmail(viewModel: MastodonResendEmailViewModel)
|
case mastodonResendEmail(viewModel: MastodonResendEmailViewModel)
|
||||||
case mastodonWebView(viewModel:WebViewModel)
|
case mastodonWebView(viewModel:WebViewModel)
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
// ASDK
|
// ASDK
|
||||||
case asyncHome
|
case asyncHome
|
||||||
|
#endif
|
||||||
|
|
||||||
// compose
|
// compose
|
||||||
case compose(viewModel: ComposeViewModel)
|
case compose(viewModel: ComposeViewModel)
|
||||||
|
@ -239,9 +241,11 @@ private extension SceneCoordinator {
|
||||||
let _viewController = WebViewController()
|
let _viewController = WebViewController()
|
||||||
_viewController.viewModel = viewModel
|
_viewController.viewModel = viewModel
|
||||||
viewController = _viewController
|
viewController = _viewController
|
||||||
|
#if ASDK
|
||||||
case .asyncHome:
|
case .asyncHome:
|
||||||
let _viewController = AsyncHomeTimelineViewController()
|
let _viewController = AsyncHomeTimelineViewController()
|
||||||
viewController = _viewController
|
viewController = _viewController
|
||||||
|
#endif
|
||||||
case .compose(let viewModel):
|
case .compose(let viewModel):
|
||||||
let _viewController = ComposeViewController()
|
let _viewController = ComposeViewController()
|
||||||
_viewController.viewModel = viewModel
|
_viewController.viewModel = viewModel
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by Cirno MainasuK on 2021-6-19.
|
// Created by Cirno MainasuK on 2021-6-19.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import DifferenceKit
|
import DifferenceKit
|
||||||
|
@ -79,3 +81,5 @@ extension ASTableNode: ReloadableTableView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by Cirno MainasuK on 2021-6-19.
|
// Created by Cirno MainasuK on 2021-6-19.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import DiffableDataSources
|
import DiffableDataSources
|
||||||
|
@ -109,3 +111,5 @@ open class TableNodeDiffableDataSource<SectionIdentifierType: Hashable, ItemIden
|
||||||
return block
|
return block
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -11,9 +11,12 @@ import CoreDataStack
|
||||||
import os.log
|
import os.log
|
||||||
import UIKit
|
import UIKit
|
||||||
import AVKit
|
import AVKit
|
||||||
import AsyncDisplayKit
|
|
||||||
import Nuke
|
import Nuke
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
import AsyncDisplayKit
|
||||||
|
#endif
|
||||||
|
|
||||||
protocol StatusCell: DisposeBagCollectable {
|
protocol StatusCell: DisposeBagCollectable {
|
||||||
var statusView: StatusView { get }
|
var statusView: StatusView { get }
|
||||||
var pollCountdownSubscription: AnyCancellable? { get set }
|
var pollCountdownSubscription: AnyCancellable? { get set }
|
||||||
|
@ -24,6 +27,7 @@ enum StatusSection: Equatable, Hashable {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension StatusSection {
|
extension StatusSection {
|
||||||
|
#if ASDK
|
||||||
static func tableNodeDiffableDataSource(
|
static func tableNodeDiffableDataSource(
|
||||||
tableNode: ASTableNode,
|
tableNode: ASTableNode,
|
||||||
managedObjectContext: NSManagedObjectContext
|
managedObjectContext: NSManagedObjectContext
|
||||||
|
@ -49,7 +53,7 @@ extension StatusSection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static func tableViewDiffableDataSource(
|
static func tableViewDiffableDataSource(
|
||||||
for tableView: UITableView,
|
for tableView: UITableView,
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by Cirno MainasuK on 2021-6-20.
|
// Created by Cirno MainasuK on 2021-6-20.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import ActiveLabel
|
import ActiveLabel
|
||||||
|
|
||||||
|
@ -14,3 +16,5 @@ extension StatusNodeDelegate where Self: StatusProvider {
|
||||||
StatusProviderFacade.responseToStatusActiveLabelAction(provider: self, node: node, didSelectActiveEntityType: type)
|
StatusProviderFacade.responseToStatusActiveLabelAction(provider: self, node: node, didSelectActiveEntityType: type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -9,7 +9,10 @@ import UIKit
|
||||||
import Combine
|
import Combine
|
||||||
import CoreData
|
import CoreData
|
||||||
import CoreDataStack
|
import CoreDataStack
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
#endif
|
||||||
|
|
||||||
protocol StatusProvider: NeedsDependency & DisposeBagCollectable & UIViewController {
|
protocol StatusProvider: NeedsDependency & DisposeBagCollectable & UIViewController {
|
||||||
// async
|
// async
|
||||||
|
@ -23,11 +26,15 @@ protocol StatusProvider: NeedsDependency & DisposeBagCollectable & UIViewControl
|
||||||
func item(for cell: UITableViewCell?, indexPath: IndexPath?) -> Item?
|
func item(for cell: UITableViewCell?, indexPath: IndexPath?) -> Item?
|
||||||
func items(indexPaths: [IndexPath]) -> [Item]
|
func items(indexPaths: [IndexPath]) -> [Item]
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
func status(node: ASCellNode?, indexPath: IndexPath?) -> Status?
|
func status(node: ASCellNode?, indexPath: IndexPath?) -> Status?
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
extension StatusProvider {
|
extension StatusProvider {
|
||||||
func status(node: ASCellNode?, indexPath: IndexPath?) -> Status? {
|
func status(node: ASCellNode?, indexPath: IndexPath?) -> Status? {
|
||||||
fatalError("Needs implement this")
|
fatalError("Needs implement this")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -12,7 +12,10 @@ import CoreData
|
||||||
import CoreDataStack
|
import CoreDataStack
|
||||||
import MastodonSDK
|
import MastodonSDK
|
||||||
import ActiveLabel
|
import ActiveLabel
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
#endif
|
||||||
|
|
||||||
enum StatusProviderFacade { }
|
enum StatusProviderFacade { }
|
||||||
|
|
||||||
|
@ -146,6 +149,7 @@ extension StatusProviderFacade {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
static func responseToStatusActiveLabelAction(provider: StatusProvider, node: ASCellNode, didSelectActiveEntityType type: ActiveEntityType) {
|
static func responseToStatusActiveLabelAction(provider: StatusProvider, node: ASCellNode, didSelectActiveEntityType type: ActiveEntityType) {
|
||||||
switch type {
|
switch type {
|
||||||
case .hashtag(let text, _):
|
case .hashtag(let text, _):
|
||||||
|
@ -175,6 +179,7 @@ extension StatusProviderFacade {
|
||||||
guard let status = provider.status(node: node, indexPath: nil) else { return }
|
guard let status = provider.status(node: node, indexPath: nil) else { return }
|
||||||
coordinateToStatusMentionProfileScene(for: target, provider: provider, status: status, mention: mention)
|
coordinateToStatusMentionProfileScene(for: target, provider: provider, status: status, mention: mention)
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private static func coordinateToStatusMentionProfileScene(for target: Target, provider: StatusProvider, cell: UITableViewCell, mention: String) {
|
private static func coordinateToStatusMentionProfileScene(for target: Target, provider: StatusProvider, cell: UITableViewCell, mention: String) {
|
||||||
provider.status(for: cell, indexPath: nil)
|
provider.status(for: cell, indexPath: nil)
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
// Created by MainasuK Cirno on 2021-6-21.
|
// Created by MainasuK Cirno on 2021-6-21.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK && DEBUG
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import UIKit
|
import UIKit
|
||||||
import CoreData
|
import CoreData
|
||||||
import CoreDataStack
|
import CoreDataStack
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
import FLEX
|
import FLEX
|
||||||
|
|
||||||
extension AsyncHomeTimelineViewController {
|
extension AsyncHomeTimelineViewController {
|
||||||
|
@ -25,10 +25,6 @@ extension AsyncHomeTimelineViewController {
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
self.showFLEXAction(action)
|
self.showFLEXAction(action)
|
||||||
}),
|
}),
|
||||||
UIAction(title: "Toggle Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
|
|
||||||
guard let self = self else { return }
|
|
||||||
self.context.toggleHomePreference(action)
|
|
||||||
}),
|
|
||||||
moveMenu,
|
moveMenu,
|
||||||
dropMenu,
|
dropMenu,
|
||||||
UIAction(title: "Show Welcome", image: UIImage(systemName: "figure.walk"), attributes: []) { [weak self] action in
|
UIAction(title: "Show Welcome", image: UIImage(systemName: "figure.walk"), attributes: []) { [weak self] action in
|
||||||
|
@ -384,4 +380,5 @@ extension AsyncHomeTimelineViewController {
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by MainasuK Cirno on 2021-6-21.
|
// Created by MainasuK Cirno on 2021-6-21.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import UIKit
|
import UIKit
|
||||||
import Combine
|
import Combine
|
||||||
|
@ -111,3 +113,5 @@ extension AsyncHomeTimelineViewController: StatusProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AsyncHomeTimelineViewController: UserProvider {}
|
extension AsyncHomeTimelineViewController: UserProvider {}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by MainasuK Cirno on 2021-6-21.
|
// Created by MainasuK Cirno on 2021-6-21.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import UIKit
|
import UIKit
|
||||||
import AVKit
|
import AVKit
|
||||||
|
@ -56,16 +58,6 @@ final class AsyncHomeTimelineViewController: ASDKViewController<ASTableNode>, Ne
|
||||||
}()
|
}()
|
||||||
|
|
||||||
var tableView: UITableView { node.view }
|
var tableView: UITableView { node.view }
|
||||||
//let tableView: UITableView = {
|
|
||||||
// let tableView = ControlContainableTableView()
|
|
||||||
// tableView.register(StatusTableViewCell.self, forCellReuseIdentifier: String(describing: StatusTableViewCell.self))
|
|
||||||
// tableView.register(TimelineMiddleLoaderTableViewCell.self, forCellReuseIdentifier: String(describing: TimelineMiddleLoaderTableViewCell.self))
|
|
||||||
// tableView.register(TimelineBottomLoaderTableViewCell.self, forCellReuseIdentifier: String(describing: TimelineBottomLoaderTableViewCell.self))
|
|
||||||
// tableView.rowHeight = UITableView.automaticDimension
|
|
||||||
// tableView.separatorStyle = .none
|
|
||||||
// tableView.backgroundColor = .clear
|
|
||||||
// return tableView
|
|
||||||
//}()
|
|
||||||
|
|
||||||
let publishProgressView: UIProgressView = {
|
let publishProgressView: UIProgressView = {
|
||||||
let progressView = UIProgressView(progressViewStyle: .bar)
|
let progressView = UIProgressView(progressViewStyle: .bar)
|
||||||
|
@ -116,25 +108,10 @@ extension AsyncHomeTimelineViewController {
|
||||||
// long press to trigger debug menu
|
// long press to trigger debug menu
|
||||||
settingBarButtonItem.menu = debugMenu
|
settingBarButtonItem.menu = debugMenu
|
||||||
PerformanceMonitor.shared().delegate = self
|
PerformanceMonitor.shared().delegate = self
|
||||||
|
|
||||||
#else
|
#else
|
||||||
settingBarButtonItem.target = self
|
settingBarButtonItem.target = self
|
||||||
settingBarButtonItem.action = #selector(AsyncHomeTimelineViewController.settingBarButtonItemPressed(_:))
|
settingBarButtonItem.action = #selector(AsyncHomeTimelineViewController.settingBarButtonItemPressed(_:))
|
||||||
#endif
|
#endif
|
||||||
settingBarButtonItem.menu = UIMenu(title: "Toggle Home", image: nil, identifier: nil, options: [], children: [
|
|
||||||
UIAction(title: "Setting", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] _ in
|
|
||||||
guard let self = self else { return }
|
|
||||||
self.settingBarButtonItemPressed(self.settingBarButtonItem)
|
|
||||||
}),
|
|
||||||
UIAction(title: "Toggle Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
|
|
||||||
guard let self = self else { return }
|
|
||||||
self.context.toggleHomePreference(action)
|
|
||||||
let alertController = UIAlertController(title: "Please Restart App", message: nil, preferredStyle: .alert)
|
|
||||||
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
|
|
||||||
alertController.addAction(okAction)
|
|
||||||
self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
|
||||||
})
|
|
||||||
])
|
|
||||||
|
|
||||||
navigationItem.rightBarButtonItem = composeBarButtonItem
|
navigationItem.rightBarButtonItem = composeBarButtonItem
|
||||||
composeBarButtonItem.target = self
|
composeBarButtonItem.target = self
|
||||||
|
@ -604,3 +581,5 @@ extension AsyncHomeTimelineViewController: ASTableDelegate {
|
||||||
|
|
||||||
// MARK: - StatusNodeDelegate
|
// MARK: - StatusNodeDelegate
|
||||||
extension AsyncHomeTimelineViewController: StatusNodeDelegate { }
|
extension AsyncHomeTimelineViewController: StatusNodeDelegate { }
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by MainasuK Cirno on 2021-6-21.
|
// Created by MainasuK Cirno on 2021-6-21.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import UIKit
|
import UIKit
|
||||||
import CoreData
|
import CoreData
|
||||||
|
@ -153,3 +155,5 @@ extension AsyncHomeTimelineViewModel: NSFetchedResultsControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import func QuartzCore.CACurrentMediaTime
|
import func QuartzCore.CACurrentMediaTime
|
||||||
import Foundation
|
import Foundation
|
||||||
|
@ -128,3 +130,5 @@ extension AsyncHomeTimelineViewModel.LoadLatestState {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by MainasuK Cirno on 2021-6-21.
|
// Created by MainasuK Cirno on 2021-6-21.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import Foundation
|
import Foundation
|
||||||
import GameplayKit
|
import GameplayKit
|
||||||
|
@ -106,3 +108,5 @@ extension AsyncHomeTimelineViewModel.LoadMiddleState {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by MainasuK Cirno on 2021-6-21.
|
// Created by MainasuK Cirno on 2021-6-21.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import Foundation
|
import Foundation
|
||||||
import GameplayKit
|
import GameplayKit
|
||||||
|
@ -111,3 +113,5 @@ extension AsyncHomeTimelineViewModel.LoadOldestState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import os.log
|
import os.log
|
||||||
import func AVFoundation.AVMakeRect
|
import func AVFoundation.AVMakeRect
|
||||||
import UIKit
|
import UIKit
|
||||||
|
@ -146,3 +148,5 @@ final class AsyncHomeTimelineViewModel: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AsyncHomeTimelineViewModel: SuggestionAccountViewModelDelegate { }
|
extension AsyncHomeTimelineViewModel: SuggestionAccountViewModelDelegate { }
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -25,10 +25,6 @@ extension HomeTimelineViewController {
|
||||||
guard let self = self else { return }
|
guard let self = self else { return }
|
||||||
self.showFLEXAction(action)
|
self.showFLEXAction(action)
|
||||||
}),
|
}),
|
||||||
UIAction(title: "Toggle Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
|
|
||||||
guard let self = self else { return }
|
|
||||||
self.context.toggleHomePreference(action)
|
|
||||||
}),
|
|
||||||
moveMenu,
|
moveMenu,
|
||||||
dropMenu,
|
dropMenu,
|
||||||
UIAction(title: "Show Welcome", image: UIImage(systemName: "figure.walk"), attributes: []) { [weak self] action in
|
UIAction(title: "Show Welcome", image: UIImage(systemName: "figure.walk"), attributes: []) { [weak self] action in
|
||||||
|
|
|
@ -15,10 +15,6 @@ import GameplayKit
|
||||||
import MastodonSDK
|
import MastodonSDK
|
||||||
import AlamofireImage
|
import AlamofireImage
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
import GDPerformanceView_Swift
|
|
||||||
#endif
|
|
||||||
|
|
||||||
final class HomeTimelineViewController: UIViewController, NeedsDependency, MediaPreviewableViewController {
|
final class HomeTimelineViewController: UIViewController, NeedsDependency, MediaPreviewableViewController {
|
||||||
|
|
||||||
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
|
weak var context: AppContext! { willSet { precondition(!isViewLoaded) } }
|
||||||
|
@ -102,22 +98,6 @@ extension HomeTimelineViewController {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
// long press to trigger debug menu
|
// long press to trigger debug menu
|
||||||
settingBarButtonItem.menu = debugMenu
|
settingBarButtonItem.menu = debugMenu
|
||||||
PerformanceMonitor.shared().delegate = self
|
|
||||||
#elseif ASDK
|
|
||||||
settingBarButtonItem.menu = UIMenu(title: "Toggle Home", image: nil, identifier: nil, options: [], children: [
|
|
||||||
UIAction(title: "Setting", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] _ in
|
|
||||||
guard let self = self else { return }
|
|
||||||
self.settingBarButtonItemPressed(self.settingBarButtonItem)
|
|
||||||
}),
|
|
||||||
UIAction(title: "Show Async Home", image: nil, identifier: nil, discoverabilityTitle: nil, attributes: [], state: .off, handler: { [weak self] action in
|
|
||||||
guard let self = self else { return }
|
|
||||||
self.context.toggleHomePreference(action)
|
|
||||||
let alertController = UIAlertController(title: "Please Restart App", message: nil, preferredStyle: .alert)
|
|
||||||
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
|
|
||||||
alertController.addAction(okAction)
|
|
||||||
self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
|
||||||
})
|
|
||||||
])
|
|
||||||
#else
|
#else
|
||||||
settingBarButtonItem.target = self
|
settingBarButtonItem.target = self
|
||||||
settingBarButtonItem.action = #selector(HomeTimelineViewController.settingBarButtonItemPressed(_:))
|
settingBarButtonItem.action = #selector(HomeTimelineViewController.settingBarButtonItemPressed(_:))
|
||||||
|
@ -578,11 +558,3 @@ extension HomeTimelineViewController: StatusTableViewControllerNavigateable {
|
||||||
statusKeyCommandHandler(sender)
|
statusKeyCommandHandler(sender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
extension HomeTimelineViewController: PerformanceMonitorDelegate {
|
|
||||||
func performanceMonitor(didReport performanceReport: PerformanceReport) {
|
|
||||||
// print(performanceReport)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -10,6 +10,10 @@ import UIKit
|
||||||
import Combine
|
import Combine
|
||||||
import SafariServices
|
import SafariServices
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
import GDPerformanceView_Swift
|
||||||
|
#endif
|
||||||
|
|
||||||
class MainTabBarController: UITabBarController {
|
class MainTabBarController: UITabBarController {
|
||||||
|
|
||||||
var disposeBag = Set<AnyCancellable>()
|
var disposeBag = Set<AnyCancellable>()
|
||||||
|
@ -186,6 +190,14 @@ extension MainTabBarController {
|
||||||
.store(in: &disposeBag)
|
.store(in: &disposeBag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
|
super.viewDidAppear(animated)
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
PerformanceMonitor.shared().start()
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension MainTabBarController {
|
extension MainTabBarController {
|
||||||
|
@ -345,3 +357,33 @@ extension MainTabBarController {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
extension MainTabBarController {
|
||||||
|
override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) {
|
||||||
|
guard let event = event else { return }
|
||||||
|
switch event.subtype {
|
||||||
|
case .motionShake:
|
||||||
|
let alertController = UIAlertController(title: "ASDK Debug Panel", message: nil, preferredStyle: .alert)
|
||||||
|
let toggleHomeAction = UIAlertAction(title: "Toggle Home", style: .default) { [weak self] _ in
|
||||||
|
guard let self = self else { return }
|
||||||
|
MainTabBarController.toggleAsyncHome()
|
||||||
|
let okAlertController = UIAlertController(title: "Success", message: "Please restart the app", preferredStyle: .alert)
|
||||||
|
let okAction = UIAlertAction(title: "OK", style: .default, handler: nil)
|
||||||
|
okAlertController.addAction(okAction)
|
||||||
|
self.coordinator.present(scene: .alertController(alertController: okAlertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
||||||
|
}
|
||||||
|
alertController.addAction(toggleHomeAction)
|
||||||
|
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil)
|
||||||
|
alertController.addAction(cancelAction)
|
||||||
|
self.coordinator.present(scene: .alertController(alertController: alertController), from: nil, transition: .alertController(animated: true, completion: nil))
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static func toggleAsyncHome() {
|
||||||
|
UserDefaults.shared.preferAsyncHomeTimeline.toggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by Cirno MainasuK on 2021-6-20.
|
// Created by Cirno MainasuK on 2021-6-20.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
|
@ -19,3 +21,5 @@ final class ASMetaEditableTextNode: ASEditableTextNode, UITextViewDelegate {
|
||||||
return metaEditableTextNodeDelegate?.metaEditableTextNode(self, shouldInteractWith: URL, in: characterRange, interaction: interaction) ?? false
|
return metaEditableTextNodeDelegate?.metaEditableTextNode(self, shouldInteractWith: URL, in: characterRange, interaction: interaction) ?? false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by Cirno MainasuK on 2021-6-19.
|
// Created by Cirno MainasuK on 2021-6-19.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import Combine
|
import Combine
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
@ -235,3 +237,5 @@ extension StatusNode: ASMultiplexImageNodeDataSource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by Cirno MainasuK on 2021-6-19.
|
// Created by Cirno MainasuK on 2021-6-19.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
|
@ -35,3 +37,5 @@ final class TimelineBottomLoaderNode: ASCellNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
// Created by Cirno MainasuK on 2021-6-19.
|
// Created by Cirno MainasuK on 2021-6-19.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
|
@ -48,3 +50,5 @@ final class TimelineMiddleLoaderNode: ASCellNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -211,9 +211,3 @@ extension AppContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AppContext {
|
|
||||||
@objc func toggleHomePreference(_ action: UIAction) {
|
|
||||||
UserDefaults.shared.preferAsyncHomeTimeline.toggle()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -9,12 +9,15 @@ import os.log
|
||||||
import UIKit
|
import UIKit
|
||||||
import UserNotifications
|
import UserNotifications
|
||||||
import AppShared
|
import AppShared
|
||||||
import AsyncDisplayKit
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
import GDPerformanceView_Swift
|
import GDPerformanceView_Swift
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
import AsyncDisplayKit
|
||||||
|
#endif
|
||||||
|
|
||||||
@main
|
@main
|
||||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
|
@ -32,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
UNUserNotificationCenter.current().delegate = self
|
UNUserNotificationCenter.current().delegate = self
|
||||||
application.registerForRemoteNotifications()
|
application.registerForRemoteNotifications()
|
||||||
|
|
||||||
#if DEBUG
|
#if ASDK && DEBUG
|
||||||
// PerformanceMonitor.shared().start()
|
// PerformanceMonitor.shared().start()
|
||||||
// ASDisplayNode.shouldShowRangeDebugOverlay = true
|
// ASDisplayNode.shouldShowRangeDebugOverlay = true
|
||||||
// ASControlNode.enableHitTestDebug = true
|
// ASControlNode.enableHitTestDebug = true
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// ref: https://github.com/Adlai-Holler/ASDKPlaceholderTest/blob/eea9fa7cff2d16a57efb47d208422ea9b49a630a/ASDKPlaceholderTest/ASDisplayNodeSubclasses.swift
|
// ref: https://github.com/Adlai-Holler/ASDKPlaceholderTest/blob/eea9fa7cff2d16a57efb47d208422ea9b49a630a/ASDKPlaceholderTest/ASDisplayNodeSubclasses.swift
|
||||||
|
|
||||||
|
#if ASDK
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
import UIKit
|
import UIKit
|
||||||
|
@ -69,3 +71,5 @@ class ActivityIndicatorNode: ASDisplayNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
6
Podfile
6
Podfile
|
@ -8,7 +8,7 @@ target 'Mastodon' do
|
||||||
|
|
||||||
# UI
|
# UI
|
||||||
pod 'UITextField+Shake', '~> 1.2'
|
pod 'UITextField+Shake', '~> 1.2'
|
||||||
pod 'Texture', '~> 3.0.0'
|
pod 'Texture', '~> 3.0.0', :configurations => ['ASDK - Debug', 'ASDK - Release']
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
pod 'SwiftGen', '~> 6.4.0'
|
pod 'SwiftGen', '~> 6.4.0'
|
||||||
|
@ -16,8 +16,8 @@ target 'Mastodon' do
|
||||||
pod 'Kanna', '~> 5.2.2'
|
pod 'Kanna', '~> 5.2.2'
|
||||||
|
|
||||||
# DEBUG
|
# DEBUG
|
||||||
pod 'FLEX', '~> 4.4.0', :configurations => ['Debug']
|
pod 'FLEX', '~> 4.4.0', :configurations => ['Debug', 'ASDK - Debug']
|
||||||
pod 'GDPerformanceView-Swift', '~> 2.1.1', :configurations => ['Debug']
|
pod 'GDPerformanceView-Swift', '~> 2.1.1', :configurations => ['Debug', 'ASDK - Debug']
|
||||||
|
|
||||||
target 'MastodonTests' do
|
target 'MastodonTests' do
|
||||||
inherit! :search_paths
|
inherit! :search_paths
|
||||||
|
|
|
@ -82,6 +82,6 @@ SPEC CHECKSUMS:
|
||||||
Texture: 2f109e937850d94d1d07232041c9c7313ccddb81
|
Texture: 2f109e937850d94d1d07232041c9c7313ccddb81
|
||||||
"UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3
|
"UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3
|
||||||
|
|
||||||
PODFILE CHECKSUM: ffa234348a25b078905180858ee4119fec0712d1
|
PODFILE CHECKSUM: a0d0a385a2888802244e7841940a7d5a55315e1f
|
||||||
|
|
||||||
COCOAPODS: 1.10.1
|
COCOAPODS: 1.10.1
|
||||||
|
|
Loading…
Reference in New Issue