In SwiftUI, shapes are small 2D pieces that can be used to draw views. SwiftUI provides us with the following shapes: circle, ellipse, capsule, rectangle, rounded rectangle. In the following example, we will see an example of each shape.
SwiftUI provides us with a shadow modifier that allows us to draw a shadow around views easily. With that modifier, you can specify a color, radius, and vertical and horizontal offset to position the shadow relative to this view.
An architecture that works for one project might not work for another project. There are many different aspects to consider when you are looking when you pick one. But still, you can write a high-quality version of your app in any architecture, and it is only related to understanding the strong and weak parts of the selected architecture.
In this post, we will learn how to use existing UIKit ViewControllers in the SwiftUI project. This tutorial will allow you to prepare your UIKit ViewController for Xcode Preview.
I think that SwiftUI and Combine will change the way people will write code in 2 years. In this post, we will discuss how to start using SwiftUI in an existing UIKit project so that you can have a smoother transition to SwiftUI projects. Especially if your application support starts from iOS 13, you should do that transition.
SwiftUI provides us with various modifiers for drawing borders on views and shapes. Specifically: stroke, stroke border, and border. At first glance, those modifiers may look identical, but they have different behavior and different places where they can be applied.
@GestureState is a property wrapper that stores states of a view during the performance of a gesture. That’s cool, but we can store the state of a view during the performance of a gesture using @State property wrapper.
While working with gesture recognizers, we might find ourselves having multiple gestures recognizers on the same view. And for such situations, we need exactly to know how those interact with each other. SwiftUI allows us to handle such cases in three-way: Simultaneous, Sequenced, Exclusive.
SwiftUI gives us an elegant and easy way of working with gestures. At the moment of writing this post, SwiftUI provides us with five gestures: DragGesture, LongPressGesture, MagnificationGesture, RotationGesture, and TapGesture.
Padding allows us to add space around views. We cand do that using the “padding()” modifier. By default, padding will add a default space provided by the system, which conforms to the Apple Human Interface Guidelines.