From f55b5054288180a49f2bd1c427177a4096d7b0e2 Mon Sep 17 00:00:00 2001 From: WindowsMEMZ <45706356+WindowsMEMZ@users.noreply.github.com> Date: Wed, 15 Nov 2023 00:23:20 +0800 Subject: [PATCH] Update CodeExt.swift --- DarockBili Watch App/Extension/CodeExt.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DarockBili Watch App/Extension/CodeExt.swift b/DarockBili Watch App/Extension/CodeExt.swift index 355d492ae..f2631cf4b 100644 --- a/DarockBili Watch App/Extension/CodeExt.swift +++ b/DarockBili Watch App/Extension/CodeExt.swift @@ -239,21 +239,21 @@ extension Int { } } -postfix operator ? +postfix operator / extension Optional { - static postfix func ? (opt: Int?) -> Int { + static postfix func / (opt: Int?) -> Int { return opt ?? 0 } - static postfix func ? (opt: String?) -> String { + static postfix func / (opt: String?) -> String { return opt ?? "" } - static postfix func ? (opt: Double?) -> Double { + static postfix func / (opt: Double?) -> Double { return opt ?? 0.0 } - static postfix func ? (opt: Float?) -> Float { + static postfix func / (opt: Float?) -> Float { return opt ?? 0.0 } - static postfix func ? (opt: Bool?) -> Bool { + static postfix func / (opt: Bool?) -> Bool { return opt ?? false } }