Index
A
- addExecutionBlock() method / Using the NSBlockOperation implementation of NSOperation
- algorithms, for arrays
- sortInPlace / sortInPlace
- sort / sort
- filter / filter
- map / map
- forEach / forEach
- arithmetic operators
- about / Arithmetic operators
- array algorithms, Swift
- closures, using with / Using closures with Swift's array algorithms
- arrays
- about / Arrays
- creating / Creating and initializing arrays
- initializing / Creating and initializing arrays
- array elements, accessing / Accessing the array elements
- elements, counting / Counting the elements of an array
- checking, if empty / Is the array empty?
- appending / Appending to an array
- value, inserting / Inserting a value into an array
- elements, replacing / Replacing elements in an array
- elements, removing / Removing elements from an array
- adding / Adding two arrays
- reversing / Reversing an array
- subarray, retrieving / Retrieving a subarray from an array
- bulk changes, making / Making bulk changes to an array
- algorithms / Algorithms for arrays
- iterating over / Iterating over an array
- assignment operator
- about / The assignment operator
- associated types
- about / Generic types, Associated types
- Automatic Reference Counting (ARC) / Memory management
- availability attribute
- about / The availability attribute
- arguments / The availability attribute
B
- base class
- about / Inheritance
- behavioral design patterns
- defining / Behavioral design patterns
- Chain of responsibility / Behavioral design patterns
- command / Behavioral design patterns
- Iterator / Behavioral design patterns
- Mediator / Behavioral design patterns
- Memento / Behavioral design patterns
- Observer / Behavioral design patterns
- State / Behavioral design patterns
- Strategy / Behavioral design patterns
- Visitor / Behavioral design patterns
- command design pattern / The command design pattern
- strategy pattern / The strategy pattern
- Boolean type
- about / The Boolean type
C
- calculated subscripts
- about / Calculated subscripts
- classes and structures
- about / What are classes and structures?
- similarities / Similarities between classes and structures
- differences / Differences between classes and structures
- value, versus reference types / Value versus reference types
- creating / Creating a class or structure
- properties / Properties
- property observers / Property observers
- methods / Methods
- closures
- defining / An introduction to closures
- used, for shorthand syntax / Shorthand syntax for closures
- using, with array algorithms / Using closures with Swift's array algorithms
- selecting, based on results / Selecting a closure based on results
- reference cycles, defining with / Creating strong reference cycles with closures
- Cocoa data types
- using / Using Cocoa data types
- NSNumber / NSNumber
- NSString data type / NSString
- NSArray / NSArray
- NSDictionary / NSDictionary
- collection
- about / Swift collection types
- common files, XML and JSON
- about / Common files
- comparison operator
- about / Comparison operators
- compound assignment operators
- about / Compound assignment operators
- computed properties
- about / Computed properties
- concurrency
- and parallelism / Concurrency and parallelism
- about / Concurrency and parallelism
- and parallelism, differentiating / Concurrency and parallelism
- GCD / Grand Central Dispatch
- dispatch queues, creating / Creating and managing dispatch queues
- dispatch queues, managing / Creating and managing dispatch queues
- conditional statement
- about / Conditional statements
- if statement / The if statement
- conditional code execution, with if-else statement / Conditional code execution with the if-else statement
- constants and variables
- about / Constants and variables
- defining / Defining constants and variables
- type safety / Type safety
- type inference / Type inference
- explicit types / Explicit types
- numeric types / Numeric types
- Boolean type / The Boolean type
- string type / The string type
- optional variables / Optional variables
- enumerations / Enumerations
- control flow
- about / Control flow
- conditional statement / Conditional statements
- for loops / The for loops
- while loop / The while loop
- switch statement / The switch statement
- case and where statements, with conditional statements / Using case and where statements with conditional statements
- control transfer statements / Control transfer statements
- control transfer statements
- about / Control transfer statements
- continue statement / The continue statement
- break statement / The break statement
- fallthrough statement / The fallthrough statement
- guard statement / The guard statement
- creational patterns
- defining / Creational patterns
- abstract factory pattern / Creational patterns
- builder pattern / Creational patterns
- factory method pattern / Creational patterns, The factory method pattern
- prototype pattern / Creational patterns
- singleton pattern / Creational patterns
- singleton design pattern / The singleton design pattern
- builder design pattern / The builder design pattern
- curly brackets
- about / Curly brackets
- custom initializers
- about / Custom initializers
- internal parameter names / Internal and external parameter names
- external parameter names / Internal and external parameter names
- failable initializer / Failable initializers
- custom subscript
- using / Introducing subscripts
- creating / Introducing subscripts
- usage, avoiding / When not to use a custom subscript
- custom subscripts
- defining / Read and write custom subscripts
- reading / Read and write custom subscripts
- writing / Read and write custom subscripts
- read-only / Read-only custom subscripts
D
- design patterns
- defining / What are design patterns
- creational patterns / What are design patterns
- structural patterns / What are design patterns
- behavioral patterns / What are design patterns
- dictionaries
- about / Dictionaries
- creating / Creating and initializing dictionaries
- initializing / Creating and initializing dictionaries
- dictionary values, accessing / Accessing dictionary values
- key, counting / Counting key or values in a dictionary
- values, counting / Counting key or values in a dictionary
- checking, if empty / Is the dictionary empty?
- value of key, updating / Updating the value of a key
- key-value pair, adding / Adding a key-value pair
- key-value pair, removing / Removing a key-value pair
- dispatch queues
- creating / Creating and managing dispatch queues
- managing / Creating and managing dispatch queues
- dispatch_queue_create function / Creating and managing dispatch queues
- dispatch_get_global_queue function / Creating and managing dispatch queues
- dispatch_get_main_queue function / Creating and managing dispatch queues
- dispatch_async function / Creating and managing dispatch queues
- dispatch_sync function / Creating and managing dispatch queues
- dispatch_after function / Creating and managing dispatch queues
- dispatch_once function / Creating and managing dispatch queues
- creating, with dispatch_queue_create() function / Creating queues with the dispatch_queue_create() function, Creating concurrent dispatch queues with the dispatch_queue_create() function
- concurrent queues, requesting with dispatch_get_global_queue() function / Requesting concurrent queues with the dispatch_get_global_queue() function
- main queue, requesting with dispatch_get_main_queue() function / Requesting the main queue with the dispatch_get_main_queue() function
- dispatch_after() function, using / Using the dispatch_after() function
- dispatch_once() function, using / Using the dispatch_once() function
- dispatch_after() function
- dispatch_async() function / Creating concurrent dispatch queues with the dispatch_queue_create() function
- dispatch_get_global_queue() function
- used, for requesting concurrent queues / Requesting concurrent queues with the dispatch_get_global_queue() function
- dispatch_get_main_queue() function
- used, for requesting main queue / Requesting the main queue with the dispatch_get_main_queue() function
- dispatch_once() function
- dispatch_queue_create() function
- used, for creating dispatch queues / Creating queues with the dispatch_queue_create() function
- label parameter / Creating queues with the dispatch_queue_create() function
- attr parameter / Creating queues with the dispatch_queue_create() function
- used, for creating concurrent dispatch queues / Creating concurrent dispatch queues with the dispatch_queue_create() function
- used, for creating serial dispatch queue / Creating a serial dispatch queue with the dispatch_queue_create() function
- Document Object Model (DOM) parsers / XML and the NSXMLParser class
- Document Type Definition (DTD) markup
- Document Object Model (DOM) parsers / Using the NSXMLParserDelegate protocol
E
- enumerations
- about / Enumerations
- error handling
- error handling, Swift 2
- about / Error handling in Swift 2
- errors, representing / Representing errors
- errors, throwing / Throwing errors
- errors, catching / Catching errors
- explicit types
- about / Explicit types
- extensions
- about / Extensions, Extensions
- defining / Extensions
- setImageForURL() / Extensions
- setImageForRSTransaction() / Extensions
F
- failable initializer
- about / Failable initializers
- first-in, first-out (FIFO) / Grand Central Dispatch
- for-case statement
- filtering with / Filtering with the for-case statement
- for-in loop variant
- using / Using the for-in loop variant
- for loops
- about / The for loops
- for loop variant
- using / Using the for loop variant
- foundation data types
- about / Foundation data types
- functionality
- changing / Changing functionality
- functions
- about / Functions
- single parameter function, using / Using a single parameter function
- multiparameter function, using / Using a multiparameter function
- parameters default values, defining / Defining a parameter's default values
- multiple values, returning from / Returning multiple values from a function
- optional values, returning / Returning optional values
- external parameter names, adding / Adding external parameter names
- variadic parameters, using / Using variadic parameters
- parameters as variables / Parameters as variables
- inout parameters, using / Using inout parameters
- nesting functions / Nesting functions
- implementing / Putting it all together
- functions, RSTransactionRequest
- dataFromRSTransaction() / RSTransactionRequest
- stringFromRSTransaction() / RSTransactionRequest
- dictionaryFromRSTransaction() / RSTransactionRequest
- imageFromRSTransaction() / RSTransactionRequest
G
- GCD
- about / Concurrency and parallelism, Grand Central Dispatch
- queues, types / Grand Central Dispatch
- generic functions
- about / Generic functions
- defining / Generic functions
- generics
- about / An introduction to generics
- generic types
- about / Generic types
- defining / Generic types
- global dispatch queue / Grand Central Dispatch
H
- Hello World application
- about / Hello World
- HTTP GET request
- creating / Making an HTTP GET request
- HTTP POST request
- URL / Making an HTTP POST request
- creating / Making an HTTP POST request
I
- if-case statement
- using / Using the if-case statement
- increment and decrement operators
- inheritance
- about / Inheritance
J
- JSON
- about / XML and JSON
- NSJSONSerialization / JSON and NSJSONSerialization
- JSON document
- parsing / Parsing a JSON document
- creating / Creating a JSON document
L
- logical AND operator
- about / The logical AND operator
- logical NOT operator
- about / The logical NOT operator
- logical OR operator
- about / The logical OR operator
M
- main queue / Using NSOperation and NSOperationQueue types
- memory management
- about / Memory management
- reference, versus value types / Reference versus value types
- working, of ARC / The working of ARC
- strong reference cycle / Strong reference cycles
- MessageBuilder Swift class / The MessageBuilder Swift class – accessing Objective-C code from Swift
- Messages Objective-C class / The Messages Objective-C class
- methods
- about / Methods
- overriding / Overriding methods and properties, Overriding methods
- mix and match
- about / What is mix and match
- Mix and Match feature
- about / Swift features
- multidimensional subscripts
- about / Multidimensional subscripts
- mutability
- about / Mutability
N
- naming rules, programming style guide
- about / Naming
- classes / Classes
- functions / Functions and methods
- methods / Functions and methods
- constants / Constants and variables
- variables / Constants and variables
- indenting / Indenting
- network connection
- checking / Checking network connection
- network development
- about / What is network development?
- nil coalescing operator
- about / The nil coalescing operator
- NSBlockOperation class / Using the NSBlockOperation implementation of NSOperation
- NSJSONSerialization class
- about / JSON and NSJSONSerialization
- NSMutableURLRequest / NSMutableURLRequest
- NSOperation class
- subclassing / Subclassing the NSOperation class
- NSOperationQueue types
- NSOperation types
- using / Using NSOperation and NSOperationQueue types
- NSBlockOperation implementation, using / Using the NSBlockOperation implementation of NSOperation
- addOperationWithBlock() method, using / Using the addOperationWithBlock() method of the operation queue
- NSURL class
- using / Using the NSURL class
- NSURLHTTPResponse / NSURLHTTPResponse
- NSURLSessionConfiguration class
- about / NSURLSessionConfiguration
- default session configuration / NSURLSessionConfiguration
- Ephemeral session configuration / NSURLSessionConfiguration
- background session configuration / NSURLSessionConfiguration
- NSURLSession object / NSURLSession
- NSURLSession service
- about / NSURLSessionTask
- NSURLSessionDataTask / NSURLSessionTask
- NSURLSessionDownloadTask / NSURLSessionTask
- NSURLSessionUploadTas / NSURLSessionTask
- NSXMLParser class
- about / XML and the NSXMLParser class
- using / XML and the NSXMLParser class
- NSXMLParserDelegate protocol
- numeric types
- about / Numeric types
- integers / Integers
- floating-point / Floating-point
O
- Objective-C
- combining, with Swift / Using Swift and Objective-C together in the same project
- bridging header file / The Objective-C bridging header file – part 1, The Objective-C bridging header file – part 2
- code, accessing from Swift / The MessageBuilder Swift class – accessing Objective-C code from Swift
- Objective-C, combing with Swift
- about / Using Swift and Objective-C together in the same project
- project, creating / Creating the project
- Swift file, adding / Adding Swift file to the Objective-C project
- Objective-C bridging header file / The Objective-C bridging header file – part 1, The Objective-C bridging header file – part 2
- Objective-C file, adding / Adding the Objective-C file to the project
- Messages Objective-C class / The Messages Objective-C class
- MessageBuilder Swift class / The MessageBuilder Swift class – accessing Objective-C code from Swift
- Objective-C class / The Objective-C class – accessing Swift code from Objective-C
- Objective-C class / The Objective-C class – accessing Swift code from Objective-C
- Objective-C project
- Swift file, adding / Adding Swift file to the Objective-C project
- Objective-C file, adding / Adding the Objective-C file to the project
- operators
- about / Operators
- assignment operator / The assignment operator
- comparison operator / Comparison operators
- arithmetic operator / Arithmetic operators, The remainder operator
- increment and decrement operators / Increment and decrement operators
- compound assignment operators / Compound assignment operators
- ternary conditional operator / The ternary conditional operator
- logical NOT operator / The logical NOT operator
- logical AND operator / The logical AND operator
- logical OR operator / The logical OR operator
- optional binding
- about / Optional binding
- optional chaining
- about / Optional chaining
- nil coalescing operator / The nil coalescing operator
- optionals
- about / Introducing optionals
- defining / Defining an optional
- using / Using optionals
- forced unwrapping / Forced unwrapping an optional
- returning, from functions / Returning optionals from functions, methods, and subscripts
- returning, from methods / Returning optionals from functions, methods, and subscripts
- returning, from subscripts / Returning optionals from functions, methods, and subscripts
- using, as parameter in function or method / Using optionals as a parameter in a function or method
- optional type, programming style guide
- about / Optional types
- optional binding, using / Use optional binding
- optional chaining, using for multiple unwrapping / Use optional chaining over optional binding for multiple unwrapping
- optional types
- need for / The need for optional types in Swift
- with tuples / Optional types with tuples
- optional variables
- about / Optional variables
- overrides
- preventing / Preventing overrides
P
- parallelism
- about / Concurrency and parallelism
- parentheses
- about / Parentheses
- Playground
- about / Getting started with Playgrounds
- coding area section / Getting started with Playgrounds
- results sidebar section / Getting started with Playgrounds
- debug area section / Getting started with Playgrounds
- starting / Getting started with Playgrounds
- saving / Getting started with Playgrounds
- iOS Playground / iOS and OS X Playgrounds
- OS X Playground / iOS and OS X Playgrounds
- images, displaying / Showing images in a Playground
- graphs, creating / Creating and displaying graphs in Playgrounds
- graphs, displaying / Creating and displaying graphs in Playgrounds
- limitations / What Playgrounds are not
- Playgrounds
- about / Playgrounds
- sections / Getting started with Playgrounds
- priorities, concurrent queues
- DISPATCH_QUEUE_PRIORITY_HIGH / Requesting concurrent queues with the dispatch_get_global_queue() function
- DISPATCH_QUEUE_PRIORITY_DEFAULT / Requesting concurrent queues with the dispatch_get_global_queue() function
- DISPATCH_QUEUE_PRIORITY_LOW / Requesting concurrent queues with the dispatch_get_global_queue() function
- DISPATCH_QUEUE_PRIORITY_BACKGROUND / Requesting concurrent queues with the dispatch_get_global_queue() function
- private queue / Grand Central Dispatch
- programming style guide
- about / What is a programming style guide?
- designing / Your style guide
- semicolons at end of statements, avoiding / Do not use semicolons at the end of statements
- parentheses for conditional statements, avoiding / Do not use parentheses for conditional statements
- naming / Naming
- comments / Comments
- self keyword, using / Using the self keyword
- types / Types
- constants / Constants and variables
- variables / Constants and variables
- optional types / Optional types
- type inference, using / Use type inference
- shorthand declaration, using for collections / Use shorthand declaration for collections
- for-in loops, using / Use for-in loops over for loops
- switch, using instead of multiple if statements / Use switch rather than multiple if statements
- commented-out code, avoiding in application / Don't leave commented-out code in your application
- Grand Central Dispatch / Grand Central Dispatch
- attribute, setting in dispatch_queue_create() function / Set the attribute in the dispatch_queue_create() function
- reverse DNS name, using for tag parameter of dispatch_queue_create() function / Use a reverse DNS name for the tag parameter of the dispatch_queue_create() function
- dispatch_get_global_queue, using / Use dispatch_get_global_queue() over dispatch_queue_create()
- properties, classes and structures
- stored properties / Properties, Stored properties
- computed properties / Properties, Computed properties
- overriding / Overriding methods and properties, Overriding properties
- properties, RSTransaction
- TransactionType / RSTransaction
- baseURL, URL / RSTransaction
- baseURL / RSTransaction
- path / RSTransaction
- parameters / RSTransaction
- properties, RSTransactionRequest
- transactionType / RSTransactionRequest
- baseURL / RSTransactionRequest
- path / RSTransactionRequest
- parameters / RSTransactionRequest
- property observers
- about / Property observers
- protocol extensions
- about / Protocol extensions
- using / Protocol extensions
- protocols
- about / Protocols, Protocols as types
- syntax / Protocol syntax
- property requirements / Property requirements
- method requirements / Method requirements
- optional requirements / Optional requirements
- as type / Protocols as types
- for polymorphism / Polymorphism with protocols
- for type casting / Type casting with protocols
Q
- queue types, GCD
- about / Grand Central Dispatch
- serial queues / Grand Central Dispatch
- concurrent queues / Grand Central Dispatch
- main dispatch queue / Grand Central Dispatch
R
- reference cycles
- defining, with closures / Creating strong reference cycles with closures
- reference types
- versus value / Value versus reference types
- remainder operator
- about / The remainder operator
- repeat-while loop
- using / Using the repeat-while loop
- REST
- web services / REST web services
- RSNetworking
- about / Checking network connection
- for Swift 2 / RSNetworking2 for Swift 2
- URL / RSNetworking2 for Swift 2
- RSURLRequest / RSNetworking2 for Swift 2
- RSTransaction / RSNetworking2 for Swift 2
- RSTransactionRequest / RSNetworking2 for Swift 2
- Extensions* RSNetworking2 / RSNetworking2 for Swift 2
- RSNetworking, for Swift 2
- RSURLRequest / RSURLRequest
- RSTransaction / RSTransaction and RSTransactionRequest, RSTransaction
- RSTransactionRequest / RSTransaction and RSTransactionRequest, RSTransactionRequest
- extensions / Extensions
- URL / Extensions
- RSURLRequest
- about / RSURLRequest
- dataFromURL() function / RSURLRequest
- stringFromURL() function / RSURLRequest
- dictionaryFromJsonUR() function / RSURLRequest
- imageFromURL() function / RSURLRequest
S
- Search API
- separator parameter
- about / Hello World
- serial dispatch queue
- creating, with dispatch_queue_create() function / Creating a serial dispatch queue with the dispatch_queue_create() function
- set
- about / Set
- initializing / Initializing a set
- items, inserting / Inserting items into a set
- number of items / The number of items in a set
- checking, whether contains item / Checking whether a set contains an item
- iterating over / Iterating over a set
- items, removing / Removing items in a set
- set operations
- about / Set operations
- union / Set operations
- unionInPlace / Set operations
- subtract / Set operations
- subtractInPlace / Set operations
- intersect / Set operations
- intersectInPlace / Set operations
- exclusiveOr / Set operations
- exclusiveOrInPlace / Set operations
- shorthand syntax
- used, for closures / Shorthand syntax for closures
- Simple API for XML (SAX) parser / XML and the NSXMLParser class
- simple closures
- defining / Simple closures
- standalone closures
- and style guidelines / Standalone closures and good style guidelines
- stored properties
- about / Stored properties
- string type
- about / The string type
- structural design patterns
- defining / Structural design patterns
- Adapter / Structural design patterns
- Bridge / Structural design patterns
- Composite / Structural design patterns
- Decorator / Structural design patterns
- Façade / Structural design patterns
- Flyweight / Structural design patterns
- Proxy / Structural design patterns
- bridge pattern / The bridge pattern
- façade pattern / The façade pattern
- proxy design pattern / The proxy design pattern
- subclasses
- about / Inheritance
- subscripts
- about / Introducing subscripts
- with Swift arrays / Subscripts with Swift arrays
- calculated subscripts / Calculated subscripts
- subscript values / Subscript values
- with ranges / Subscripts with ranges
- external names / External names for subscripts
- multidimensional subscripts / Multidimensional subscripts
- Swift
- about / What is Swift?
- features / Swift features
- Playgrounds / Playgrounds
- Hello World application / Hello World
- combing, with Objective-C / Using Swift and Objective-C together in the same project
- Swift 2
- RSNetworking / RSNetworking2 for Swift 2
- Swift collection types
- about / Swift collection types
- Swift language syntax
- about / Swift language syntax
- comments, writing / Comments
- semicolons / Semicolons
- parentheses / Parentheses
- curly braces / Curly braces
- assignment operator, using / An assignment operator does not return a value
- spaces, using / Spaces are optional in conditional and assignment statements
- switch statement
- about / The switch statement
T
- terminator parameter
- about / Hello World
- ternary conditional operator
- about / The ternary conditional operator
- TextValidationProtocol protocol
- about / Protocol extensions
- regExMatchingString property / Protocol extensions
- regExFindMatchString property / Protocol extensions
- validationMessage property / Protocol extensions
- validateString method / Protocol extensions
- getMatchingString method / Protocol extensions
- toStream parameter
- about / Hello World
- tuples
- about / Tuples
- type inference
- about / Type inference
- type safety
- about / Type safety
U
- URL session classes
- overview / An overview of the URL session classes
- NSURLSession / An overview of the URL session classes, NSURLSession
- NSURLSessionConfiguration / An overview of the URL session classes, NSURLSessionConfiguration
- NSURLSessionTask / An overview of the URL session classes, NSURLSessionTask
- NSURL / An overview of the URL session classes
- NSMutableURLRequest / An overview of the URL session classes, NSMutableURLRequest
- NSHTTPURLResponse / An overview of the URL session classes
- NSURL class, using / Using the NSURL class
- NSURLHTTPResponse / NSURLHTTPResponse
V
- value
- versus reference types / Value versus reference types
W
- where statement
- filtering with / Filtering with the where statement
- while loop
- about / The while loop
- using / Using the while loop
X
- XML
- about / XML and JSON
- and NSXMLParser class / XML and the NSXMLParser class
- and NSXMLDocument / XML and NSXMLDocument
- XML documents
- parsing / Parsing XML documents
- building, manually / XML and manually building XML documents