Book Image

Hands-On Design Patterns with Swift

By : Florent Vilmart, Giordano Scalzo, Sergio De Simone
Book Image

Hands-On Design Patterns with Swift

By: Florent Vilmart, Giordano Scalzo, Sergio De Simone

Overview of this book

Swift keeps gaining traction not only amongst Apple developers but also as a server-side language. This book demonstrates how to apply design patterns and best practices in real-life situations, whether that's for new or already existing projects. You’ll begin with a quick refresher on Swift, the compiler, the standard library, and the foundation, followed by the Cocoa design patterns – the ones at the core of many cocoa libraries – to follow up with the creational, structural, and behavioral patterns as defined by the GoF. You'll get acquainted with application architecture, as well as the most popular architectural design patterns, such as MVC and MVVM, and learn to use them in the context of Swift. In addition, you’ll walk through dependency injection and functional reactive programming. Special emphasis will be given to techniques to handle concurrency, including callbacks, futures and promises, and reactive programming. These techniques will help you adopt a test-driven approach to your workflow in order to use Swift Package Manager and integrate the framework into the original code base, along with Unit and UI testing. By the end of the book, you'll be able to build applications that are scalable, faster, and easier to maintain.
Table of Contents (22 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Index

Contributors

About the authors

Florent Vilmart, M.Sc., is a full stack engineer in Montreal. Born in France, he moved to Montreal shortly before graduating, seeking exciting opportunities in the francophone metropole of North America. He honed his skills with Objective-C before jumping to Swift when it was released. He is a polyglot, and you can find his open source work on the parse community GitHub project, where he is one of the core maintainers. He has spoken at conferences, including the GitHub CodeConf in 2016 and, most recently, the 2017 Swift Summit in San Francisco. Currently, he is working full-time with BusBud in Montreal, using mainly TypeScript alongside Swift.

Writing a first book is a daunting challenge, even more so when you have three children to take care of at the same time. I want to start by thanking Elodie, my life partner, without whom writing this book would never have been possible. She has provided both support and encouragement during the process. Elodie, thank you many times over. Many thanks to Francis at Packt Publishing for keeping my spirits up in the darkest days, always encouraging and looking forward. I also wish to thank all the leaders and makers of the Swift community that I had the chance to meet in person or online, many of whom are a source of inspiration through their open source work, blogs, and conferences. Without such a vibrant community, this book would not have been possible. Many thanks are due to my mom and dad. They both taught me that anything and everything is possible in this world, and my brothers, with whom I had the best time and who helped me to disconnect and take a step back when I needed it the most.

 

 

Giordano Scalzo is a developer with 20 years of programming experience, since the days of the ZX-Spectrum. He has worked in C++, Java, .NET, Ruby, Python, and in a multitude of other languages. After years of backend development, Giordano has developed extensively for iOS, releasing more than 20 apps which he wrote for clients, enterprise applications, or for his own benefit. Currently, he is a contractor in London where, through his company, Effective Code Ltd., he delivers code for iOS. For Packt, he has written two books on Swift, Swift by Example and Swift 2 by Example, and has reviewed a number of Swift books and videos, including Learn Swift by Building Applications, Introduction to Server-Side Swift, and Swift Functional Programming.

I'd like to thank my better half, Valentina, who lovingly supports me in everything I do: without you, none of this would have been possible. Thanks to my bright future, Mattia and Luca, for giving me lots of smiles and hugs when I needed them. Thanks to Francis, for making this book better. Finally, my gratitude goes to my mom and my dad, who piqued my curiosity and supported me in the pursuit of my passions, which begun one day when they bought me a ZX-Spectrum.

Sergio De Simone has been working as a software engineer for over twenty years across a range of different projects and companies, including work environments such as Siemens, HP, and small start-ups. For the last few years, his focus has been on developing mobile platforms and related technologies. He is currently working for BigML, Inc., where he leads iOS and OS X development. Additionally, he likes writing about technology, as well as programming tools, techniques, and languages, with a special focus on Swift evolution, for InfoQ.

About the reviewers

Tibor Bödecs is an enthusiastic software developer with more than a decade of experience in the IT industry. Previously, Tibor was the technology leader at one of the biggest mobile development-focused companies in Hungary. He is a self-taught programmer with a true passion for Swift. He has the ability to work with different languages and technologies, and has extensive experience in product management. Nowadays, he is a freelance developer focusing predominantly on web, mobile, and server-side Swift projects. Tibor has a personal blog where he regularly writes about the Swift programming language.

 

 

 

Nikola Brežnjak is an engineer at heart and a jack of all trades. Currently, he's the director of mobile engineering at Teltech, where he is responsible for the management, mentoring, and coaching of mobile app developers. He loves his job! He has written books on the Ionic Framework and the MEAN stack, and has been a technical reviewer for a number of Packt books. He likes to help out on Stack Overflow, where he's a top contributor. He records a podcast called DevThink with his friend, Shawn Milochik, and runs a local meetup called MeCoDe.

I wish to thank my wife for supporting me in all my geeky endeavors and my parents for teaching me the power of hard and consistent work.

Packt is searching for authors like you

If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.