Skip to content

Conversation

darronschall
Copy link
Contributor

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.

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.
Comment on lines -99 to -105
func stateNullable(_ flowKey: KeyPath<Self, CStateFlow<StringDesc>>) -> String? {
return stateNullable(
flowKey,
equals: { $0 === $1 },
mapper: { $0?.localized() }
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's should not be deleted. it's should be moved to mvvm-flow-resources

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I'll make that change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, there isn't a separate mvvm-flow-resources SwiftUI project (something like mokoMvvmFlowResourcesSwiftUI) to move this particular piece of code to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants