TonnyHow to make protocol work in SwiftUISwiftUI view accepts several data types to render its content: raw types, State, Binding and ObservableObject (through StateObject or…2 min read·May 4, 2022----
TonnyHow to mock API in SwiftWhen we write unit tests or UI tests for applications, sending the actual API request to hit the backend is a waste and it perhaps pollutes…4 min read·Feb 24, 2022--1--1
TonnyYet Another Strategy to Sync Local Database with Paging APIWhen talking about syncing data with the remote data source, it’s all about Insert, Delete and Update entity in the local database…4 min read·Apr 10, 2021----
TonnyHow to update view in Swift MVVM?There are two essential ideas in a good MVVM: unidirectional data flow and weak reference to the view.6 min read·Mar 18, 2021--1--1
TonnyKotlin VS Swift — EnumerationI love programming in Android and iOS platforms with Kotlin and Swift, I will demonstrate the difference and similarity of enumeration6 min read·Feb 5, 2021----
TonnyDon’t Repeat Yourself — Leverage Javascript library in Swift.In the early stage of iOS development, we may need some mocking data or generated data to feed UI. And there are some awesome JS libraries…3 min read·Sep 3, 2020----
TonnySwift KeyPath is awesomeSwift KeyPath is awesome in many fields: data binding, validation, calculation, collection etc.4 min read·Jul 26, 2020----
TonnyinDev GeniusData Binding with MVVM on iOS part 2: KeyPath and Type ErasureThis story is about how I implement one-way and two-way data binding with Swift KeyPath.8 min read·Jul 12, 2020----
TonnyinDev GeniusData Binding with MVVM on iOS part 1: Data flowsAndroid provides data binding to listen to the model’s change and update binding views. But how to implement it in Swift?4 min read·Jul 2, 2020----
TonnyRecyclerView 2020: when recyclerview meets data-bindingThis post is about how to use only one RecyclerAdapter to deal with multiple recycler views with Android Jetpack3 min read·Jun 15, 2020----