chore: add FPSIndicator for debugging

This commit is contained in:
CMK 2021-06-23 14:45:28 +08:00
parent 58dba9f004
commit b593938767
8 changed files with 43 additions and 25 deletions

View File

@ -489,6 +489,7 @@
DBE54ABF2636C889004E7C0B /* UserDefaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6D1B23263684C600ACB481 /* UserDefaults.swift */; };
DBE54AC62636C89F004E7C0B /* NotificationPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBE54AC52636C89F004E7C0B /* NotificationPreference.swift */; };
DBE54ACC2636C8FD004E7C0B /* NotificationPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBE54AC52636C89F004E7C0B /* NotificationPreference.swift */; };
DBF7A0FC26830C33004176A2 /* FPSIndicator in Frameworks */ = {isa = PBXBuildFile; productRef = DBF7A0FB26830C33004176A2 /* FPSIndicator */; };
DBF8AE16263293E400C9C23C /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF8AE15263293E400C9C23C /* NotificationService.swift */; };
DBF8AE1A263293E400C9C23C /* NotificationService.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = DBF8AE13263293E400C9C23C /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
DBF96326262EC0A6001D8D25 /* AuthenticationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBF96325262EC0A6001D8D25 /* AuthenticationServices.framework */; };
@ -1133,6 +1134,7 @@
2D5981BA25E4D7F8000FB903 /* ThirdPartyMailer in Frameworks */,
87FFDA5D898A5C42ADCB35E7 /* Pods_Mastodon.framework in Frameworks */,
DB6804C82637CE2F00430867 /* AppShared.framework in Frameworks */,
DBF7A0FC26830C33004176A2 /* FPSIndicator in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2644,6 +2646,7 @@
DBAC6482267D0B21007FE9FD /* DifferenceKit */,
DBAC649D267DFE43007FE9FD /* DiffableDataSources */,
DBAC64A0267E6D02007FE9FD /* Fuzi */,
DBF7A0FB26830C33004176A2 /* FPSIndicator */,
);
productName = Mastodon;
productReference = DB427DD225BAA00100D1B89D /* Mastodon.app */;
@ -2835,6 +2838,7 @@
DBAC6481267D0B21007FE9FD /* XCRemoteSwiftPackageReference "DifferenceKit" */,
DBAC649C267DFE43007FE9FD /* XCRemoteSwiftPackageReference "DiffableDataSources" */,
DBAC649F267E6D01007FE9FD /* XCRemoteSwiftPackageReference "Fuzi" */,
DBF7A0FA26830C33004176A2 /* XCRemoteSwiftPackageReference "FPSIndicator" */,
);
productRefGroup = DB427DD325BAA00100D1B89D /* Products */;
projectDirPath = "";
@ -4798,6 +4802,14 @@
minimumVersion = 2.11.0;
};
};
DBF7A0FA26830C33004176A2 /* XCRemoteSwiftPackageReference "FPSIndicator" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/MainasuK/FPSIndicator.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
@ -4890,6 +4902,11 @@
package = DBB525062611EAC0002F1F29 /* XCRemoteSwiftPackageReference "Tabman" */;
productName = Tabman;
};
DBF7A0FB26830C33004176A2 /* FPSIndicator */ = {
isa = XCSwiftPackageProductDependency;
package = DBF7A0FA26830C33004176A2 /* XCRemoteSwiftPackageReference "FPSIndicator" */;
productName = FPSIndicator;
};
/* End XCSwiftPackageProductDependency section */
/* Begin XCVersionGroup section */

View File

@ -12,7 +12,7 @@
<key>CoreDataStack.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>21</integer>
<integer>30</integer>
</dict>
<key>Mastodon - ASDK.xcscheme_^#shared#^_</key>
<dict>
@ -37,7 +37,7 @@
<key>NotificationService.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>22</integer>
<integer>27</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>

View File

