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
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 Needone 11 Feb 2023 · 3 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
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 Needone 2 Feb 2023 · 1 min read
SwiftUI @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: @AppStorage In Needone 31 Jan 2023 · 2 min read
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 Needone 30 Jan 2023 · 1 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
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 Needone 24 Jan 2023 · 2 min read
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 previous articles (Introduction Needone 21 Jan 2023 · 2 min read
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 week) From the Needone 19 Jan 2023 · 2 min read
Kotlin 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 Needone 17 Jan 2023 · 3 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
Kotlin 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 Needone 12 Jan 2023 · 1 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