I
Size: a a a
I
AS
C
C
IB
🅰Б
d1: Double?? =
nil
let d2: Double?? = .some(
nil)
print("\((d1 ?? 1.0) ?? 2.0)")
print("\((d2 ?? 1.0) ?? 2.0)")
SP
SP
userNotificationCenter(
_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler:
@escaping@escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo
guard
let targetValue = userInfo["type"]
as? String
else {
return }
switch targetValue {
case "news":
openTournamentsVC(tabBarIndex: 0)
case "tournament":
openTournamentsVC(tabBarIndex: 1)
case "broadcast":
openTournamentsVC(tabBarIndex: 2)
case "content":
openTournamentsVC(tabBarIndex: 3)
default:
print("failed, target value: \(targetValue)")
}
completionHandler()
}
private
func openTournamentsVC(tabBarIndex: Int) {
guard
let window = (UIApplication.shared.connectedScenes.first?.delegate
as? SceneDelegate)?.window
else {
return }
guard
let tabBarController = window.rootViewController
as? UITabBarController
else {
return }
tabBarController.selectedIndex = tabBarIndex
}
AS
userNotificationCenter(
_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler:
@escaping@escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo
guard
let targetValue = userInfo["type"]
as? String
else {
return }
switch targetValue {
case "news":
openTournamentsVC(tabBarIndex: 0)
case "tournament":
openTournamentsVC(tabBarIndex: 1)
case "broadcast":
openTournamentsVC(tabBarIndex: 2)
case "content":
openTournamentsVC(tabBarIndex: 3)
default:
print("failed, target value: \(targetValue)")
}
completionHandler()
}
private
func openTournamentsVC(tabBarIndex: Int) {
guard
let window = (UIApplication.shared.connectedScenes.first?.delegate
as? SceneDelegate)?.window
else {
return }
guard
let tabBarController = window.rootViewController
as? UITabBarController
else {
return }
tabBarController.selectedIndex = tabBarIndex
}
AS
userNotificationCenter(
_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler:
@escaping@escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo
guard
let targetValue = userInfo["type"]
as? String
else {
return }
switch targetValue {
case "news":
openTournamentsVC(tabBarIndex: 0)
case "tournament":
openTournamentsVC(tabBarIndex: 1)
case "broadcast":
openTournamentsVC(tabBarIndex: 2)
case "content":
openTournamentsVC(tabBarIndex: 3)
default:
print("failed, target value: \(targetValue)")
}
completionHandler()
}
private
func openTournamentsVC(tabBarIndex: Int) {
guard
let window = (UIApplication.shared.connectedScenes.first?.delegate
as? SceneDelegate)?.window
else {
return }
guard
let tabBarController = window.rootViewController
as? UITabBarController
else {
return }
tabBarController.selectedIndex = tabBarIndex
}
I
I
🅰Б
I
🅰Б
I
AS
AS
Д