Let's say we created a (var) variable which can be a Bool or String or any kind and we can change this variable with a function or button or anything you imagine. I am interested to build a notification or observation way that put's this value under magnifying glass and it is sensitive to value change of this variable.
How we can make it possible in both platform SwiftUI and UIKit?
PS: I know the usage of @State and .onChange, I am trying to observe with custom way.