Bridging Legacy APIs with MainActor.assumeIsolated
Despite strict concurrency checking having been available for some time, many official Apple APIs remain inadequately adapted—a situation likely to persist for the foreseeable futu
Technical notes and articles migrated from Ghost, organized into iOS, Android, Unity, and Other.
Despite strict concurrency checking having been available for some time, many official Apple APIs remain inadequately adapted—a situation likely to persist for the foreseeable futu
While the primary goal of Swift’s strict concurrency checking is noble, it has introduced significant friction in single-threaded scenarios. Developers often find themselves clutte
Which Context Should You Use in Android? Context is everywhere in Android, but choosing the wrong one can lead to memory leaks, broken UI, or hard‑to‑debug crashes. This article ex
Swift 6 introduces a suite of powerful new concurrency features and keywords. While many of these may not see daily use, encountering specific edge cases without a solid grasp of t
Surprisely, Xcode 26.3 now features out-of-the-box support for Claude Code/Codex. Finally, developers can elegantly leverage native AI Agents directly within the Xcode environment.
SwiftUI is the modern way to build interfaces on Apple platforms, but most production apps still rely on UIKit. The good news is that you do not need a full rewrite. Apple designed
Kotlin lazy vs lateinit : When to Use Each Kotlin gives you two common ways to defer initialization of a property: lazy and lateinit . They look similar on the surface, but they so
Apple release the new iOS SDK every day, as the developer, we want to test our apps on those new SDK before they are officially released. For example, we want to have the iOS 17 be
If you are like me, the project is still using the pod to manage the libraries and frameworks. We need to clean the projects from time to time. The following command can help us to
A nested class in Swift is a class that is defined within another class. Some key features: Nested class have access to local variables or constants of the outer class unless these
In this article we will dig a bit more depth in some core concepts on 2 hours to master RxSwift - Part 1 . Section 1: Observable Like mentioned in the last article, an Observable i
Introduction In the previous post: 2 hours to master RxSwift - Part 1 (needone.app) and 2 hours to master RxSwift - Part 2 (needone.app) , we get to know the the core concept behin
a simple introudction on rxswift, including what is rxswift, how to use it and a quick example (with swift code) on demo that.
In the Kotlin programming language, a singleton is a design pattern that allows you to create only one instance of a class. This is useful when you want to make sure that there is
The keystore is a secure storage location in Android that is used to store encryption keys, digital certificates, and other sensitive information. The keystore is encrypted with a
Learn the difference between Swift generics and Any, including type safety, type casting, and when each approach makes sense in real code.
An indirect enum in Swift is an enum that can be used to define a recursive data structure. This means that one or more of its cases can refer to an instance of the same enum type.
UITraitCollection is a class in the UIKit framework that defines a set of interface traits that specify the environment in which your app is running. These traits include the devic
UIKit and SwiftUI are two different frameworks for building user interfaces on Apple platforms. UIKit UIKit is the older of the two frameworks, and has been around since the early
With the last article ( Certificate pinning and Public key pinning ), we know the concept of Certificate pinning and Public key pinning, and how to implement them in iOS. This arti
Certificate pinning and public key pinning are both techniques that are used to enhance the security of a network connection by ensuring that the client trusts only a specific cert
In Android, we can get the image from synchronously and asynchronously, but it is more common to see in the later. Download image synchronously To download an image from a URL in K
Many of us have met the situation that we have an array/list of custom objects, and we want them can be sorted in a specific order. For example, we are have a group of people, and
In previous post, we have gone through most of the key concepts and methods in Coroutine: Kotlin Coroutines Table Content 1, Introduction to Coroutine in Kotlin 2, Non-blocking in
Recently I have done quite an amount of work on formatting currency in Swift project, here are some tricks on how to format number in Swift: Format currency with auto currency symb
In the Kotlin programming language, the term "lazy" typically refers to a type of property or variable that is only initialized when it is first accessed, rather than when the cont
To get the current week in Swift 5, you can use the Calendar and DateComponents classes to calculate the week number for the current date. Here's an example of how you might do thi
In iOS, the SceneDelegate is a class that is responsible for managing the scenes in your app. A scene is a discrete unit of your app's user interface, such as a window or tab. The
A data race in Swift occurs when two or more threads access the same memory location simultaneously and at least one of them is writing to it, without proper synchronization. This
In Kotlin, you can use the URLEncoder class to encode a URL string so that it can be safely transmitted over the internet. The URLEncoder class is part of the Java standard library
Both the @AppStorage and @UserDefault property wrappers in SwiftUI allow you to store and retrieve data using UserDefaults. However, there are a few key differences between the two
HTTP encoding, also known as percent-encoding or URL encoding, is a way of encoding special characters in URLs and other HTTP data, such as headers and body content. HTTP encoding
To get the location (latitude and longitude) of a device in Swift, you can use the Core Location framework, which is an official library from Apple. Only 2 steps are required, so i
It is quite common to see that we can correctly set up the HTTP header, token, body and POST/GET methods in our iOS code, but we still can't get the right response. Here is an erro
activity property In the Android framework, the Activity class represents an app's UI and provides an interface for the app to interact with the system. The activity property in a
Kotlin Coroutines Table Content 1, Introduction to Coroutine in Kotlin 2, Non-blocking in Kotlin Coroutines 3, Start and Suspend a Coroutine in Kotlin (This article) With the previ
Kotlin Coroutines Table Content 1, Introduction to Coroutine in Kotlin 2, Non-blocking in Kotlin Coroutines (This article) 3, Start and Suspend a Coroutine in Kotlin (incoming this
A Coroutine is a lightweight thread of execution that can be suspended and resumed later. There are already many articles or topics covering this but this post is different, it is
A nested method in Swift is a method or function that is defined within another function. Nested functions have the following characteristics: They have access to all variables and
As mentioned in the other article: Popup Custom View in UIKit : popup mainly can be: popup an alert using UIAlertController popup action sheet using UIAlertController. For more det
To create a custom view in Kotlin, you can create a new subclass of View and override the onDraw method to draw the view's content. Then, you can add any additional properties or b
In UIKit, popup mainly can be: popup an alert using UIAlertController popup action sheet using UIAlertController . For more details, check this: Present action sheet in UIKit and S
This post is going to list some of the most frequently used compiler directives in Swift, compatible in Swift 3/4/5. Someone might call this preprocessor directives , but they are
An action sheet is a component that displays a set of choices to the user in a modal format. UIKit In iOS, you can create an action sheet using a UIAlertController with the .action
The defer keyword in Swift is used to execute a block of code at the end of the current scope, regardless of how the scope is exited. The defer block is executed after any return s
Many of us have heard about the Command pattern or used them in the development, which is a behavioral design pattern in which an object is used to encapsulate all of the informati
What is XCTUnwrap and how to use it to help you effectively while you are doing the unit test? XCTUnwrap is a utility function that is used in unit tests to unwrap optional values.
A Property List (PLIST) file is a file format used by macOS and iOS to store serialized data. It is often used to store data such as user preferences, settings, and other informati
YAML (YAML Ain't Markup Language) is commonly used for configuration files, but can be used in many applications where data is being stored or transmitted. A YAML file consists of
What is Property Wrapper Property wrapper are a language feature that allows you to wrap a piece of code around a property in Swift world, which can help us to add additional behav