Hi, I'm Sarun — an iOS developer.

On this blog I share my working processes, tip and tricks, tools,
and problems I found along the way.


How to set a screen's background color in SwiftUI

Setting background color in SwiftUI is not as straightforward as UIKit. Let's learn how to do it.


How to resize an image view to fit a container view in SwiftUI

Learn how to fit an image view to any container.

Replicate 12 UIKit's contentMode options in SwiftUI

In UIKit, we have various ways to control an image's position and behavior in UIImageView with a help contentMode property. In SwiftUI, we only have fit and fill content mode. Let's see how we can replicate the rest.



SwiftUI: Explore the new declarative UI framework


More posts about SwiftUI

How to resize an image view to fit a container view in SwiftUI

Learn how to fit an image view to any container.

Replicate 12 UIKit's contentMode options in SwiftUI

In UIKit, we have various ways to control an image's position and behavior in UIImageView with a help contentMode property. In SwiftUI, we only have fit and fill content mode. Let's see how we can replicate the rest.

How to add background to your view in SwiftUI

Learn how hard or easy it is to add a background view in SwiftUI.

How to preview a device in landscape orientation with SwiftUI Previews

SwiftUI doesn't have a built-in way to preview for a device in landscape orientation at the moment, but we can simulate that with a few modifiers.

More posts about SwiftUI or explore other topics

UIKit: Learn the best of both worlds


More posts about UIKit

How to resize an UIImageView to fit a container view using auto layout

Learn how to fit image view to any container by changing Content Hugging Priority and Content Resistance Priority.

UIStackView padding

Learn how to add padding to your stack view's content.

Custom UIStackView spacing

Learn a lesser-known API to create a custom UIStackView spacing without nested them together.

Scaling custom fonts automatically with Dynamic Type

Font is an essential part of an app. A good selection of font would make your app stand out from the crowd. But whatever fonts you choose, you have to make sure it doesn't lose its core function, readability. You might feel reluctant to use a custom font in the past because you might lose the benefit of dynamic type goodness that Apple provides with their system font. Since iOS 11, this is no longer the case. You can easily use your custom font dynamic type.

More posts about UIKit or explore other topics

Swift: Learn every aspect of the language


More posts about Swift

Does Swift enum retain its associated value

An easy question that you might overlook. Learn this simple fact together in this article.

How to create custom operators and do operators overloading in Swift

Learn how to overload existing operators such as +, -, *, / or create a custom one (such as .^.).

Different ways to check if a string contains another string in Swift

Learn how to check if a string contains another string, numbers, uppercased/lowercased string, or special characters.

Different ways to compare string in Swift

String comparison is an essential operation for day to day job. Swift provides a few variations for this. We will visit them in this article.

More posts about Swift or explore other topics

Xcode: Learn tips and tricks about the tool


More posts about Xcode

What is the difference between Tuist init and scaffold

A brief summary of init and scaffold commands.

Tuist scaffold: How to use the Tuist template to create a new module for an ongoing project

Learn how the scaffold command helps you to bootstrap new components or features such as a new VIPER module or a new framework for your new feature.

Tuist init: How to use Tuist templates to bootstrap your project

Learn how to use, and limitations of tuist init, a command that bootstrap a new project.

Tuist Template: What is it and how to create them

The template is a way to group repetitive code structure into a reusable component. You will learn how to create them in this article.

More posts about Xcode or explore other topics