Commit 9a054045 authored by pete谢兆麟's avatar pete谢兆麟

优化backToHomeIndex的参数方法

parent feccac02
...@@ -658,10 +658,12 @@ extension YHJsApi { ...@@ -658,10 +658,12 @@ extension YHJsApi {
//23.返回 银河甄选 //23.返回 银河甄选
@objc func backToHomeIndex(_ index: Any) { @objc func backToHomeIndex(_ index: Any) {
DispatchQueue.main.async { DispatchQueue.main.async {
let value : Int = index as? Int ?? 1
UIViewController.current?.navigationController?.popToRootViewController(animated: false) UIViewController.current?.navigationController?.popToRootViewController(animated: false)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) { DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) {
UIViewController.current?.tabBarController?.selectedIndex = 0 UIViewController.current?.tabBarController?.selectedIndex = 0
NotificationCenter.default.post(name: YhConstant.YhNotification.backToHomeNotification, object: nil, userInfo: ["value":1]) NotificationCenter.default.post(name: YhConstant.YhNotification.backToHomeNotification, object: nil, userInfo: ["value":value])
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment