Photo by Cameron Venti on Unsplash

What is Data in SwiftUI?

Anytime the data changes, the view needs to update. View depends on the data. In our case: a view establishes a direct dependency on specific data / a specific data source.

When building a new view, start by first asking yourself:

  1. What data does this view need?
  2. How will the…

Photo by Joshua Reddekopp on Unsplash

It’s been a while since Apple introduced the Combine framework with iOS 13 in 2019, but I only recently decided to learn it because the majority of active iOS devices are now running iOS 13. There are plenty of resources on the internet (free or paid, reads or code-along) that…

an empty table

The Requirements

I don’t need to have expert knowledge in user experience to realize that users don’t like to be left in ambiguity. Users require an immediate and clear visual indicator of the current state of the product they are using. In real life, when there is nothing on the table, we…

Photo by Jakob Owens on Unsplash

When I first learned SwiftUI, I was amazed by how much is done automatically for us by SwiftUI. For example, I no longer have to write custom UIView.animateWithDurations remember to make constraint changes outside and call view.layoutIfNeeded inside animation block.

We get a lot of conveniences when using SwiftUI. For…

Binoculars illustration by @titopixel

Key-Value Observing pattern, commonly known as the KVO pattern had existed since the inception of Cocoa. It is used to notify objects about changes to the properties of other objects.

When it comes to communicating changes between logically separated parts of your app, we have several options. …

Localizing image assets interface

Xcode’s graphical interface provides a convenient and powerful way to manage image assets and you should already be familiar with how it is used if you’ve ever included images in your app.

Turns out, it not only lets you manage image assets but also allows you to localize your image…

Illustration of Responder Chain

Let’s start with a quiz. Consider the view structure:

Localization illustration by Esther from Pexels

Xcode had evolved a lot, making it easier than ever to make your app support multiple languages. This post will focus on exporting and importing localization files using Xcode and assumes you have enough knowledge about the process of localization or internalization.

If you need more information on implementing localizations…

Photo by Donald Tong from Pexels

The Requirement

I started implementing an AVPlayer with standard capabilities. The user can play, pause, and drag the slider (implemented with an UISlider) to seek a point in the video.

While dragging, the player will stop updating the slider with the current progress derived from player.currentTime() / player.duration. Usually, this is done…

Photo by Skitterphoto from Pexels

We should all be familiar with the action sheet that iOS uses in the system settings and Apple native apps:

Jianyuan Chen

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store