Technical writing archive
125 migrated posts from Ghost, organized into iOS, Android, Unity, and Other.
iOS
70 posts
-
iOS 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
-
iOS Default Actor Isolation: A Great Intention with New Challenges
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
-
iOS 🚀 Swift 6 Concurrency: Mastering @isolated(any) and #isolation
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
-
iOS Xcode 26.3 + Claude Agent: Model Swapping, MCP, Skills, and Adaptive Configuration
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.
-
iOS How to Use SwiftUI and UIKit Together
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
-
iOS Install specific iOS beta on simulator
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
-
iOS How to do a deep cleaning for pod
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
-
iOS Nested class in Swift
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
-
iOS 2 hours to master RxSwift - Part 2
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
-
iOS 2 hours to master RxSwift - Part 3
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
-
iOS 2 hours to master RxSwift - Part 1
a simple introudction on rxswift, including what is rxswift, how to use it and a quick example (with swift code) on demo that.
-
iOS Generic type vs. Any in Swift
Generic type In Swift, a generic type is a placeholder for a specific type that is specified when the generic type is used. A generic type allows you to write flexible and reusable
-
iOS indirect enum in Swift
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.
-
iOS UITraitCollection
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
-
iOS UIKit vs. SwiftUI - A general discussion
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
-
iOS Sort custom objects by property in Swift
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
-
iOS Format currency in Swift
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
-
iOS Get the current week in Swift
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
-
iOS SceneDelegate
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
-
iOS Data Racing in Swift
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
-
iOS @AppStorage vs. @UserDefault in SwiftUI
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
-
iOS Get location coordinates using CLLocationManager in Swift
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
-
iOS Encode URL in Swift
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
-
iOS Nested method in Swift
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
-
iOS Popup alert in Swift
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
-
iOS Popup Custom View in UIKit
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
-
iOS Compiler directives in Swift
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
-
iOS Present action sheet in UIKit and SwiftUI
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
-
iOS What is keyword defer in Swift
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
-
iOS Command pattern in Swift
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
-
iOS Have you tried XCTUnwrap before?
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.
-
iOS PLIST file in iOS
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
-
iOS Create Property Wrapper in Swift
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
-
iOS Workplace, Project, Scheme and Target in iOS development
Many of us have seen workspace , project , target and scheme quite often while doing the iOS development, but what are they exactly and how are they related with each other? Workpl
-
iOS Equatable and Comparable in Swift
It is quite common that we are required to compare two custom objects in Swift, luckily Swift has provided some built-in protocol allows us to do this in a "swift" way. Equatable I
-
iOS Difference between layoutIfNeeded vs. setNeedsLayout
As many of iOS developer known, layoutIfNeeded and setNeedsLayout are two methods that can be used to update the layout of a view and its subviews. But what are their differences?
-
iOS Constructor Injection, Property Injection vs. Method Injection
Dependency Injection is a design pattern that is providing another object with its dependencies, instead of having the object created or managed themselves. There are three main ty
-
iOS ContentHugging vs. ContentCompressionResistance in UIStackView
In Swift, it is quite common to see ContentHugging and ContentCompressionResistance either when we are using the storyboard or code to render the user interfaces in UIStackView . T
-
iOS A summary of use enum in Swift
Enumeration type is a common type in many programming languages, which normally presents a set of limited status for a program, such as list all the directions for a compass: enum
-
iOS Use Extension in Swift
Extension is a great feature in Swift, which can help us to create helper/utility variables and method, and etc. Use extension to conform protocols It is quite common to use protoc
-
iOS Property in Swift
Unlike other programming languages, there are three types properties in Swift. Stored Properties They are constants or variables of a class, and part of the class instances that us
-
iOS How to check whether a mobile device is muted or not on iPhone/iPad
On iOS devices, there are mainly two types of sounds: Ringtones and reminders: Including system sounds such as phone calls, text messages, notifications (also including key tones,
- iOS
Init vs Convenience init in Swift
Initializers, also known as constructors in other programming languages, have two types: Designated init and Convenience init . They are used to initialize properties or customize
-
iOS Git Merge vs Git Rebase
TLDR Both git rebase and git merge are used to synchronise changes between branches. The difference is git rebase will revise the commits but keep a clean organised history, while
- iOS
iPhone/iPad Redeem promo code to get free App in 2022
This will happen when developers decides to give out some free apps, which sometimes you will see the promo code like this EAJXJEXL7MJH . As many of you might know how to redeem th
- iOS
Days Gone Widget
Dear time master, Thanks for downloading this app. Time travels fast, with days gone app we can put a nice-looking widget on your Home Screen so we would know where you are during
-
iOS Keyword Lazy in Swift
lazy variables are variables will be computed until accessing. In other words, lazy variables won't have the real value until get called/used. As lazy variables can be re-assigned,
-
iOS Preview in SwiftUI
Once you have finished the SwiftUI code, it is always a good idea to preview it before implement any function code. Luckily, such feature is natively supported by SwiftUI - Preview
-
iOS Constants in Objective-C
Recently I was working on a legacy project written in Objective-C, which reminded me of the early days when working on Objective-C projects. In the code I saw few things like the f
-
iOS How to use Swift Package Manager
What is Swift Package? According to Apple's doc: Swift packages are reusable components of Swift, Objective-C, Objective-C++, C, or C++ code that developers can use in their projec
-
iOS VIP Architecture in Swift with easy explanation
Recently I joined a project where the architecture follows the Clean-Swift VIP Pattern. This article is an overview and some thoughts from a mobile developer’s perspective who have
-
iOS SwiftLint: Writing good quality code in Swift
SwiftLint is a programming guide tool which can automatically check the code quality with certain rules such as https://github.com/github/swift-style-guide . The article will cover
-
iOS What is Bitcode in iOS
You may compile and build iOS app using Swift and/or Objective-C every day, and you've probably you heard of Bitcode multiple times. So what exactly is the Bitcode , as some of you
- iOS
iOS14: How to show all your photos on WhatsApp
iOS14: How to show all your photos on WhatsApp, instagram, facebook
-
iOS 6 most useful git commands
If you prefer to use commands through git, here are the 6 most useful git commands you can use in the project. Check unmerged branches If we have multiple branches and want to find
-
iOS What is Codable in Swift
codable in swift, and Decoeable, encodable example
-
iOS Complete guide on custom class/struct comparison
swift compare custom class or custom struct
-
iOS Extract the debug or crash log from iPhone/iPad
For Real devices Open Settings app Tap Privacy Tap Analytics & Improvements Tap Analytics Data There might be quite a lot of Data, so try to pinpoint the possible one using date: 6
- iOS
中华古诗词
中华古诗词是中华最源远流长的精神文化传承之一,好的诗词给人以精神上美的提升, 本app精选了1000首诗词歌赋: 从先秦 “知人者智,自知者明“ 到清朝 ”吹到一片秋香,清辉了如雪“ 从李白 “天生我材必有用,千金散尽还复来” 到 杜甫 ”感时花溅泪,恨别鸟惊心“ 从白居易 ”绿蚁新醅酒,红泥小火炉“ 到 王昌龄 ”但使龙城飞将在,不教胡马度阴山“ 本app
- iOS
[Tips] iPhone/iPad: How to get Free apps through TestFlight
TestFlight is an beta testing app/service offered by Apple, which you can download apps from the app developer and use it for FREE. Only 2 steps are needed: Step 1 : Download TestF
- iOS
[iOS] Trivia ONE
Play with more than 3000 quizzes and questions, challenge yourself with all kinds of topics, General knowledges, history, vehicles, music, movies, sports, TV, geography, science, nature, and much more.
- iOS
Export IPA file from Xcode and install on your mobile
Generate ipa from swift xcode, install ipa to mobile device
- iOS
Fastlane Practise with Android and iOS (with examples)
Fastlane Features "The easiest way to build and release mobile apps". Which handles the majority of the manual works Fastlane has the following features: FREE Build Alpha/Beta/Prod
- iOS
Key-Value Coding and Key-Value Observing in Objective-C
What is KVO/KVC KVC(Key-Value Coding) is a coding style which coming from Functional Programming , KVO(Key-Vlaue Observing) is the technology that underlies Cocoa Bindings, and it
- iOS
Singleton in Objective-C/Swift
What is behind the Singleton? Singleton: Instantiation of a class to ONLY one object Features of Singleton: One class only can have only one instance; It must can create this insta
- iOS
Method Chaining in Objective-C and how to make your own
When I was using the Masonry, I was shocked by author’s thoughts on bring Functional Programming to objective-c, which present a clean and concise way on developing. Normally a cha
- iOS
viewWillAppear, viewDidAppear, viewDidLoad, viewWillDisappear and viewDidDisappear?
Introduction Before this, let me ask you what is the running order of viewWillAppear , viewDidAppear , viewDidLoad , viewWillDisappear and viewDidDisappear ? If you know the answer
- iOS
Get and Set a State in React
State is a JavaScript object that lives inside each of the component, We can aaccess it via this.state . Unlike JQuery and Backbone , DOM is manipulated indirectly in React , which
- iOS
Static Library, Dynamic Library and Frameworks in iOS
What you can get from this article: What are Static Library and Dynamic Library not just in iOS How do they work (in genertal) Some concepts about library Reduce coupling: if you w
- iOS
Default iOS URL Schemas
The following is a list of default URL Schemas supported natively in iOS (all versions): Objective-C // Make a phone call [[UIApplication sharedApplication] openURL:[NSURL URLWithS
Android
23 posts
-
Android Which `Context` Should You Use in Android?
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
- Android
Kotlin `lazy` vs `lateinit`: When to Use Each
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
-
Android Singleton in Kotlin
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
-
Android Use keystore to store your sensitive in Kotlin
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
-
Android Certificate pinning and Public key pinning in Kotlin
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
-
Android Download image from URL in Kotlin
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
-
Android RunBlocking in Kotlin Coroutine
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
-
Android Lazy in Kotlin
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
-
Android Encode URL in Kotlin
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
-
Android Difference between activity and requireActivity() in Kotlin
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
-
Android Start and Suspend a Coroutine in Kotlin
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
-
Android Non-blocking in Kotlin Coroutines
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
-
Android Introduction to Coroutine in Kotlin
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
-
Android How to make a custom view in Kotlin
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
-
Android Bottom Sheet Dialog implementation in kotlin
To create a bottom sheet dialog in Kotlin, you can use the BottomSheetDialog class from the Android Support Library, which is a built-in package. Here's an example of how you can u
-
Android Companion Object in Kotlin
Kotlin provides a brand new keyword companion which not exists in other programming languages. But don't be panic, it is not something new when you have one step closer. A companio
-
Android How to enable iMessage on your Android devices for free
This article demonstrates how to connect iMessage service to your Android phone/pad so that you can contact your iPhone friends freely from now on. To finish the article will take
- Android
How to auto-sizing text size in Android
Most of the time we can display the text as follows: <TextView android:id="@+id/text_question_no" android:layout_width="wrap_content" android:layout_height="wrap_content" androi
-
Android An easy example on how to use Jetpack ViewModel and LiveData
Jetpack broken up into four main areas: Architecture, Foundation, Behavior and UI. ViewModel ViewModel helped to achieve two things: help the project to adopt MVVM architecture hol
-
Android Android: Are you familiar with onCreate(), onStart() onResume() and ...
running order of onCreate, onStart, onResume and onDestory .... in Android using Kotlin
- Android
How to find your Play Store ID
For most Android phone users, Play Store is already installed on the phone already. It is a portal for you to download and install new apps with just few taps. The icon of the Play
- Android
How did I pass my Australian Citizenship Test within 7 days
Australia Citizenship Test in 2019, which will answer almost every question that you need before you attend the test. Available on Google Play app
- Android
Load local html resource on Android using webView
Local html and sources are necessary when you try to show an error page dealing with situations such as 404 , 500 and etc errors happened on remote server. And here is how: First,
Unity
7 posts
- Unity
Unity: How to change the default or entry animation for an animator
When creating a new animation for a game object, by default in Unity, the first animation your created is the entry animation for a game object. Suppose we have two animation for a
-
Unity Unity: Real example shows the difference of three Canvas UI Scale Modes
Unity: Real example shows the difference of three Canvas UI Scale Modes, Constant Pixel Size, Scale With Screen Size and Constant Physical Size
-
Unity Decorator in Unity
Decorator in Unity
- Unity
Unity: Should I choose Kinematic, Static or Dynamic for Rigidbody 2D body type?
When dealing with Rigidbody 2D, there are three key body types which determines how a game object move and react to collision. This post is the complete guide on how and when to us
- Unity
Setup Visual Studio Code for Unity on Mac 2020 (Updated in 2021)
There are tons of articles online tells us it is 2020, we should use the Visual Studio code, which is a good coding tool (or IDE) with numerous extensions. This article is the comp
- Unity
Unity: Are you familiar with Awake(), OnEnable(), Start(), Update(),FixedUpdate() and OnDestroy()
Unity: Are you familiar with Awake(), OnEnable(), Start(), Update(),FixedUpdate() and OnDestory()
- Unity
OnTriggerEnter2D v.s. OnCollisionEnter2D
OnCollisionEnter2D : Some collision really happened, means two objects collide with each other. OnTriggerEnter2D : Collision not really happened when you set up Is Trigger is true.
Other
25 posts
-
Other Certificate pinning and Public key pinning
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
-
Other HTTP Encoding
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
-
Other What is YAML file and compared with JSON
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
-
Other Type safe in programming language
Introduction Type safety in programming languages refers to the concept that variables and data structures are strongly typed and cannot be assigned values of different types . Thi
-
Other Use openssl to create public key and private key
Generally speaking, currently digital encryption methods can be divided into two main categories, symmetric encryption and asymmetric encryption . For symmetric encryption , the sa
-
Other Delete a Git branch locally and remotely
Delete a Git branch locally and remotely
- Other
Undo the most recent local commit(s) in Git
Undo the most recent local commit(s) in Git
- Other
AC Pocket Guide updated
My wife built a "bridge" I am the OP on the OZBargin post ( link ) and also the developer of the AC Pocket Guide ( iOS link ). Today (11 Apr 2020) I want to say sorry to you . As f
- Other
Wordo - Spell to score
I heard you are good at words and spelling, what about Wordo? A tiny game of finding words with few letters, share your score with your families and friends. Be the top 1. This is
- Other
Australian Driving Test for all States 2019
Australian Driving Test 2019 version. Official data for all States collected from their official websites, including: * New South Wales (NSW), Roads and Maritime Services (TMR) * V
- Other
Kids Smart Pad
Kids Smart Pad
- Other
[iOS/Android] Australian Slang
A MUST have app while travelling and living in Australia
- Other
Python package importing explained
Python is a powerful and elegant language which makes people obsessed into it (such as me). However, many of the python users are still confused by two question: package importing
- Other
Barcode and QR code Reader
The most fastest & easy-to-use Barcode/QR Reader - download now for FREE! FEATURES Code Scanner - scans QR codes & barcodes Support more than 10 formats, includes ISBN, product bar
-
Other Dive into Android Application Lifecycle – A simple tutorial for iOS developers
Introduction Due to some requirements from work, I was asked to immigrate current iOS product into Android. If you are like me, who are mainly working on iOS, but want to put hands
- Other
Manage both Python2 and Python3 on your Mac
Step 1: Install Python3 Use brew install python to install python3 on the mac, current version is Python 3.6.5 . If your mac has a python2 already, brew will ask for an upgrade, wh
- Other
MySQL: ERROR 1071 (42000) at line: Specified key was too long; max key length is 767 bytes
When I was doing the development with a recent project, I found out this err: Error: ERROR 1071 (42000) at line 50: Specified key was too long; max key length is 767 bytes See here
- Other
Create an Auto build script for Aseprite on Mac OS
Aseprite is a famous 2D pixel art tool that allow you to create 2D animations, sprites, and any kind of graphics for games. It is not free, you can get a copy from Steam for USD $1
- Other
Instance method vs. Static method vs. Class method in Python
In a python class, there are three kinds of methods: Instance method Static method Class method Example explained Look at the following code, have a test for yourself, what are the
- Other
Get Start with RabbitMQ
RabbitMQ is an open source & enterprise level messsage broker using AMQP protocal. The AMQP protocol is designed for asychronization and message dispatch. RabbitMQ can be used in t
- Other
Authentication in RESTful API
RESTful API is a protocal based on HTTP. Sometimes we want to encrypt the RESTful API content while using. There are three encryption in practise: 1. HTTP Basic Authentication HTTP
- Other
OpenSource: react-appstore-button module
react-appstore-button version: 0.0.9 NPM URL: https://www.npmjs.com/package/react-appstore-button Github URL: https://github.com/arkilis/react-AppStore-Button What is this? An Reac
- Other
Iterator and Generator in ES6
Iterator and Generator are commonly used features in ES6. In this post, we will walk through the key features of iterator and generator in depth. Iterator In JavaScript, an object
- Other
WeApp-jandan 微信小程序–煎蛋
1. 效果图 (Final Screenshot) 2. 功能 (Features): 无聊图 段子 妹子图 (这个是必须的)Updated: 这个已经被煎蛋取消了 投票 Github 地址 : https://github.com/arkilis/weapp-jandan 3. 声明 (Disclaim) 真机调试不可用,因为,煎蛋的服务器没有正确地配置S
- Other
Python Teltra SMS SDK
telstra-sms-sdk A fully tested Python SDK allow you to send sms in a more easy way! Current version: 0.0.7 Support Python version : >=python 2.6 (not python3) If you have any qu