Closed harry1064 closed 3 years ago
Yes you are right. But it is used only to bind from View controller on viewDidLoad. So all observers are added from main thread always. Sure for other cases we would need to add thread safety. But I there is no such case in this example project. Also if thread safety is needed it can be added easily using serial queue DispatchQueue. But at big companies I worked so far the Observable thread safety was not needed.
Observable class is not thread-safe. As adding observer from different threads can cause crash.