Skip to content

Instantly share code, notes, and snippets.

@hanfengs
Last active December 22, 2021 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanfengs/ddbba34ed843454c842212b4c6745132 to your computer and use it in GitHub Desktop.
Save hanfengs/ddbba34ed843454c842212b4c6745132 to your computer and use it in GitHub Desktop.
[swift推送的处理] #swift
-------------------------------------------------------
// push receive 情况
if topVC is LiveShowDetailController && LiveShowService.shared.currentChannel?.host.id == AuthAccount.current?.id{
canDisplay = false
}
if topVC is MainTabViewController {
if let child = UIApplication.getChildViewController(parent: topVC), child is LiveShowDetailController {
if LiveShowService.shared.currentChannel?.id == info.roomId {
canDisplay = false
}
}
}
if topVC is LiveShowDetailController && LiveShowService.shared.currentChannel?.id == info.roomId {
canDisplay = false
}
----------------------------------------------
// push click 情况
if LiveShowService.shared.currentChannel?.host.id == AuthAccount.current?.id || LiveShowService.shared.currentChannel?.id == info.roomId {
return
}
if let topVC = UIApplication.getTopViewController(), topVC is MainTabViewController {
if let child = UIApplication.getChildViewController(parent: topVC), child is LiveShowDetailController {
let liveShowDetail = child as! LiveShowDetailController
liveShowDetail.dismissLiveShowClick()
return
}
}
if let topVC = UIApplication.getTopViewController(), topVC is LiveShowDetailController {
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment