You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while trying to implement OpenCombine to mimic missing Combine Framework in example in Xcode 11.3.1 projects where Swift does also not support @Published directive (nor @Bind , @StateObject or @ObservedObject) one could do something like..
@propertyWrapperstructPublished<T>{varwrappedValue:T{
willSet {/*...*/}
didSet {/*...*/}}init(wrappedValue:T){// * -- maybe magic here! -- *//* or do more specific stuff.. ^^ switch (wrappedValue) { //case is Optional<Any>.Type : //break case is Bool : break case is Error : break case is Optional<Error>.Type : break default: break } */self.wrappedValue = wrappedValue
}}
to implement such feature in Swift version prior .. where @propertyWrapper directive is available.
So the question is what should such wrapper look like in its inner logic?
while trying to implement
OpenCombine
to mimic missingCombine
Framework in example in Xcode 11.3.1 projects where Swift does also not support@Published
directive (nor@Bind
,@StateObject
or@ObservedObject
) one could do something like..to implement such feature in Swift version prior .. where
@propertyWrapper
directive is available.So the question is what should such wrapper look like in its inner logic?
opened a question in StackOverflow
it could be wrapped also in preprocessor directives like
#if !canImport(Combine)
or similar to limit where it would be applied in projectsalso see: swiftbysundell.com/accessing-a-swift-property-wrappers
The text was updated successfully, but these errors were encountered: