SwiftUI UIControls

Let's see what UIControls we have to design UI in SwiftUI.

UIKit                           SwiftUI

UIViewController View
UITableViewController List
UINavigationViewController NavigationView
UITabViewController TabView
UIAlertViewController Alert
UILabel         Text
UITextField TextField
UIStackView 1. VStack 2. HStack 3. ZStack
UIScrollView ScrollView
UIImageView Image
UIPickerView Picker
UIButton         Button
UIDatePicker DatePicker
UISlider         Slider
UIStepper Stepper
UISwitch         Toggle


I know this is not a complete list; I am too exploring it.



ContentView.swift is the file where we are going to code. By default we get a Text as Hello, World!

Let's see what this file actually means and what it does.
So here we have two structures:
  1.  ContentView struct - This is the place to code or design.
  2.  ContentView_Previews struct - From here your canvas renders your code.

1. ContentView struct - Here we are returning a Text as some view. some view means any view here, we can return a Text, TextField, NavigationView, List, etc.
Now you will ask what I wish to add multiple Text?
For this you need to club it using either List, Group, VStack, Hstack, etc.

2. ContentView_Previews struct - Here too we are returning some view, but now we are returning the complete ContentView() as some view.


Comments

Popular posts from this blog

UITableView - Add or Remove Rows Dynamically (Objective C & Swift Source codes)

payUmoney Payment Gateway Integration in iOS App (Objective C)

Check Internet Connectivity Using AFNetworking 2.0