Swift 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 Needone 17 Jul 2023 · 1 min read
RxSwift 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 Needone 1 May 2023 · 6 min read
RxSwift 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 Needone 11 Apr 2023 · 3 min read
Swift 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. Needone 14 Mar 2023 · 8 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