99. SwiftUI: Creating flexible grid layout using LazyVGrid
top of page
Search
Code: import SwiftUI struct ContentView: View { private var items: [GridItem] = [ GridItem(.flexible(), spacing: 10),...
Hui Wang
Feb 7, 20231 min read
97. SwiftUI: How to switch the visibility of a Form?
Code: struct ContentView: View { @State private var isVisible = false @State private var username = "" @State private var password = "" ...
Hui Wang
Jan 26, 20231 min read
96. SwiftUI: How to activate/deactivate a Form
Here is an example of how you can activate and deactivate a Form in SwiftUI: struct ContentView: View { @State private var disabledForm =...
Hui Wang
Jan 25, 20231 min read
95. SwiftUI: Using section to divide the List into several groups
You can use the Section struct to divide a List view into multiple groups. The Section struct takes a single parameter, which is an array...
Hui Wang
Dec 16, 20221 min read
85. SwiftUI: How to delete and move elements of a List (NavigationView)
Today I will show you how to delete and move elements of a List. (demo with NavigationView). import SwiftUI struct ContentView: View { ...
Hui Wang
Dec 15, 20221 min read
84. SwiftUI: How to adjust the order of elements in the List (NavigationView)
Today I will show you how to adjust the order of elements in the List. (demo with NavigationView). import SwiftUI struct ContentView:...
Hui Wang
Dec 14, 20221 min read
83. SwiftUI: How to delete elements in a List (NavigationView)
Today I will show you how to delete elements in a List. (demo with NavigationView). import SwiftUI struct ContentView: View { /// 1....
Hui Wang
Nov 18, 20222 min read
78. SwiftUI: How to insert new items to a List (NavigationView)
Today I will show you how to insert new items into a List (demo with NavigationView). import SwiftUI struct ContentView: View { /// 1....
Hui Wang
Nov 17, 20221 min read
77. SwiftUI: Use List to show content vertically
The List in SwiftUI is like the UITableView in UIKit, which is used to show the contents of an array in the vertical direction. Make the...
Hui Wang
Sep 29, 20221 min read
71. Article: viewDidLoad() in SwiftUI
If you come from the UIKit world, you might wonder what the viewDidLoad() equivalent method in SwiftUI is. Too bad there is no direct...
Hui Wang
Sep 18, 20221 min read
66. SwiftUI: Introducing RadialGradient
Today I will show you how to use RadialGradient. The RadialGradient starts from the origin and spreads outward with an ellipse. The...
Hui Wang
Sep 18, 20221 min read
65. SwiftUI: Introducing AngularGradient
Today I will show you how to use AngularGradient. The start and end points of AngularGradient color gradients are clockwise. Steps:...
Hui Wang
Sep 18, 20221 min read
64. SwiftUI: Introducing LinearGradient
Compared with pure color, the gradient can enrich the image and give users a more substantial visual impact. Steps: First, create a Text...
Hui Wang
Sep 14, 20222 min read
62. SwiftUI: Introducing Path
Today I will show you how to use Path. Path can draw highly complex graphics, and I'm just showing its basic functions here. Steps:...
Hui Wang
Sep 12, 20222 min read
59. SwiftUI: Introducing Capsule
Today I will show you how to use Capsule. I will use multiple Capsules to draw a colored petal. Steps: First, add a Capsule. Its default...
bottom of page