Years ago IOS developers disputed whether they should use storyboards or build the app UI. Until WWDC in 2019, Apple surprised IOS Developers by announcing a new and constructive framework called SwiftUI.
Here we will Introduce SwiftUI, its Benefits, and Disadvantages.
SwiftUI is a new and easy manner to construct and create interfaces throughout all Apple platforms.
With the use of SwiftUI, you’ll be capable of creating user interfaces for Apple Devices with the same set of tools and APIs.
The new syntax lets you write down the code without effortlessness, and it’ll Work easily and constantly with all the Xcode tools.
Date of release : 2019 SwiftUI 1 , 2020 SwiftUI 2.
Latest version : SwiftUI 2.0.
Native on all Apple platforms – Apple has plenty of enjoyment in developing revolutionary products, and that is actually obvious while we examine SwiftUI.
All of the Apple-specific experiences that the users enjoy will be present in the code which you create with SwiftUI, and all your apps will have direct access to the technology of each platform.
Interface builder and storyboard contain XML which is more complex to handle when the number of VC is huge and this isn’t easy to read or easy to edit.
When you pull the latest work from the storyboard’s source controller, there is a huge XML code and it is hard to read.
In SwiftUI the code and UI do not need to separate and this makes SwiftUI a lot easier, unlike storyboard.
Is this the time to switch from storyboard to SwiftUI?
We know SwiftUI is the future in IOS development, But due to a lack of documentation and customization in UI and libraries.
We should try hard to understand the structure of SwiftUI and make a lot of practice tutorials to be able to accept client requirement inflexible way and the ability to switch technology if the client wants (SwiftUI or UIkit) we ready to take it.
First: Open Xcode.
Second Create Xcode project
Example for SwiftUI
Fourth: Choose the directory of the app and then create the app
Fifth: Then you will find like the image below
There are two screens: the first ContentView which the area that I can put code and the other screen is the preview screen which is a reactive screen with the change you add in ContentView, And here is your first step at SwiftUI development.
Example for SwiftUI
For SwiftUI tutorials check this link:
IOS developer at Rabbit Technology