Skip to content

Commit d5840ae

Browse files
committed
fix show
1 parent 8b32892 commit d5840ae

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

netfox-zxkit.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 = 'netfox-zxkit'
33
s.swift_version = '5.0'
4-
s.version = '0.0.3'
4+
s.version = '0.0.4'
55
s.license= { :type => "Apache-2.0", :file => "LICENSE" }
66
s.summary = 'a quick look on all executed network requests performed by netfox'
77
s.homepage = 'https://github.com/ZXKitCode/netfox-zxkit'

pod/zxkit/NetFox+zxkit.swift

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ open class NetFoxZXKit: ZXKitPluginProtocol {
3232
}
3333

3434
public func start() {
35-
NFX.sharedInstance().show()
35+
ZXKit.hide()
36+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
37+
if !self.isRunning {
38+
NFX.sharedInstance().start()
39+
}
40+
NFX.sharedInstance().show()
41+
}
3642
}
3743

3844
public var pluginIdentifier: String {
@@ -52,11 +58,17 @@ open class NetFoxZXKit: ZXKitPluginProtocol {
5258
}
5359

5460
public var isRunning: Bool {
55-
return true
61+
return NFX.sharedInstance().isStarted()
5662
}
5763

5864
public func stop() {
59-
NFX.sharedInstance().hide()
65+
ZXKit.hide()
66+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
67+
if !self.isRunning {
68+
NFX.sharedInstance().start()
69+
}
70+
NFX.sharedInstance().show()
71+
}
6072
}
6173

6274

0 commit comments

Comments
 (0)