From 4a3cabf3528cd84a76467bbc183f4ccb8b8c38a5 Mon Sep 17 00:00:00 2001 From: darronschall Date: Thu, 18 Apr 2024 08:20:55 -0400 Subject: [PATCH] Remove SwiftUI `stateNullable` helper for `StringDesc` The `StringDesc` protocol comes from projects that also incorporate moko-resources. For projects that use only moko-mvvm, this code was generating a compiler error: ``` ViewModelStateNullable.swift:99:60: Cannot find type 'StringDesc' in scope ``` Note that this particular helper didn't have a corresponding `state` version in `ViewModelState`. After this change, both `state` and `stateNullable` are consistent in terms of the methods they offer. --- .../mokoMvvmFlowSwiftUI/ViewModelStateNullable.swift | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mvvm-flow/apple/xcode/mokoMvvmFlowSwiftUI/ViewModelStateNullable.swift b/mvvm-flow/apple/xcode/mokoMvvmFlowSwiftUI/ViewModelStateNullable.swift index b0fbdf4..0bee107 100644 --- a/mvvm-flow/apple/xcode/mokoMvvmFlowSwiftUI/ViewModelStateNullable.swift +++ b/mvvm-flow/apple/xcode/mokoMvvmFlowSwiftUI/ViewModelStateNullable.swift @@ -95,14 +95,6 @@ extension ObservableObject where Self: ViewModel { mapper: { $0 as? Array } ) } - - func stateNullable(_ flowKey: KeyPath>) -> String? { - return stateNullable( - flowKey, - equals: { $0 === $1 }, - mapper: { $0?.localized() } - ) - } func stateNullable(_ flowKey: KeyPath>) -> T? { return stateNullable(