From 7a5785fb5de3477c199f76a25f4d53fb3313de30 Mon Sep 17 00:00:00 2001 From: bluesea <307723040@qq.com> Date: Wed, 5 Jun 2024 10:50:14 +0800 Subject: [PATCH] =?UTF-8?q?lunchviewcontroller=E4=B8=AD=E6=B7=BB=E5=8A=A0d?= =?UTF-8?q?ebug=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/MP_LunchViewController.swift | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/MusicPlayer/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift b/MusicPlayer/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift index 9dce3b6..0fd8ced 100644 --- a/MusicPlayer/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift +++ b/MusicPlayer/MP/Common/Base(公用基类)/Controllers/MP_LunchViewController.swift @@ -31,6 +31,28 @@ class MP_LunchViewController: UIViewController { timer.add(to: RunLoop.current, forMode: .common) //获取idfa _ = requestTrackingAuthorization(self) + +#if DEBUG + self.completionBlock = { + DispatchQueue.main.async { + [weak self] in + guard let self = self else {return} + //停止计时器 + timer.isPaused = true + //加载完毕,判断并跳转 + accessAppdelegate.switch_positive() + } + } +#else + chekStatus() + +#endif + //启动计时器 + timer.isPaused = false + } + + //检测status状态 + func chekStatus() { MP_AnalyticsManager.shared.getOpenStatus { [weak self] open in guard let self = self else {return} if open { @@ -79,9 +101,9 @@ class MP_LunchViewController: UIViewController { } } } - //启动计时器 - timer.isPaused = false } + + deinit { //销毁计时器 timer.invalidate()