Book description
Get up and running with Swift—swiftlyBrimming with expert advice and easy-to-follow instructions, Swift For Dummies shows new and existing programmers how to quickly port existing Objective-C applications into Swift and get into the swing of the new language like a pro. Designed from the ground up to be a simpler programming language, it's never been easier to get started creating apps for the iPhone or iPad, or applications for Mac OS X.
Inside the book, you'll find out how to set up Xcode for a new Swift application, use operators, objects, and data types, and control program flow with conditional statements. You'll also get the scoop on creating new functions, statements, and declarations, learn useful patterns in an object-oriented environment, and take advantage of frameworks to speed your coding along. Plus, you'll find out how Swift does away with pointer variables and how to reference and dereference variables instead.
- Set up a playground development environment for Mac, iPhone, iPad, and wearable computers
- Move an existing Objective-C program to Swift
- Take advantage of framework components and subcomponents
- Create an app that uses location, mapping, and social media
Whether you're an existing Objective-C programmer looking to port your code to Swift or you've never programmed for Apple in the past, this fun and friendly guide gets you up to speed swiftly.
Table of contents
-
- Cover
- Title Page
- Introduction
- Part I: Getting Started with Swift
-
Part II: Introducing Actions
-
Chapter 5: Operating on Data
- Classifying Operators
- Answering Syntax Questions with Playgrounds
- Clearing the Way for Operators
- Assigning Values with Assignment Operators
- Counting On Arithmetic Operators for Math
- Addition
- Multiplication
- Division
- Incrementing and decrementing numeric values
- Combining operators
- Comparing values
- Choosing and Checking Values with Logical Operators
- Chapter 6: Using Swift Types
- Chapter 7: Collecting Objects
- Chapter 8: Controlling the Flow
- Chapter 9: Functioning Successfully
-
Chapter 5: Operating on Data
- Part III: Putting Expressions Together
-
Part IV: Using Components and Subcomponents
- Chapter 13: Expanding Objects with Extensions
- Chapter 14: Managing Access Control for Your Objects
- Chapter 15: Building Classes, Structures, and Enumerations
- Chapter 16: Using Properties, Variables, Outlets, and Actions
- Chapter 17: Working with Enumerations to Consolidate Values
- Chapter 18: Using Protocols to Provide Templates for Functionality
- Chapter 19: Mixing Objective-C and Swift
-
Part V: The Part of Tens
-
Chapter 20: Ten Swift Features That Aren’t in Objective-C
- Using Playgrounds to Explore Code and Syntax
- Using Tuples
- Using Ranges to Save Code
- Taking Advantage of Strict Typing and Type Safety
- Initializing Your Variables and Constants
- Understanding Optional Types
- Looking at Frameworks for Your Own Code
- Including Annotations and Attributes in Declarations
- Deinitializing Variables Where Necessary
- Use Patterns to Simplify Your Code
-
Chapter 21: Ten Swift Features That Are Not in C
- Strong Typing
- Libraries Extend C
- Switch Statements Fall through Cases in C
- C Is an International Standard
- Swift Is Tightly Linked to the Cocoa and Cocoa Touch Frameworks
- Swift Includes Memory Management
- Swift Is Designed to Function in a Multi-Threaded Environment
- Types Can Be Created Easily in Swift
- Swift Has Its Own IDE and Compiler
- Types Can Be Classes, Structures, or Enumerations
-
Chapter 22: Ten Objective-C Features That Aren’t in Swift
- Saying Goodbye to Header (.h) Files
- Saying Farewell to Dangling Pointers (Almost Always)
- Forgetting About Uninitialized Variables and Properties
- Exploiting a Common Superclass Like NSObject
- Managing Type Casting
- Preferring Closures to Blocks
- Getting Rid of Legacy Memory Management
- Replacing Property Decorators
- Using Swift Style to Access Class Properties
- Clarifying Swift Access Control
-
Chapter 20: Ten Swift Features That Aren’t in Objective-C
- About the Author
- Author’s Acknowledgments
- Cheat Sheet
- Advertisement Page
- Connect with Dummies
- End User License Agreement
Product information
- Title: Swift For Dummies
- Author(s):
- Release date: February 2015
- Publisher(s): For Dummies
- ISBN: 9781119022220
You might also like
book
Swift in Depth
Swift in Depth guides you concept by concept through the skills you need to build professional …
book
The Art of Communication
Bring nuance, depth, and meaning to every conversation you have The Art of Communication is for …
book
The Self-Taught Computer Scientist
The Self-Taught Computer Scientist is Cory Althoff's follow-up to The Self-Taught Programmer, which inspired hundreds of …
audiobook
Technically Wrong
Buying groceries, tracking our health, finding a date: whatever we want to do, odds are that …