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.

Get weekly updates on new posts


7 ways to pass a closure as an argument in Swift

There are many ways we can satisfy a closure argument. Some of them do not even look like closure. Let's learn all of them in this article.


How to make a custom button style with UIButton.Configuration in iOS 15

Learn how to create an outline button style.

How to set custom CodingKey for the convertFromSnakeCase decoding strategy

The thing you should know before using the convertFromSnakeCase decoding strategy.



SwiftUI: Explore the new declarative UI framework


More posts about SwiftUI

How to show multiple alerts on the same view in SwiftUI

If you have ever worked with an app with multiple alerts, please beware that the system can present only the latest or outermost one. Let's see how we can mitigate this.

How to present an alert in SwiftUI in iOS 13/14

Learn how to show an alert (UIAlertController) in SwiftUI.

How to do print debugging in SwiftUI

Learn how to add a print() in a SwiftUI view.

Pop-Up Buttons in SwiftUI

Learn how to create macOS pop-up buttons in SwiftUI.

More posts about SwiftUI or explore other topics

UIKit: Learn the best of both worlds


More posts about UIKit

How to ignore safe area insets in UIKit

Learn how to make UIScrollView, UITableView, and UICollectionView ignore safe area insets and put their content behind that navigation bar.

Dynamic button configuration in iOS 15

Learn how to change button configuration, e.g., title and color, based on the internal and external changes.

A new way to style UIButton with UIButton.Configuration in iOS 15

The first part in the series "What's new in UIKit button". An introduction to a new button configuration, a struct that is shaping and styling your button. You no longer need to subclass UIButton ever again with button configuration.

How to resize and position an image in UIImageView using contentMode

Learn thirteen ways to position and resize UIImage in UIImageView.

More posts about UIKit or explore other topics

Swift: Learn every aspect of the language


More posts about Swift

How to set custom CodingKey for the convertFromSnakeCase decoding strategy

The thing you should know before using the convertFromSnakeCase decoding strategy.

How to reference a method with the same name and parameters but a different return type in Swift

Trying to reference two methods with the same name and parameters will cause an ambiguous compile error. Learn how to resolve it.

Different ways to catch throwing errors from Swift do-catch

It is tempting to just catch all a throwing error in a single catch clause and call it a day, but not all errors are created equals, and you should treat it as such.

How to explicitly specialize a generic function in Swift

Learn a workaround to specify a type for your generic functions.

More posts about Swift or explore other topics

Xcode: Learn tips and tricks about the tool


More posts about Xcode

4 Xcode shortcuts to get back your screen space

Working on your MacBook without an external monitor can be troublesome due to the small screen size. I will show you 4 Xcode shortcuts that might mitigate the situation.

Preview a device in landscape orientation with previewInterfaceOrientation

New in iOS 15, SwiftUI has finally support preview in landscape orientation. Let's find out how to do it.

How to use a pre-release Swift version with command-line tools

Each Xcode version comes with a specific Swift toolchain. If you want to prepare your app for a new feature and make it work with CI, you want to make your tools, e.g., Fastlane and xcodebuild know about the new toolchain. Let's see how we can switch between different Swift toolchains with command-line tools.

How to use a pre-release Swift version in Xcode

Each Xcode version comes with a specific Swift toolchain, but you don't have to wait for a new Xcode version to try the new Swift features. Let's see how we can switch between different Swift toolchains in Xcode.

More posts about Xcode or explore other topics