Open in app

Sign In

Write

Sign In

Tonny
Tonny

57 Followers

Home

About

May 4, 2022

How to make protocol work in SwiftUI

SwiftUI view accepts several data types to render its content: raw types, State, Binding and ObservableObject (through StateObject or ObservedObject property wrapper). In ObservableObject conforming type, we usually use Published property wrapper to wrap the actual data for views. Besides these, are there any other ways? You may want to…

Swift

2 min read

How to make protocol work in SwiftUI
How to make protocol work in SwiftUI
Swift

2 min read


Feb 24, 2022

How to mock API in Swift

When 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 the database as repetitive tests run, it also introduces extra complexity as concurrent threads get involved. In this story, I’ll list four different mocking…

I OS

4 min read

How to mock API in Swift
How to mock API in Swift
I OS

4 min read


Apr 10, 2021

Yet Another Strategy to Sync Local Database with Paging API

When talking about syncing local data with the remote data source, it’s about Insert, Delete and Update entity in the local database according to the response of API. Considering creating, deleting or updating occur in an arbitrary position of a paging API, the synchronization becomes a little complicated. …

I OS App Development

4 min read

Yet Another Strategy to Sync Local Database with Paging API
Yet Another Strategy to Sync Local Database with Paging API
I OS App Development

4 min read


Mar 18, 2021

How to update view in Swift MVVM?

There are two essential ideas in a well-designed MVVM: unidirectional data flow and weak reference to the view. The flow of data in MVVM is unidirectional, the data was aroused from user or system event, and then it flows to viewModel, model, and view at last. You can implement the…

Swift

6 min read

How to update view in Swift MVVM?
How to update view in Swift MVVM?
Swift

6 min read


Feb 5, 2021

Kotlin vs Swift — Enumeration

I love programming in Android and iOS platforms with Kotlin and Swift, I will demonstrate the difference and similarity of enumeration using code in this post, it is part of this language comparison series. Definition of Enumeration Kotlin In Kotlin, each enum constant is an object. enum class Direction { NORTH, SOUTH, WEST, EAST…

Swift

6 min read

Kotlin VS Swift — Enumeration
Kotlin VS Swift — Enumeration
Swift

6 min read


Sep 3, 2020

Don’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 which we can leverage to speed up iOS development. In this story, I will take faker.js …

Swift

3 min read

Don’t Repeat Yourself —  Leverage Javascript library in Swift.
Don’t Repeat Yourself —  Leverage Javascript library in Swift.
Swift

3 min read


Jul 26, 2020

Swift KeyPath is awesome

This story is an extension of the previous stories of Data Binding with KeyPath Part1 and Part2. Data Binding with MVVM on iOS part 1: Data flows Android provides data binding to listen to the model’s change and update binding views. But how to implement it in…medium.com Data Binding with MVVM on iOS part 2: KeyPath and Type Erasure This story is about how I implement one-way and two-way data binding with Swift KeyPath.medium.com

Swift

4 min read

Swift KeyPath is awesome
Swift KeyPath is awesome
Swift

4 min read


Published in Dev Genius

·Jul 12, 2020

Data Binding with MVVM on iOS part 2: KeyPath and Type Erasure

This story is about how I implement one-way and two-way data binding with Swift KeyPath. Before reading this story, you may need to check out part1 to know which data-flow strategy I’m taking. Data-binding in iOS part 1: Data flows in MVC Android provides data binding to listen to the model’s change and update binding views. But how to implement it in…medium.com Why KeyPath? \TypeName.path 1. Dynamic and Consistency

Swift

8 min read

Data Binding with MVVM on iOS part 2: KeyPath and Type Erasure
Data Binding with MVVM on iOS part 2: KeyPath and Type Erasure
Swift

8 min read


Published in Dev Genius

·Jul 2, 2020

Data Binding with MVVM on iOS part 1: Data flows

Android provides data binding to listen to the model’s change and update binding views. That’s where I love Android development more than iOS development. In this story, I’ll implement data-binding with Swift KeyPath, and probably you have a better idea. Welcome to comment. From this form design, you can easily…

I OS App Development

4 min read

Data Binding with MVVM on iOS part 1: Data flows
Data Binding with MVVM on iOS part 1: Data flows
I OS App Development

4 min read


Jun 15, 2020

RecyclerView 2020: when recyclerview meets data-binding

This post is about how to use only one RecyclerAdapter to deal with multiple recycler views with Android Jetpack, and it’s inspired by a post from Anton Stulnev. In this demo, I use PagedListAdapter, but you don’t have to. For the complete project written in Android Jetpack, you can view…

Android App Development

3 min read

RecyclerView 2020: when recyclerview meets data-binding
RecyclerView 2020: when recyclerview meets data-binding
Android App Development

3 min read

Tonny

Tonny

57 Followers

Mobile developer@NZ. iOS, Android, React

Following
  • StartUp Health

    StartUp Health

  • Romin Irani

    Romin Irani

  • Amit Shekhar

    Amit Shekhar

  • Dhananjay Trivedi

    Dhananjay Trivedi

  • David Gilbertson

    David Gilbertson

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech