
Swift For Dummies.
Title:
Swift For Dummies.
Author:
Feiler, Jesse.
ISBN:
9781119022244
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (387 pages)
Contents:
Title Page -- Copyright Page -- Contents at a Glance -- Table of Contents -- Introduction -- About This Book -- Conventions Used in T his Book -- Foolish Assumptions -- Icons Used in This Book -- Beyond the Book -- Where to Go from Here -- Part I Getting Started with Swift -- Chapter 1 Setting Up an Xcode Swift Project -- Looking Ahead to the End -- Working with Swift -- Getting the Developer Tools -- Setting Up Your Mac -- Registering as a developer -- Preparing your credentials -- Choosing your program -- Planning Your Environment -- Using source control -- Using GitHub -- Organizing files -- Preparing for environmental changes -- Getting Started with Swift -- Installing Xcode and setting preferences -- Creating your project -- Exploring Your Project -- Touring your new project -- Adding a map to the project's interface -- Chapter 2 Playing in the Playground -- Creating a Playground -- Using a Playground -- Testing a line of code -- Checking syntax -- Using the Timeline in the Playground -- Chapter 3 Using the Xcode Editing Tools -- Getting Started with Editing Tools -- Completing Code with Code Completion -- Using basic code completion -- Using code completion in a project -- Working with code completion -- Using Fix‐It to Correct Code -- Folding and Unfolding Code -- Using Code Snippets -- Working with built‐in code snippets -- Creating your own code snippets -- Chapter 4 Creating a Swift App -- Double‐Checking Your Environment -- Creating the Project -- Choosing the name -- Understanding bundles -- Reviewing a project's file structure -- Working with workspaces -- Testing the Template -- Setting the Location for iOS Simulator -- Adding devices to iOS Simulator -- Managing the iOS Simulator location -- Adding the Map to the Storyboard and Project -- Testing the App -- Adding Swift Code to Locatapp.
Setting and confirming location settings in iOS Simulator and on devices -- Making the app display the user's location (Part 1: Core Location) -- Making the app display the user's location (Part 2: MapKit) -- Storing the user's location (Core Data) -- Displaying the stored location -- Testing the App with Location Data -- 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 -- Handling over‐ and underflow conditions -- Subtraction -- Multiplication -- Division -- Handling undefined results and errors -- Using remainder division -- Incrementing and decrementing numeric values -- Combining operators -- Comparing values -- Choosing and Checking Values with Logical Operators -- Chapter 6 Using Swift Types -- Understanding Types and Type Safety -- Considering type safety -- Exploring Swift types -- Swift Standard Library Types -- Strings -- Arrays -- Dictionaries -- Numeric types -- Protocols -- Free functions -- Specifying Variable or Expression Types with Type Annotations -- Dealing with Tuples -- Decomposing a tuple -- Accessing tuple values with names -- Accessing tuple values with index numbers -- Skipping tuple values with underscores -- Creating a tuple with types -- Type safety with tuples -- Working with Optional Types -- Using optional types for values that may or may not exist -- Using forced unwrapping with exclamation marks -- Using optional binding to access an optional value -- Using Generic Types -- Using a generic function -- Using a generic type -- Chapter 7 Collecting Objects -- Playing by Swift Collection Rules -- Managing a collection of objects -- Looking inside a Swift collection object -- Mutability of collections.
Switching mutability -- Organizing Data Sequentially with Arrays -- Comparing full and shorthand array syntax forms -- Creating arrays -- Working with arrays and their elements -- Organizing Data Logically with Dictionaries -- Comparing full and shorthand dictionary syntax forms -- Creating dictionaries -- Working with dictionaries andtheir elements -- Fast enumeration over a dictionary -- Reporting errors with a dictionary -- Chapter 8 Controlling the Flow -- Looping through Code -- Using for loops -- Using while loops -- Using Conditions -- Working with if statements -- Working with switches -- Transferring Control -- Using Assertions -- Chapter 9 Functioning Successfully -- Setting the Stage for the Social Media Location App -- Introducing Locatapp -- Creating the Locatapp project -- Modifying the template -- Exploring the Functions in Locatapp -- Understanding the Locatapp Architecture -- Uncovering the Function Features -- Basic function syntax - configureView() -- Overriding a function - viewDidLoad() -- Calling the super function - viewDidLoad() -- Adding a parameter to a function - controllerWillChangeContent(_:) -- Using multiple parameters in a function - controller(_:didChangeSection:atIndex:forChangeType:) -- Using external names for parameters - controller(_:didChangeSection:atIndex: forChangeType:) -- Returning a value from a function - numberOfSectionsInTableView(_:) -- Adding Location Support -- Part III Putting Expressions Together -- Chapter 10 Expressing Yourself -- Surveying the Types of Swift Expressions -- Exploring optional type operators -- Prefix expressions -- Postfix expressions -- Binary expressions -- Primary expressions -- Understanding Lazy Loading -- Lazy loading with Objective‐C -- Lazy loading the easy way with Swift -- Summarizing lazy loading -- Chapter 11 Declaring the Symbols.
Navigating through Symbols with the Symbol Navigator -- Choosing types of displays -- Choosing what to display -- Preventing Disasters with Assertions -- Patterns -- Ranges -- Chapter 12 Initializing and Deinitializing Data -- Understanding Initialization -- Performing Initialization -- Setting default values for stored properties -- Creating initializers for stored properties -- Adding parameters to initializers -- Understanding Deinitialization -- Part IV Using Components and Subcomponents -- Chapter 13 Expanding Objects with Extensions -- Working with a Swift Extension -- Using Swift Extensions with a Built‐In Class -- Chapter 14 Managing Access Control for Your Objects -- Introducing Access Control Levels -- Using Swift Access Control Terminology -- Modules -- Files -- Entities -- Chapter 15 Building Classes, Structures, and Enumerations -- Exploring Classes, Structures, and Enumerations -- Declaring a Simple Class -- Exploring a Swift Class, Structure, or Enumeration File -- Comments and copyrights -- Import declarations -- Class declaration -- Structure declaration -- Enumeration declaration -- Body -- UI actions and outlets (classes only) -- Variables and properties -- Functions and methods -- Chapter 16 Using Properties, Variables, Outlets, and Actions -- Understanding Properties and Variables -- Encapsulating Data for Good Design and Maintainability -- Understanding Properties and Variables in Locatapp -- Declaring Outlets and Actions -- Chapter 17 Working with Enumerations to Consolidate Values -- Using Enumerations with Swift -- Understanding Traditional C Structures and Enumerations -- Exploring Swift Enumerations -- Working with members of an enumeration -- Working with a function inside an enumeration -- Chapter 18 Using Protocols to Provide Templates for Functionality -- Understanding Protocols -- Experimenting with Protocols.
Declaring a protocol -- Adopting and conforming a class, structure, or enumeration to a protocol -- Exploring Protocols and a UITableViewController -- Looking at delegation and protocols -- Setting delegates in Interface Builder -- Chapter 19 Mixing Objective-C and Swift -- Comparing Frameworks in Objective-C and Swift -- Identifying the key method -- Comparing declarations -- Calling an Objective-C Method in Objective-C within Swift to Set a Pin on the Map -- Bridging between 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.
Abstract:
Get up and running with Swift-swiftly Brimming 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.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Genre:
Electronic Access:
Click to View