Khoa Pham
Khoa Pham

Ohayo

Swift Discovery

Discover all the tech

How to master ScrollView in SwiftUI

Issue #1073

ScrollView started as a plain container in SwiftUI. Every release since iOS 17 has added modifiers to it: paging, snapping, reading the offset, reacting to phases, and with iOS 26 the edge effects that sit under Liquid Glass bars. iOS 27 …

How to style and animate SF Symbols in SwiftUI

Issue #1072

SF Symbols ship with thousands of icons, and most apps use them as plain tinted images. That leaves a lot on the table. Each symbol is built from layers, comes in several shapes and weights, can show a value, and can move. This article …

How to use communication pattern in Swift

Issue #1071

Sooner or later one object needs to tell others that something happened. A music player starts a new track, a download finishes, the network drops. Swift gives us many ways to send that message, and picking the right one depends mostly on …

How to make your apps stand out on the App Store

Issue #1070

Besides coming up with a good idea and building the app, there are many other things you can do to boost your app’s visibility. I first wrote these notes as a Twitter thread in April 2021, based on Apple’s promote your app …

How to follow App Store review guidelines

Issue #1069

Apple’s App Review Guidelines are long and hard to read. This article covers the parts that matter most, in plain words.

When you break a rule, one of three things happens:

  1. Rejected. Apple turns down your update. You fix it and try …

How to make AI agent harness in Swift

Issue #1068

An AI agent is really just a loop. Your code sends a conversation to a language model, the model asks to run a tool, your code runs it and sends the result back, and this repeats until the model has enough to answer. The code around that …

How to use SwiftNIO

Issue #1067

SwiftNIO is Apple’s networking framework for building servers and clients that move a lot of data without blocking threads. It powers Vapor, the AWS SDK for Swift, and gRPC Swift, and you can also reach for it directly when you need …

How to build an MCP server in Swift

Issue #1066

The Model Context Protocol gives an AI assistant a standard way to discover and call tools outside the model itself. If you already have Swift code worth exposing, the official swift-sdk handles the JSON-RPC framing and the handshake for …

How to add swipe actions outside List in SwiftUI

Issue #1065

Swipe actions used to require List. Even when a ScrollView and LazyVStack were the better fit for layout and performance, a swipeable row meant falling back to List just to get that one interaction.

SwiftUI now lets you attach …

How to reorder in SwiftUI

Issue #1064

SwiftUI now ships a built-in way to let people drag items around in a list, stack, or grid, without writing gesture code or tracking drag offsets by hand.

The two pieces you need

Reordering splits into two responsibilities. The ForEach …

How to use Foundation Models in iOS

Issue #1063

Adding AI to an app used to mean calling a cloud API and accepting the latency, cost, and privacy trade-offs that come with it. The Foundation Models framework, introduced in iOS 26, removes that trade-off by giving you direct Swift …

How to adapt layout for iPhone Duo

Issue #1062

iPhone Duo is Apple’s first multi-display iPhone: a wide inner display split by a hinge, an outer display with its own aspect ratio, and support for split view multitasking and multiple scenes like iPad. If your app assumes a single …

How to change scroll edge effect in SwiftUI

Issue #1061

Starting with iOS 26, scroll views automatically blur their content where it slides behind a toolbar, tab bar, or any other pinned control. This is the scroll edge effect, and it’s part of the new Liquid Glass design language. Apple …

How to safely modify resource policy in other CDK Stack

Issue #1060

Imagine a single IAM role that lives outside your stack, created once and reused by many deployments. Maybe it belongs to a partner service, a shared gateway, or a piece of platform infrastructure that several teams call into. Your CDK …

How to configure AgentCore Gateway to target a private API Gateway in AWS

Issue #1059

Amazon Bedrock AgentCore Gateway turns existing APIs into MCP tools. Its built-in API Gateway target only works with public, REGIONAL or EDGE API Gateways, because it relies on API Gateway’s export-to-OpenAPI capability, which does …

How to use API Gateway with private endpoint in AWS

Issue #1058

When you set endpointConfiguration.types to PRIVATE on a REST API, API Gateway still hands you a default URL, something like https://q6t71pmdq7.execute-api.eu-north-1.amazonaws.com/prod. That URL just will not resolve anywhere outside …

How to render markdown in SwiftUI

Issue #1057

Markdown is everywhere. Documentation, chat messages, AI responses, README files, most text-heavy apps eventually need to render it. SwiftUI has no built-in markdown view, so you have to build one. This article walks through the tools …

How to stream SSE with URLSession in Swift

Issue #1056

Most HTTP requests are short-lived: send a request, wait for a complete response, close the connection. Server-Sent Events (SSE) breaks that pattern. The server sends a continuous stream of data over a single persistent connection, …

How to stream web socket with URLSession in Swift

Issue #1055

Most HTTP requests follow a simple pattern: send a request, wait for a response, close the connection. WebSocket breaks that pattern. The connection stays open after the handshake, and both sides can push messages at any time without …

How Gradle works in a Kotlin project

Issue #1054

Open almost any Kotlin project and you find two files: settings.gradle.kts and build.gradle.kts. It is rarely obvious which one does what. To clear that up, we will build a tiny Kotlin app, add an external dependency on http4k, then split …

Khoa Pham

Hello, I’m Khoa

I’m a thinker and storyteller with a passion for exploring the intersection of creativity and technology

🧑‍💻 I love crafting high quality and useful apps
🔥 I love open source. My GitHub open source has 2.3k followers with packages that are integrated by 45k+ apps and over 3.4m+ downloads on CocoaPods.
✍️ I write here on my blog and on Medium, which has over 2.7k+ followers with tons of articles and 90k+ monthly views.
🖥 Follow me for sharings about Swift, SwiftUI, iOS and macOS development.
Hei