Skip to content

Commit 4021fc3

Browse files
committed
update ui
1 parent 1b6a02a commit 4021fc3

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

ZXKitFPS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = 'ZXKitFPS'
33
s.swift_version = '5.0'
4-
s.version = '0.0.8'
4+
s.version = '0.0.9'
55
s.license= { :type => "MIT", :file => "LICENSE" }
66
s.summary = 'FPS test tool for iOS platform'
77
s.homepage = 'https://github.com/ZXKitCode/ZXKitFPS'

pod/ZXKitFPS.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ open class ZXKitFPS {
3232
}
3333

3434
public func stop() {
35-
#if canImport(ZXKitCore)
36-
ZXKit.resetFloatButton()
37-
#endif
3835
lastTime = 0
3936
count = 0
4037
isRunning = false

pod/zxkit/ZXKitFPS+zxkit.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ extension ZXKitFPS: ZXKitPluginProtocol {
3636
public func start() {
3737
ZXKit.hide()
3838
self.start { (fps) in
39-
ZXKit.floatButton?.setTitle("\(fps)FPS", for: UIControl.State.normal)
40-
ZXKit.floatButton?.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .bold)
39+
var backgroundColor = UIColor.zx.color(hexValue: 0xaa2b1d)
4140
if fps >= 55 {
42-
ZXKit.floatButton?.backgroundColor = UIColor.zx.color(hexValue: 0x5dae8b)
41+
backgroundColor = UIColor.zx.color(hexValue: 0x5dae8b)
4342
} else if (fps >= 50 && fps < 55) {
44-
ZXKit.floatButton?.backgroundColor = UIColor.zx.color(hexValue: 0xf0a500)
45-
} else {
46-
ZXKit.floatButton?.backgroundColor = UIColor.zx.color(hexValue: 0xaa2b1d)
43+
backgroundColor = UIColor.zx.color(hexValue: 0xf0a500)
4744
}
45+
ZXKit.updateFloatButton(title: "\(fps)FPS", titleColor: UIColor.zx.color(hexValue: 0xffffff), titleFont: UIFont.systemFont(ofSize: 13, weight: .bold), backgroundColor: backgroundColor)
4846
}
4947
}
5048
}

0 commit comments

Comments
 (0)