Ivan Carracedo Asensio
01/23/2024, 12:31 PM@ObjCName(name = "navigationtest")
@ShouldRefineInSwift
public var HomeViewModel.navigationtestValue: Boolean
get() = navigationtest.value
set(`value`) {
navigationtest.value = value
}
how can I refine that variable in swift?Rick Clephas
01/23/2024, 12:38 PMShouldRefineInSwift
declarations are prefixed with __
in Swift.
This prevents them from showing in Xcode autocomplete.
With a Swift extension for HomeViewModel
(or a subclass):
extension HomeViewModel {
var navigationtest: Bool {
get { __navigationtest }
set { __navigationtest = newValue }
}
}
you can access the hidden property and refine it however you like.
Obviously you would want a different implementation for the property as it’s currently not doing anything.Ivan Carracedo Asensio
01/23/2024, 12:40 PMIvan Carracedo Asensio
01/24/2024, 8:39 AMRick Clephas
01/24/2024, 10:02 AM@NativeCoroutinesState
annotation. This will generate a mutable property for the MutableStateFlow.
In that case there is no need to refine the property in Swift.Ivan Carracedo Asensio
01/24/2024, 11:55 AM