Udemy

Swift Singletons. The Difference When Using Class & Structs

Created by iOSBFree. Understanding the differences between class and struct singletons in Swift iOS.
Free tutorial
Rating: 4.6 out of 5 (39 ratings)
2,442 students
31min of on-demand video
English
English [Auto]

Understand why & when you would use the Singleton pattern
Understand the behaviour of a struct singleton
Understand the behaviour of a class singleton
Understand the essential engineering behind these coding decisions

Requirements

  • Basic knowledge of iOS

Description

Learn From One Of The 1st iOS Developers In The World

Our instructor Matt, has 13 years of experience in iOS and created the world's first iPhone, iPad and Apple Watch apps. Now, he dedicates his time to recording courses for iOSBFree (pronounced "iOS Be Free").


In This Course

1. We create two singletons in a Playground.

2. Each singleton is created using either a struct or a class.

3. We examine the advantages and disadvantages of each approach


Learning Objectives

· What is a singleton

· The behaviour of a struct singleton

· The behaviour of a class singleton


The Goal Of A Singleton

Together, we’ll examine the behaviour of two different approaches when creating singletons. The more classic approach is to create each singleton using a class due to its memory management - when the singleton is created it will exist in only one area of memory and never be duplicated. However, the opposite can be true when dealing with struct singletons.


Our Recommendation

Our recommendation would be to always use a class singleton due to the principle of a singleton itself, which is to maintain only one of its kind within the system. One manager handles the inflow and outflow of certain behaviour. If we want to ensure that we don’t duplicate our singleton, we should stay away from struct value types that use such behaviour by default.


Sample Code

Sample Code Is Always Included and attached to each video. You can download the same project used in each episode of the course.


This Course Is Free

This course is free. We aim to publish as many short courses as we can to help new iOS Developers apply for jobs in iOS and enter a high paying profession. We want those developers to write great apps that are robust, work correctly, and are maintainable. By supplying this information for free we hope we can reach as many people studying in the pandemic as we can.


Our Service (iOSBFree Ltd)

We are a unique career-building service sharing over 13 years of successful experience shaping the iOS industry into what it is today. Our unique information, point-of-view and service can be utilised to build highly successful and profitable careers in iOS.


A Career In iOS

iOS developers are the most sought after developers in the world! They can earn over £100,000 per year, work remotely and B in high demand for their skills! Subscribe to our YouTube channel and let us reveal all our insider secrets completely for free.


What We Teach

Career building, CV writing, interviewing skills, industry secrets, industry stories, real-life experience, iOS fundamentals, ARC memory management, Swift, architecture and best engineering practices.

Please show your support by enrolling in our course!


What Is SwiftUI?

SwiftUI is a newly released UI Framework introduced to iOS. It aims to solve a lot of problems with apps, such as running on all platforms, reducing bugs, improving stability and bringing more developers to iOS - because it's EASIER to write apps!

Learning SwiftUI is an absolute must for any iOS developer looking to develop a career over the next 5 years.


The Instructor

Check out our Instructor profile (just briefly) and glance over Matt's incredible unparalleled experience. After 13 years of specialising in iOS, he created a company helping people build their own successful and profitable careers in iOS too.

Our unique information cannot be found anywhere else on any platform. We not only teach code, syntax and architecture but we provide tried & tested strategies to boost your career forwards and build a better life!


Want To Learn More Topics?

Please send us an email with the topic you would like to learn in a swift playground and we will happily record, edit and publish it for you. Absolutely for free. Simply email community@iOSBFree.com with the subject heading, "Topic I Want To Learn".


First In The World

Not only is our instructor one of the first iOS developers in the world, but our service is also the first of its kind in the world!
iOSBFree is a truly unique one-of-a-kind service. There is no single other service offering Matt’s level of experience in any other coding course, software engineering tutorial, or career-building service anywhere in the world.


More From iOSBFree

· Download Our FREE CV Template

· Download Our Career BOOSTER Pack

