I consider what is the difference
@Published var isLoggedIn: Bool = false
var isLoggedIn: AnyPublisher<Bool, Never>
I know in the case of first I can use it directly in SwiftUI View i.e. create binding with $ sign and then for example use if $isLoggedIn.animation()
But how can I achieve the same with AnyPublisher<Bool, Never> it seems that there I need to call somewhere assign or sink and store(). To make it work. So creating binding from it in SwiftUI seems to be impossible like if $isLoggedIn.animation
Limitation of @Published is that I cannot make there custom observing. for example UserDefaults which I can do via AnyPublisher from UserDefaults.publisher.
As now it seems I need to have both and make AnyPublisher update @Published var
But I've thought that @Published is property wrapper that has underneath regular AnyPublisher so why I cannot make binding in SwiftUI view directly from AnyPublisher?