Visual_Novel_iOS/crush/Crush/Src/Utils/AppNotificationName.swift

72 lines
1.8 KiB
Swift
Raw Normal View History

2025-10-09 10:29:35 +00:00
//
// CLNotificationName.swift
// Crush
//
// Created by Leon on 2025/7/12.
//
import Foundation
enum AppNotificationName: String {
// MARK: Util
case networkChanged
case networkRestored //
// MARK: Base
case userInfoUpdated
case userLogout
case userLoginSuccess
case presentSignInVc
case appLanugageChanged
case tzImagePickerNoti
// MARK: AI Role
// AI Role
case aiRoleCreatedOrDelete
case aiRoleInfoChanged
// Album
case aiRoleAlbumPhotoInfoChanged // AI
case aiRoleAlbumAddOrDelete
case aiRoleRelationInfoUpdated // AI
// MARK: Msg
case unreadCountChanged // Combine
// MARK: Pay & Iap & Wallet
case chargeDonePushTradeId
case walletInfoUpdated
// MARK: Chat
case chatNaviMoreRedDotChanged
case chatPersonaUpdated
case chatSettingUpdated
case chatSettingBackgroundChanged
case chatSettingBackgroundListUpdated //
// MARK: Heartbeat
case heartbeatRelationHiddenUpdate
// MARK: VIP
case vipStateChange
case buyCreditsOnce
var stringValue: String {
return rawValue
}
var notificationName: NSNotification.Name {
return NSNotification.Name(stringValue)
}
static func post(name: AppNotificationName, object: Any? = nil, userInfo: [String: Any]? = nil) {
NotificationCenter.default.post(name: name.notificationName, object: object, userInfo: userInfo)
}
}
extension NotificationCenter {
static func post(name: AppNotificationName, object: Any? = nil, userInfo: [String: Any]? = nil) {
NotificationCenter.default.post(name: name.notificationName, object: object, userInfo: userInfo)
}
}