Categories
SwiftUI

How to create Page View in SwiftUI

Please check Majid’s tutorial on making a PagerView. This tutorial uses Majid’s code with some small changes. If you want to understand how to create the PagerView using @ViewBuilder visit swiftwithmajid.com Code Snippet Changes What I’m changing Adding dots to indicate the number of pages inside the view. Making the swipe gesture weaker. Here is […]

Categories
SwiftUI

Create Your Own View Container Using @ViewBuilder

@ViewBuilder is a function builder that constructs views from closures. It enables you to construct a View that can hold multiple Views. With @ViewVuilder, you can set up your constant elements across the app and View’s Modifiers, then only add to it the content that is changing. In the example below, we are defining a […]

Categories
SwiftUI

Understand Stack Views in SwiftUI

There are three built-in stacking views in SwiftUI; VStack, HStack, and ZStack. All three stacks are of type View. Stacks have alignment and content parameters. VStack & HStack also have a spacing parameter. In SwiftUI, the last parameters can be omitted, the default alignment in the center and the spacing is dynamic when it is […]

Categories
SwiftUI

Introduction To SwiftUI

Functional Programming SwiftUI is a functional programming language that uses the View protocol to create reusable UI components. Views are value types, which means you don’t define classes for them. Struck is read only, you can’t inherit from them. Views are rectangular areas on screens that are used for drawing and multi touches. Create SwiftUI […]