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

72 lines
1.8 KiB
Swift
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 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)
}
}