How does Fishpond Work?

We won't be beaten by anyone. Guaranteed

Swift for the Really Impatient

Hurry - Only 3 left in stock!
Swift for the Really Impatient is the perfect jumpstart to the Swift language for every experienced Objective-C developer. Leading iOS and OS X developers Matt Henderson and Dave Wood help you take full advantage of Swift’s powerful innovations, without wasting time on basics you already know.

Through expert code examples and crystal-clear explanations, Henderson and Wood reveal how Swift features improve on Objective-C and show how to make the most of them. You’ll quickly master “Swift-er” techniques for using objects, classes, optionals, generics, functions, closures, and more. Each chapter includes hands-on exercises designed to reinforce and deepen your skills.

You’ll learn how to re-implement common Objective-C programming solutions in Swift, improving code clarity, power, and performance on both desktop and mobile devices. And, because you probably won’t (or can’t) abandon Objective-C anytime soon, you’ll discover how to use both languages together, smoothly integrate Swift into existing projects and workflows, and gradually move your current code base into the future. Coverage includes
  • Using Swift’s new patterns and concise, expressive syntax to produce safer, more reliable code
  • Leveraging the surprising power of Swift’s data structures
  • Utilising Swift’s type system to help prevent errors common in other languages
  • Using optionals to correctly handle invalid, missing, or unknown values
  • Implementing generics to reduce duplication, improve power, and simplify maintenance
  • Interacting with C and Objective-C APIs
  • Abstracting functionality for reusable code while maintaining type safety
  • Isolating code in clean, flexible, low-overhead closures
  • Combining Swift with Objective-C in the same project
  • Avoiding gotchas when importing Objective-C classes in Swift projects
  • Nesting types to improve code clarity
  • Creating shared objects with singletons
  • Managing threading and concurrency with Swift’s advanced Grand Central Dispatch (GCD) patterns

Product Details

Table of Contents

Foreword xiPreface xiiiAcknowledgments xvAbout the Authors xviChapter 1: Introducing Swift 11.1 Basic Syntax 21.1.1 Variables and Constants 21.1.2 String Interpolation 51.1.3 Control Flow 61.2 Basic Data Types 101.2.1 Int 101.2.2 Double and Float 121.2.3 Bool 131.2.4 Strings 141.2.5 Arrays 151.2.6 Dictionaries 19Exercises 20Chapter 2: Diving Deeper into Swift's Syntax 212.1 Optionals 222.2 Generics 252.3 Type Annotations and Type Inference 282.4 Functions and Closures 292.4.1 Global Functions 302.4.2 Nested Functions 302.4.3 Closure Expressions 312.5 Tuples 322.6 switch Statements and Pattern Matching 34Exercises 37Chapter 3: Objects and Classes 393.1 Enumerations 413.2 Classes 453.3 Structures 493.4 Subclassing 513.5 Overloading 523.6 Overriding 543.7 Initialization 553.8 Properties 573.8.1 Computed Properties 593.8.2 Property Observers 603.8.3 lazy Properties 623.9 Subscripting 633.10 Protocols 653.11 Extensions 673.12 Access Control 68Exercises 73Chapter 4: Optionals 754.1 Optionals and nil 764.2 Validity Checking, Optional Binding, and Forced Unwrapping 784.3 Optional Chaining 814.4 Implicitly Unwrapped Optionals 86Exercises 88Chapter 5: Generics 915.1 Why Generics? 925.2 Generic Functions 925.2.1 Type Parameters 935.2.2 Using More Than One Type Parameter 945.3 Generic Types 945.3.1 Associated Types 985.3.2 The where Clause 100Exercises 101Chapter 6: Functions and Closures 1036.1 Functions 1046.1.1 Parameters 1046.1.2 External Parameter Names 1056.1.3 Default Parameter Values 1076.1.4 Variadic and inout Parameters 1086.1.5 Return Types 1106.2 Closures 1126.2.1 Inferring Parameters and the Return Value 1136.2.2 Trailing Closures 1136.3 Functional Programming Patterns 114Exercises 117Chapter 7: Working with Objective-C 1197.1 Interacting with C and Objective-C APIs 1207.1.1 Optional Properties and Return Values 1227.1.2 AnyObject Types 1237.1.3 Subclassing, Extensions, and Protocols 1247.1.4 Automatically Converted Types 1267.1.5 Selectors and Enums 1287.1.6 Working with C Code 1297.2 Working with Swift and Objective-C in a Single Project 130Exercises 133Chapter 8: Common Patterns 1358.1 Nested Types 1368.2 Singletons 1378.3 Using Grand Central Dispatch 1398.3.1 dispatch_once 1398.3.2 dispatch_async 1398.3.3 dispatch_after 1408.3.4 dispatch_apply 1408.4 Sequences and Generators 1418.5 Operators 1458.5.1 Operator Overloading 1468.5.2 Custom Operators 147Exercises 148Index 149

About the Author

Matt Henderson has been developing for Apple's platforms since 2009 and is currently a Cocoa engineer at MartianCraft. He's given several presentations at various user groups and conferences, including 360iDev, Cocoaheads Denver, and Boulder iOS Meetup. He realized he might have a future in software when he discovered it was easier for him to program his graphing calculator to solve equations than it was to study for his math tests. He thinks that the best debugging technique is taking a walk outside in the sun or snow.Dave Wood has been developing for iOS since 2008 and OS X since 2009. He began writing code at age 9 on a TI/99/4A and instantly fell in love. He has worked on various types of projects, including systems that interface with stock exchanges, news outlets, and banking systems, as well as newspaper websites and, of course, mobile apps ranging from games, social networks, financial apps, and productivity and developer apps. When possible, he enjoys whitewater kayaking and scuba diving. Currently he runs his own development studio, Cerebral Gardens, and freelances as a Cocoa engineer for MartianCraft.

Look for similar items by category
Home » Books
How Fishpond Works
Fishpond works with suppliers all over the world to bring you a huge selection of products, really great prices, and delivery included on over 25 million products that we sell. We do our best every day to make Fishpond an awesome place for customers to shop and get what they want — all at the best prices online.
Webmasters, Bloggers & Website Owners
You can earn a 5% commission by selling Swift for the Really Impatient on your website. It's easy to get started - we will give you example code. After you're set-up, your website can earn you money while you work, play or even sleep! You should start right now!
Authors / Publishers
Are you the Author or Publisher of a book? Or the manufacturer of one of the millions of products that we sell. You can improve sales and grow your revenue by submitting additional information on this title. The better the information we have about a product, the more we will sell!
Item ships from and is sold by Fishpond World Ltd.
Back to top