There is a famous saying “A picture is worth a thousand words” 😎 so we are gonna learn about Image views in SwiftUI.

We can use Image view to display images inside our app. In its simplest form Image View can be initialized with

Image("image name")

or

Image(systemName: "SF symbol…

SwiftUI Label was introduced in iOS 14. Label groups title and icon(image) together into a single view.

The Basics

In its simplest form, label can be created by providing text and systemImage as shown below:

Label("DevTechie", systemImage: "star.fill")

Label with custom views

If you need more control over title and icon, you can use other overload…

Photo by Jess Bailey on Unsplash

HStack is a layout container used to layout child views in horizontal direction. Child views appear side by side from leading to trailing direction next to each other.

The Basics

Let’s start with a simple example. We will create HStack and add two child Text views.

struct HStackExample: View {…

LazyVStack is a container view which is used to layout child views in vertical order, just like VStack. ‘Lazy’ keyword distinguishes LazyVStack from VStack.

In VStack, all views are rendered and loaded in memory as soon as view is initialized and appears on screen.

In LazyVStack, only views that are…

VStack is a container view which is used to arrange its child views in vertical order. Views inside VStack are placed in vertical direction in the same order as they appear in the code. In this article, we will take a closer look at VStack

By the end of this…

SwiftUI 3 introduced a new container view called ControlGroup. ControlGroup container view displays semantically related controls in visually appropriate manner for the given context meaning ControlGroup’s appearance will depend upon the context of the view.

ControlGroup is available for iOS 15+ as well as iPadOS 15+, macOS 12+ and Mac…

User’s location is probably the most sought out permission after notifications but its also the most sensitive piece of information. Over the years, Apple has invested lots of time to make sure that user’s information is not shared without their knowledge.

This also mean that when apps need user’s location…

SwiftUI 3 introduced a brand spanking new view called ✨ Canvas ✨ for rich and dynamic 2D graphics drawing.

Canvas view passes GraphicsContext and Size values to it closure which can be used to perform immediate mode drawing. Canvas can draw path, image, or complete SwiftUI views inside it.

Let’s…

Introduced in iOS 15 and SwiftUI 3, foregroundStyle is a new modifier which can be used to apply color or pattern as foreground to view. This modifier can be applied to style content of text, shapes, symbols, images etc.

Let’s start by setting foreground style with orange color:

struct ForegroundStyleExample…

DevTechie

DevTechie creates tutorials at www.youtube.com/c/DevTechie. Also video courses on: www.udemy.com/user/devtechie/ and courses on: www.patreon.com/DevTechieInc

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store