Shih Ting Huang (Neo)
Shih Ting Huang (Neo)
Here's the article about the MVVM part of the code: https://medium.com/flawless-app-stories/how-to-use-a-model-view-viewmodel-architecture-for-ios-46963c67be1b
hi, thank you @tbfyniiswcy for explaining 👍 Yes, I created this class only for simulating network requests, which is usually executed on the background thread (and it is in the...
Yes, it might cause problems like the closure is triggered before the UI is set. If the initView is replied on the closure, it's better to either explicitly assign the...
因為Observable是有一個泛型T的類別,如果不希望這個T永遠是optional的話,就沒辦法指定default value是nil ```swift class Observable { let value: T? = nil // T一定要包成optional才有辦法default nil } ``` 如果真的很想要default nil的話,可以subclass它並且指定optional型別 ```swift class NullableObserver: Observable { override init(value: U? = nil) { super.init(value:...
Hello 的確那個viewModel?.cellPressed = nil是需要拿掉的 抱歉這個應該是程式的bug 如果設定cell的view model時沒有參照到sel或者有記得用weak self,就不用擔心Retain cycle的問題囉
hi Sreejith, Thank you for your kind words :) Normally the viewController is actually pushed by the FeedListViewController. As for the implementation, we create a function in the FeedListViewController, which...