· Enrol In FREE Online Courses (iOS & Swift)

· Read Our Blog


Much love.
The iOSBFree team.
Build a profitable iOS career with iOSBFree!

Who this course is for:

  • Beginners who want to advance in their career - we help with that!

Instructor

Senior Swift Engineer, iOS Consultant, Udemy Instructor
Matthew Harding
  • 4.4 Instructor Rating
  • 414 Reviews
  • 8,877 Students
  • 7 Courses

Please leave a review. They help our future students and provide feedback.


Worlds first iOS developer. Well.. one of them. 14+ years iOS experience. Created worlds first iOS apps. Invited to Apple Headquarters for a secret project. Developer behind the 10 billionth downloaded app. Earned 6 figures as a consultant. Generated millions in revenue for his clients. Team Leader. Consulting for London across several different sectors in industry including finance, trading and video streaming.

Our Udemy Courses

Our goal is to provide direction to those who want to learn Swift in order to better their lifestyle or livelihood. I can fully recommend iOS and Swift as fantastic opportunities to live a wealthy, healthy and happy life, working fully remote as a computer programmer.

Our online courses are designed to learn Swift fast in as little time as possible. We condense as much as we can also providing over a decades worth of knowledge and tips within every video.

We are new to Udemy courses and are working hard to deliver great content. Please show us your support and let us know how we can do better.


Our Teaching Style

We have taken the official Swift documentation and translated the official programming guide into Xcode playgrounds. We then simplified the content creating a guided tour of the Swift programming language with a course project. Inside each one of our videos you will find the attached sample code to interact with every given example. This is a hands on course that focusses on writing code first and watching videos second. This provides a full customer experience as more stimuli have been catered for. By providing both written interactive coding examples alongside a guided video explanation learning can be efficient as possible, significantly reducing the time required to increase knowledge.

Udemy kindly offers a refund in full for any unhappy customers - so why not try us?

Some Coding Tips

We use many technical terms within the industry and perhaps some of the most frequent are ‘design patterns’ and ‘architecture’. You can think of design patterns as a type of blue print used to structure a certain type of communication between a cluster of objects. As an example we may chose to use the Factory pattern to write a class that produces cars to a fixed specification already configured. This term can then be used in conversations to describe the behaviour and type of structure you have used to construct a certain feature or area of the codebase.

Architecture is essentially very similar and is used to describe the entire infrastructure of every component within the system itself. Design patterns are used to design and build the architecture and a solid system cannot built without this type of order. Perhaps when we think abut this term architecture we should think of the term ‘structured code’ and remember the importance of structure communication between files.

How To Become An iOS Developer

Most companies that offer iOS developer jobs simply need to maintain an existing Swift system that has previoiusly been put in place. Creating the architecture and thinking about performance can be difficult and may require some expert knowledge, but they are not the needs of most companies. In fact, if you are interested in maintaining an existing system then the technology industry will be a huge market place in which to advertise your skills.

With the interest of both parties in mind (the business and the employee) having great Swift knowledge and being able to write safe code will be the biggest focus, which is great news.

This means, all you need to do is learn Swift.


Why Learn Swift

To become an iOS developer with a great salary who can work anywhere in the world using only a laptop and an internet connection.

By studying the language all of the other pieces of the puzzle will fall into place. With a clear grasp of the Swift programming language it will be much easier to apply for jobs and to pass each test they provide. The rest will be provided to you as you learn whats required within that role for that specific company.

Our Goal / Motivation

We are trying to consolidate more than a decades commercial experience combined with the official Swift documentation into short online courses (created for fast learning), so that our students can live happier and wealthier lives - Swift engineers are well-paid and can work anywhere in the world.

Why not think about becoming an iOS developer making apps for Apple software.

Thank You

A big warm hug and thank you to all of our students. Repetition is the key. Just keep writing code each day and then the only remaining factor is time. You can do it, I promise.

Top companies trust Udemy

Get your team access to Udemy's top 25,000+ courses