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
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
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) and EPUB (for phones, tablets and 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