filmov
tv
Swift 2.0 Programming : Design Patterns : The Singleton Pattern
Показать описание
Get Our Auto Layout Course at A Great Discount. Click HERE :
Swift 2.0 Programming : Design Patterns : The Singleton Pattern
In this video we will see a simple example of the Singleton pattern in Swift.
Overview:
=========
As you gradually get familiar with the Swift landscape, one thing will be pretty Obvious : The presence of design patterns.
You will start noticing patterns such as Observers, Singletons, Factories and many more.
So why are design patterns important ?
Well for one thing, experienced designers do not solve problems from scratch or first principles.
Rather, they use solutions that have worked in the past.
Design patterns capture these workable solutions.
To take another example, image yourself as a movie director. When you think of a theme you think patterns: Super hero, Tragically flawed Hero Etc.
Once you know the pattern, design decisions automatically follow.
In this video we will look at the Singleton design pattern.
Lets start with definitions.
Ok, so why does this pattern exist ?
Well, the Singleton pattern is a Creational Pattern. It affects the process of Object Creation.
Great.. And ?
And it ensures that a class has only 1 Object instance.
Now thats interesting. Typically a class has many instances or Objects. But ONE? Why would we want one?
Well, take the UIApplication class in Swift.
Every app has exactly 1 instance of this class. And this instances handles the Apps user events among other things.
It does not make sense for your app to have more than 1 instance.
In this video we will see a simple example of the Singleton pattern in Sw
References:
=========
Tools Used:
==========
Microphone : Blue Yeti
Voice Editor : Audacity
Animation : Sparkol Video scribe
Video editor + SFX : iMovie + ScreenFlow
Computer : MacBook Air
Individuals involved in Video:
=================
Sanjay Noronha , Ravi Shankar
Swift 2.0 Programming : Design Patterns : The Singleton Pattern
In this video we will see a simple example of the Singleton pattern in Swift.
Overview:
=========
As you gradually get familiar with the Swift landscape, one thing will be pretty Obvious : The presence of design patterns.
You will start noticing patterns such as Observers, Singletons, Factories and many more.
So why are design patterns important ?
Well for one thing, experienced designers do not solve problems from scratch or first principles.
Rather, they use solutions that have worked in the past.
Design patterns capture these workable solutions.
To take another example, image yourself as a movie director. When you think of a theme you think patterns: Super hero, Tragically flawed Hero Etc.
Once you know the pattern, design decisions automatically follow.
In this video we will look at the Singleton design pattern.
Lets start with definitions.
Ok, so why does this pattern exist ?
Well, the Singleton pattern is a Creational Pattern. It affects the process of Object Creation.
Great.. And ?
And it ensures that a class has only 1 Object instance.
Now thats interesting. Typically a class has many instances or Objects. But ONE? Why would we want one?
Well, take the UIApplication class in Swift.
Every app has exactly 1 instance of this class. And this instances handles the Apps user events among other things.
It does not make sense for your app to have more than 1 instance.
In this video we will see a simple example of the Singleton pattern in Sw
References:
=========
Tools Used:
==========
Microphone : Blue Yeti
Voice Editor : Audacity
Animation : Sparkol Video scribe
Video editor + SFX : iMovie + ScreenFlow
Computer : MacBook Air
Individuals involved in Video:
=================
Sanjay Noronha , Ravi Shankar
Комментарии