Mastering Swift.
Swift is Apple's new innovative and user-friendly development language, which is packed with modern features to make programming easier, fun, and flexible. This book begins by giving you a solid Introduction to the Swift programming language so you can quickly begin developing applications usin...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing,
2015.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover
- Copyright
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Table of Contents
- Preface
- Chapter 1: Taking the First Steps with Swift
- What is Swift?
- Swift features
- Playgrounds
- Getting started with Playgrounds
- iOS and OS X Playgrounds
- Showing images in a Playground
- Displaying graphs in Playgrounds
- What Playgrounds are not
- Swift language syntax
- Comments
- Semicolons
- Parentheses
- Curly braces
- Assignment operator (=) does not return a value
- Spaces are optional in conditional and assignment statementsHello world
- Summary
- Chapter 2: Learning about Variables, Constants, Strings, and Operators
- Constants and variables
- Defining constants and variables
- Type safety
- Type inference
- Explicit types
- Numeric types
- Integers
- Floating-point
- The Boolean type
- The string type
- Optional variables
- Enumerations
- Operators
- The assignment operator
- Comparison operators
- Arithmetic operators
- The remainder operator
- Increment and decrement operators
- Compound assignment operatorsThe ternary conditional operator
- The logical NOT operator
- The logical AND operator
- The logical OR operator
- Summary
- Chapter 3: Using Collections and Cocoa Data Types
- Swift collection types
- Mutability
- Arrays
- Creating and initializing arrays
- Accessing the array elements
- Counting the elements of an array
- Is the array empty?
- Appending to an array
- Inserting a value into an array
- Replacing elements in an array
- Removing elements from an array
- Adding two arrays
- Reversing an arrayRetrieving a subarray from an array
- Making bulk changes to an array
- Algorithms for arrays
- sort
- sorted
- filter
- map
- Iterating over an array
- Dictionaries
- Creating and initializing dictionaries
- Accessing dictionary values
- Counting key/values in a dictionary
- Is the dictionary empty?
- Updating the value of a key
- Adding a key-value pair
- Removing a key-value pair
- Tuples
- Using Cocoa data types
- NSNumber
- NSString data type
- NSArray
- NSDictionary
- Foundation data types
- SummaryChapter 4: Control Flow and Functions
- What we have learned so far
- Curly brackets
- Parenthesis
- Control flow
- Conditional statements
- The if statement
- Executing codes with the if-else statement
- The for loops
- Using the for loop variant
- Using the for-in loop variant
- The while loop
- Using the while loop
- Using the do-while loop
- The switch statement
- Control transfer statements
- The continue statement
- The break statement
- The fallthrough statement
- Functions
- Using a single parameter function