SWIFT STRUCT Truong Thi Ngoc Phuong
WHAT IS SWIFT STRUCT
In Swift, a struct is used to store variables of different data types.
For example,
Suppose we want to store the name and age of a person. We can create two
variables: name and age and store value.
However, suppose we want to store the same information of multiple people.
In this case, creating variables for an individual person might be a tedious
task.
To overcome this we can create a struct that stores name and age. Now,
this struct can be used for every person.
DEFINE SWIFT STRUCT
STRUCT EXAMPLE
STRUCT INSTANCES
STRUCT MEMBER
INITIALIZER
FUNCTION INSIDE SWIFT
STRUCT
THANKS FOR YOUR
WATCHING