Swift 3: Twitter - How to Implement Singleton and Completion Blocks (Ep 12)

Profile Picture
- Published on Feb 6, 2017馃審 Public

Singletons are often a great way to organize code into an object that only needs to be initialized once and be available everywhere in your program. One simple example of this is UIApplication.shared where all of our application's properties are easily accessible via this object. Today, we'll take a close look at how we can extract all of our networking code into a Singleton class. We will then implement a Completion Block to handle the success of our asynchronous call. Finally I'll walk through a brief exercise where we look at the sequence of code that is being executed through this whole process. Facebook Group https://www.facebook.com/groups/12406... iOS Basic Training Course https://www.letsbuildthatapp.com/basi... Completed Source Code https://www.letsbuildthatapp.com/cour... Follow me on Twitter: https://twitter.com/buildthatapp