-
Creating Users Dashboard with SwiftUI
In this article, you’ll learn the basics of the SwiftUI framework, which was created in 2019 by Apple and is now gaining on popularity, slowly replacing UIKit in building iOS-apps views. We will go through the basic components and build a simple user interface. The final result of our project will look like in the image below. Look at the picture no. 1 Stacks In all views created with SwiftUI, we can observe one basic pattern. Each contains Stacks in three axes: Vertical – VStack, Horizontal – HStack and along the Z-axis – ZStack. They allow us to simply arrange the sub-views and organize them on the screen. With their help we will build the already…
-
Navigation in Jetpack Compose using Voyager library and ViewModel state
In this article we will use Voyager library to implement navigation in Jetpack Compose. The navigation will be driven from ViewModel and will use StateFlow for handling one-off navigation events. Why Voyager? The official Google library for navigation suffers from many problems. The main one is usage of URLs for routes and passing parameters. Because of that, every parameter must be manually encoded into String, making it more error-prone and adding a lot of boilerplate code every time a parameter must be converted. Even though version 2.4.0-alpha10 makes it possible to declare custom navigation types, it still requires declaring additional classes and converting values into JSONs. The flaws of official library resulted in many custom solutions, created by the Android community. One of them…