@ -64,6 +64,15 @@
"version": "1.2.0"
}
},
{
"package": "FPSIndicator",
"repositoryURL": "https://github.com/MainasuK/FPSIndicator.git",
"state": {
"branch": null,
"revision": "b2a002d689c400485f2ba41f9e71e15f7b99764a",
"version": "1.0.1"
}
},
{
"package": "Fuzi",
"repositoryURL": "https://github.com/cezheng/Fuzi.git",

View File

@ -10,10 +10,6 @@ import UIKit
import Combine
import SafariServices
#if DEBUG
import GDPerformanceView_Swift
#endif
class MainTabBarController: UITabBarController {
var disposeBag = Set<AnyCancellable>()
@ -190,14 +186,6 @@ extension MainTabBarController {
.store(in: &disposeBag)
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
#if DEBUG
PerformanceMonitor.shared().start()
#endif
}
}
extension MainTabBarController {

View File

@ -10,10 +10,6 @@ import UIKit
import UserNotifications
import AppShared
#if DEBUG
import GDPerformanceView_Swift
#endif
#if ASDK
import AsyncDisplayKit
#endif

View File

@ -9,6 +9,10 @@ import UIKit
import Combine
import CoreDataStack
#if DEBUG
import FPSIndicator
#endif
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var observations = Set<NSKeyValueObservation>()
@ -16,6 +20,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
var coordinator: SceneCoordinator?
#if DEBUG
var fpsIndicator: FPSIndicator?
#endif
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
@ -38,6 +47,10 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
self.window?.overrideUserInterfaceStyle = defaults.customUserInterfaceStyle
}
.store(in: &observations)
#if DEBUG
fpsIndicator = FPSIndicator(windowScene: windowScene)
#endif
}
func sceneDidDisconnect(_ scene: UIScene) {

View File

@ -17,7 +17,6 @@ target 'Mastodon' do
# DEBUG
pod 'FLEX', '~> 4.4.0', :configurations => ['Debug', 'ASDK - Debug']
pod 'GDPerformanceView-Swift', '~> 2.1.1', :configurations => ['Debug', 'ASDK - Debug']
target 'MastodonTests' do
inherit! :search_paths

View File

@ -1,7 +1,6 @@
PODS:
- DateToolsSwift (5.0.0)
- FLEX (4.4.1)
- GDPerformanceView-Swift (2.1.1)
- Kanna (5.2.4)
- Keys (1.0.1)
- PINCache (3.0.3):
@ -45,7 +44,6 @@ PODS:
DEPENDENCIES:
- DateToolsSwift (~> 5.0.0)
- FLEX (~> 4.4.0)
- GDPerformanceView-Swift (~> 2.1.1)
- Kanna (~> 5.2.2)
- Keys (from `Pods/CocoaPodsKeys`)
- SwiftGen (~> 6.4.0)
@ -56,7 +54,6 @@ SPEC REPOS:
trunk:
- DateToolsSwift
- FLEX
- GDPerformanceView-Swift
- Kanna
- PINCache
- PINOperation
@ -72,7 +69,6 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
DateToolsSwift: 4207ada6ad615d8dc076323d27037c94916dbfa6
FLEX: 7ca2c8cd3a435ff501ff6d2f2141e9bdc934eaab
GDPerformanceView-Swift: 22d964fe40b19e3d914dba2586237d064de8fd77
Kanna: b9d00d7c11428308c7f95e1f1f84b8205f567a8f
Keys: a576f4c9c1c641ca913a959a9c62ed3f215a8de9
PINCache: 7a8fc1a691173d21dbddbf86cd515de6efa55086
@ -82,6 +78,6 @@ SPEC CHECKSUMS:
Texture: 2f109e937850d94d1d07232041c9c7313ccddb81
"UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3
PODFILE CHECKSUM: a0d0a385a2888802244e7841940a7d5a55315e1f
PODFILE CHECKSUM: f2f99b5771c5c36ef69d13999b88cea5b0e8bfe1
COCOAPODS: 1.10.1