RxSwift 2 hours to master RxSwift - Part 4: Subscriber in Depth In RxSwift, a Subscriber is used to listen to the observable sequence (last post) and reacts to any events emitted by that sequence. It is also named Observer in other Needone 23 Mar 2023 · 1 min read
RxSwift 2 hours to master RxSwift - Part 3: Observable in depth In this article we will dig a bit more depth in some core concepts on Part 2: . Like mentioned in the last article, an Observable in RxSwift will emit events Needone 20 Mar 2023 · 2 min read
RxSwift 2 hours to master RxSwift - Part 2: Core concepts In the example of previous article: 2 hours to master RxSwift - Part 1, we probably saw some code such as subscribe without any explanation, we will go through some Needone 14 Mar 2023 · 3 min read
Swift 2 hours to master RxSwift - Part 1 About this series This series is to help people to get started with RxSwift easily with straight forward examples, plain explanation. And YES, if you would like to spend 2 Needone 14 Mar 2023 · 5 min read
Swift 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 Needone 7 Mar 2023 · 2 min read
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 Needone 4 Mar 2023 · 1 min read
Swift 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 device’ Needone 2 Mar 2023 · 2 min read
Swift 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 Needone 28 Feb 2023 · 2 min read
Swift 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 Needone 18 Feb 2023 · 1 min read
Swift 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 Needone 14 Feb 2023 · 1 min read
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 Needone 9 Feb 2023 · 1 min read
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 Needone 7 Feb 2023 · 2 min read
Swift 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. Needone 4 Feb 2023 · 2 min read
Swift 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 Needone 28 Jan 2023 · 2 min read
Swift 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 Needone 26 Jan 2023 · 2 min read
Swift 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 constants Needone 14 Jan 2023 · 1 min read
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 details, check this: Needone 12 Jan 2023 · 2 min read
Swift 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 SwiftUI * popup a Needone 10 Jan 2023 · 1 min read