Now for us to understand exactly the benefits of swift to you why I think it's important for us to look
at the progression of the Apple ecosystem if you will for developers.
So it used to be that in order for you to create any application for the Apple ecosystem you would have
to learn objective c.
That was it.
You had no other option.
You had to learn Objective C in order to create any sort of application for the Apple platform or ecosystem.
Now Objective C wasn't a very easy language to learn and or to read.
In fact it was one of the toughest languages I've ever had to learn in a lot of other people.
Also shared the same sentiment.
So it wasn't just me Objective C was really hard.
So Apple decided later about 20 years or so later that OK it's time to come back to the 21st century
and create something a little bit more easier to handle.
So then they created swift language.
That was a revolutionary feat if you will because Swifty was a better language very simplified and easy
to learn.
So developers could just learn in a whim.
All was good.
Now the thing that you have to realize also in order for us to build anything for the Apple ecosystem
you'd have to of course put together some sort of user interface in traditionally creating user interfaces
is really really hard.
Even though we have swift language.
The reason why is because the way we create user interfaces in the Apple realm is that we use X code
I.D..
So the X code is the idea integrated development environment used to create applications for Apple ecosystem.
So you would open up X code in order for you to create user interfaces.
You'd have to use storyboard and or UI Kit.
Okay so libraries to create whatever you wanted to create for our user interface.
Now the storyboard is just a clunky cumbersome tool that all developers were stuck for many many years
in order to create anything usable for any IOW application.
And as well for any Mac OS and so forth.
So yes to give you an example this is a very simple application as you can see here.
This is what we call X code.
This is a picture of X code and this simple application here only takes about four items or four controllers
there.
Okay.
So this simple application you can see two left will have view control was seen on that panel there
and inside we have top layout guide and we have views and half a stack view and then we have the middle
label.
I mean it's just crazy.
I mean you can see there's a lot of layers.
All of these things you have to drag and drop and search for them an image view you put on top of that
and then you put a text field.
I mean it's a lot of work.
And on top of that you would also have to then connect to the code in order for the responsiveness to
happen.
So when they click onto the UI image for you for instance if you want the app to do something then you'd
have to make sure you connect the code and the storyboard items you've added into user interface.
So that is of course a pain to say the least.
All of that goes away with Swifty Y because now is Swifty y Apple decided to create this framework that
is exceptionally amazing because now you can create all sorts of applications for the Apple platform
using code only.
But not just any kind of code.
This code is declarative syntax meaning it's easy to read and it's also natural to write.
So it's almost like you are writing in English language because you're declaring things you want to
see in your application.
An example you can see that piece of code to the left there generates what you see to do right now before
Swifty y in order to create table view as they called those lists there you would have to do a lot of
walk between the storyboard and using UI kit views and using UI kit API using all sorts of things you
have to do in order to get this to work.
But in this case here with Swifty you are I can see less than 30 lines of code if that actually.
I would say probably 15 lines of code unless you're able to put together something as simple as that.
And the beauty also you have to notice here is that looking at this code closely inside you can actually
read even if you've never looked at Swift code of swift UI before it's easy to read.
It's intuitive.
You can see for instance there's a variable body there which is just a view which returns a list which
inside of this list we have an image.
Right.
And we have a view stack or vertical stack which contains two texts and then we make the last tax they
are to have a color.
It makes a lot of sense.
So this is why Swifty y shines.
It just takes away all of that cumbersome code as well as storyboard.
The old way of creating user interfaces in makes it more declarative and easy to understand.
Easy to write and to do point.