Difference between class and struct in swift Part 1

preview_player
Показать описание
It's very important to understand the difference between class and struct for a swift developer. You can learn theory concepts in books but when you practically implement them it's important to know when to use what.

Struct and class difference comes down to inheritance and being a value type and reference type, I present to you this video where, with the simple examples I have tried to show the difference between structure and class.

Part 2 of this video will be coming out soon

If you are not familiar with struct, class or protocols here's the link to my video which should help

Рекомендации по теме
Комментарии
Автор

good explanation bro, have you uploaded session 2 also yet?

deeprajchowrasia
Автор

please sir maek video on access control of swift

iskd
Автор

Hi ravi, as we can use protocol with class also, then why we use class again for inheritance?. Like class inherit class, Is any another way for structure? Other than protocol

hareeshgangadhara
Автор

The major difference between class and struct is, class is reference type while struct is value type in swift

hardikmodha
Автор

Add structs in side the Class
Question 1: what performance issue is there ?
Question 2 : struct will be value type or ref type here

taimoorsuleman
Автор

Hi, when should we use structure and class.?
Yes, struct and class do have lots of differences but all the functionality done by the structure is also done by the class. So, when should I use structure.?

Puneet
Автор

By default functions and variables are marked as required in protocol. How to declare them as optional, there no any keyword as 'optional'?

akshaygajarlawar
Автор

if addnumber is not accessed by its PersonClass object then how can we access this function?

prachitpatil
Автор

Can you explain private and file private access control

KuldeepSingh-sssd
visit shbcf.ru