The Missing Manual for Swift Development (The Missing Manual for Swift Development)
The Missing Manual for Swift Development
About the Book
Writing a few lines of Swift is surprisingly easy. Once you start to dig deeper, though, you discover that building an application for Apple's platforms is more challenging than it seems. This book outlines the challenges you face along your journey and how to overcome them.
Some of the more obvious topics I cover in the book include dependency management, source control, code reviews, continuous integration, style guides, working in a team, tooling, project organization and documentation, and release strategies.
The topics I found most interesting to write about, however, are more meta, such as when to break rules, freelancing and subcontracting, staying productive as a developer, shipping projects, leaving your comfort zone, and dealing with challenging problems.
The book is filled with useful information that I've picked up over the years, sometimes from other developers and sometimes by learning the hard way. This book doesn't include code snippets or sample projects. The goal of the book is to provide insights and answers to questions that are often overlooked or ignored.
Who is this book for? This book is for every type of developer, but it primarily focuses on Swift and Cocoa development. If you're developing for Apple's platforms, then you'll find a lot of useful information in this book, regardless of your experience.
Bundles that include this book
Table of Contents
-
- Welcome
-
Part 1: Foundation
-
1 Your Foundation
- What Is Your Foundation
- There Is No Clear Path
-
2 Where to Start
- Setting Yourself Up for Success
- A Path Without Distractions
- Choose Your Teacher Wisely
-
3 Know Your Tools
- Xcode
- Developer Portal
- Provisioning
- Instruments
- Command Line
- Third Party Tools
-
4 Adopt Best Practices
- What Are Best Practices
- Patterns
- Anti-patterns
- Good Practices for Swift
- Be Critical
-
5 Security
- Make It Hard
- Plain Text
- Obfuscating Information
- Fetching Sensitive Information
- Encryption
- Privacy
- Logging and Debugging
- Educating Your Client
-
6 Don’t Ignore Your Foundation
- Under the Hood
- Dependencies
- Don’t Ignore the Fundamentals
-
7 Respect the SDK
- Know Your Limitations
- Respect the SDK
-
9 Design Patterns
- Model-View-Controller
- Model-View-ViewModel
- Singletons
- Dependency Injection
- References, Delegation, and Notifications
- Master These Patterns
- 6 Protocol-Oriented Programming
- 7 Reactive Programming
-
1 Your Foundation
-
Part 2: Swift
-
1 Learn Swift With an Open Mind
- Reference Types and Value Types
- Protocol-Oriented Programming
- Type Safety
- Best Practices
- Forget What You Know
- 2 Be Critical
-
3 Embracing Optionals
- Warning Sign
- Elegance and Beauty
- Swift to the Rescue
- Embrace Optionals
-
4 Mind the Exclamation Mark
- Use Cases
- Convenience and Laziness
- Don’t Be Lazy
- When I Use the Exclamation Mark
- A Personal Choice
-
5 Exclamation Marks and Fatal Errors
- Clarity Over Subtleness
- Choosing for Clarity
-
6 Smelly Code
- Forced Unwrapping and Conversion
- Monster Classes
- Massive Methods
- Ignoring Errors
- Singletons
- String Literals
- Is Your Code Smelly
-
7 Value Types and Reference Types
- What’s the Fuss
- An Example
- Benefits of Value Types
- When to Use Value Types
-
8 Catching Errors
- When Should You Handle Errors
- Where Should You Handle Errors
- Notifying the User
- Monitoring Application Health
- Don’t Ignore Them
-
9 Using Fatal Errors to Write Elegant Swift
- What to Do When You Don’t Know What to Do
- Guarding Against Unexpected Events
- Use Fatal Errors Sparingly
- Clarity and Elegance
-
1 Learn Swift With an Open Mind
-
Part 3: Projects
-
1 A Brand New Project
- Step 1: Setting Up the Project
- Step 2: Organizing the Project
- Step 3: Adding a README.md
- Step 4: Build and Run
- Step 5: Adding a .gitignore
- Step 6: Putting the Project Under Source Control
- Step 7: Pushing the Project to GitHub
- Step 8: Optional Steps
-
2 Project Structure
- An Example
- View Controllers
- Test Target
- On Disk
- What Do I Gain
- Tools
- Caveats
-
3 Project Hygiene
- Projects Evolve
- Obsolete Files
- Comments
- Documentation
- Don’t Commit Everything
- Guidelines and Exceptions
-
4 Document Everything
- Start With the Basics
- Make It Easy
- What to Document
- Up to Date
- Make It a Core Tool
- I’m a Team of One
- Make It a Habit
- Time Is Money
-
1 A Brand New Project
-
Part 4: Workflow
-
1 Testing
- Where to Start
- Code Coverage
- Writing Better Code
- Dependency Injection
- Xcode and Testing
- My Current Test Setup
- What Are You Testing
- It Takes Time
-
2 Continuous Integration
- What Is It
- Why Is This Useful
- Long Hanging Fruit
- Avoid Human Tinkering
- TestFlight
- Painless Releases
- Make It Robust
- Transparency
- Learning Curve
-
3 Refactoring
- Technical Debt
- Building for the Future
- The Fallacy of Sunk Cost
- Starting Anew
-
4 Source Control
- The Basics
- Don’t Break These Rules
- Commits
- Stashing
- Patching
- Git Flow
- Some Tips
-
5 Dependencies
- Minimize Dependencies
- What Is a Dependency
- Fewer Dependencies
- Mapping the Liabilities of a Project
- Don’t Make Your Life Too Easy
- Rolling Your Own
- Choose Wisely
- Becoming a Better Developer
- Watch Out for the Defaults
- Challenge Yourself
-
6 Automation
- Scripting
- Build Phases
- Automated Testing
- Documentation
- Continuous Integration
- fastlane
- Keep It Simple
-
7 Privacy
- Protecting the User’s Privacy
- Who Do You Work With
- Giving the User Control
- Third Party SDKs
- Choose Wisely
-
8 What to Do When You Inherit a Software Project
- First Things First
- Build and Run
- Collect Data
- Dependencies
- Working on the Project
- Document Everything
- And Beyond
-
9 Speed, Quality, and Technical Debt
- Speed and Quality
- Technical Debt
- Focus
- How to Get Rid of Technical Debt
- Taking Shortcuts
-
1 Testing
-
Part 5: Team
-
1 Code Reviews
- Just Start
- Calendar and Agenda
- Make Them Actionable
- Keep Them Small
- Be Prepared
- Tools
- That Hurts
- Convincing Management
- Frequency
- But It’s Just Me
- Give It a Try
-
2 Adopt a Style Guide
- Why Have One
- Automation
- Rough Transition
-
3 Working In a Team
- Hire the Right People
- Leadership
- Communication
- Give It Time
- Respect
- When Things Hit the Fan
- Ownership and Responsibility
- Share and Ask
-
4 Being a Leader
- Listen and Be Open
- Modesty, Humility, and Respect
- Work as a Team
- Working With People
- Follow Your Gut
- Lead
-
1 Code Reviews
-
Part 6: Career
-
1 Open Source
- Start Small
- Taking the Plunge
- Documentation
- Taking It Seriously
- Giving Up Control
- Taking Responsibility
-
2 You Are the Constant in Your Career
- Putting Yourself First
- Setting Goals
- Learning Requires an Investment
- Take Care of Yourself
- Looking Back
-
3 Build That Application
- Build and Ship
- Show What You Can
- Stay Ahead
- Rinse and Repeat
- Build That Application
-
4 Protect Your Productivity
- Working From Home
- Working In an Office
- Minimizing Interruptions
- Find a Quiet Place
- Deal With It
-
5 Building Your Portfolio
- Scratch an Itch
- Setting Goals
- Learn the Basics
- But Start Creating
-
6 How Badly Do You Want It
- Contribute
- Build
- Maintain
- Plan and Manage
- Gain Experience
- Be Yourself
- How Badly Do You Want It
- What About You
-
7 Freelancing and Subcontracting
- Freelancing and Subcontracting
- Being Picky
- Firing Clients
-
1 Open Source
-
Part 7: Products
-
1 Ship, Ship, Ship
- It’s Hard
- How to Ship Consistently
- Internal Deadlines
- Remove Friction and Clutter
-
2 Talk to Your Customers
- Solve a Problem
- Ground Zero
- Is This for You
- But It’s Fantastic
- A Recipe for Success
-
3 What Is Stopping You From Shipping
- Why Is This Important
- Start Small
- Remove Clutter
-
4 Motivation Will Get You Only Halfway
- Motivation Won’t Cut It
- Running a Marathon
- Pulling the Plug
- Start and Persevere
- Challenge Yourself
-
5 How to Make a Living as a Mobile Developer
- Paid Up Front
- Freemium
- Advertising
- In-App Purchases
- Subscriptions
- Donations
- Finding the Right Business Model
- Experiment But Be Smart
- Evolution
-
1 Ship, Ship, Ship
-
Part 8: You
-
1 Being and Staying Productive
- Maintaining Focus
- Protect Your Productivity
- Distraction Is Addictive
- Take Care of Yourself
-
2 Stop Looking for the Silver Bullet
- An Example
- Investigate and Test
- Stop Looking for the Silver Bullet
-
3 You Are Not an Imposter
- What Is It
- Why Do I Bring This Up
- Curing Imposter Experience
- Talk About It
- It’s Common
- Don’t Believe Everything You Read
- Don’t Let It Affect You
- Success Through Failure
-
1 Being and Staying Productive
-
Part 9: Learning
-
1 Choose Your Teacher Wisely
- Information Overload
- Who to Trust
- Focus, Focus, Focus
- Never Stop Learning
-
2 Taking a Shortcut
- Internship
- Freelancing and Subcontracting
- Learn, Learn, Learn
- Build, Build, Build
- Choose Wisely
-
3 Some Things Are Hard
- Cut Yourself Some Slack
-
4 Learn the Rules, Then Break Them
- Examples
- Growing as a Developer
- Creating Something Better
-
1 Choose Your Teacher Wisely
Authors have earned$10,244,335writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
500 QUIZ MMG COMMENTATI
ALS Medicina Generale500 Quiz degli ULTIMI Concorsi di Medicina Generale (2014/2016/2017/2018/2019)
Riassunti e suddivisi per area con Griglia risposte vuota e Griglia risposte esatte Ministeriale
Commentati con link alla fonte per approfondimento e ausilio allo studio
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
Functional Design and Architecture
Alexander GraninSoftware Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Algebra-Driven Design
Sandy MaguireA how-to field guide on building leak-free abstractions and algebraically designing real-world applications.
Thinking with Types
Sandy MaguireThis book aims to be the comprehensive manual for type-level programming. It's about getting you from here to there---from a competent Haskell programmer to one who convinces the compiler to do their work for them.
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Stratospheric
Tom Hombergs, Björn Wilmsmann, and Philip RiecksFrom Zero to Production with Spring Boot and AWS. All you need to know to get a Spring Boot application into production with AWS. No previous AWS knowledge required.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #4
Cloud Architect: Transform Technology and Organization
2 Books
Architects don't just recite product names and features. They understand the options, decisions, and trade-offs behind them. They earn credibility and maintain authenticity by connecting the penthouse with the engine room. Get two essential books that redefine the role of the software and IT architect at one low price:37 Things One Architect... - #6
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #7
The Python Craftsman
3 Books
The Python Craftsman series comprises The Python Apprentice, The Python Journeyman, and The Python Master. The first book is primarily suitable for for programmers with some experience of programming in another language. If you don't have any experience with programming this book may be a bit daunting. You'll be learning not just a programming... - #10
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon...