Book description
NoneTable of contents
-
Mastering Swift 2
- Table of Contents
- Mastering Swift 2
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Preface
-
1. Taking the First Steps with Swift
- What is Swift?
-
Playgrounds
- Getting started with Playgrounds
- iOS and OS X Playgrounds
- Showing images in a Playground
- Creating and displaying graphs in Playgrounds
- What Playgrounds are not
- Swift language syntax
- Comments
- Semicolons
- Parentheses
- Curly braces
- An assignment operator does not return a value
- Spaces are optional in conditional and assignment statements
- Hello World
- Summary
- 2. Learning about Variables, Constants, Strings, and Operators
-
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 array
- Retrieving a subarray from an array
- Making bulk changes to an array
- Algorithms for arrays
- Iterating over an array
- Dictionaries
- Set
- Tuples
- Using Cocoa data types
- Foundation data types
- Summary
- 4. Control Flow and Functions
- 5. Classes and Structures
- 6. Using Protocols and Protocol Extensions
- 7. Writing Safer Code with Availability and Error Handling
- 8. Working with XML and JSON Data
- 9. Custom Subscripting
- 10. Using Optional Types
- 11. Working with Generics
- 12. Working with Closures
-
13. Using Mix and Match
- What is mix and match
-
Using Swift and Objective-C together in the same project
- Creating the project
- Adding Swift file to the Objective-C project
- The Objective-C bridging header file – part 1
- Adding the Objective-C file to the project
- The Messages Objective-C class
- The Objective-C bridging header file – part 2
- The MessageBuilder Swift class – accessing Objective-C code from Swift
- The Objective-C class – accessing Swift code from Objective-C
- Summary
-
14. Concurrency and Parallelism in Swift
-
Concurrency and parallelism
- Grand Central Dispatch
- Creating and managing dispatch queues
- Using NSOperation and NSOperationQueue types
- Summary
-
Concurrency and parallelism
-
15. Swift Formatting and Style Guide
- What is a programming style guide?
-
Your style guide
- Do not use semicolons at the end of statements
- Do not use parentheses for conditional statements
- Naming
- Comments
- Using the self keyword
- Types
- Constants and variables
- Optional types
- Use type inference
- Use shorthand declaration for collections
- Use for-in loops over for loops
- Use switch rather than multiple if statements
- Don't leave commented-out code in your application
- Grand Central Dispatch
- Set the attribute in the dispatch_queue_create() function
- Use a reverse DNS name for the tag parameter of the dispatch_queue_create() function
- Use dispatch_get_global_queue() over dispatch_queue_create()
- Summary
- 16. Network Development with Swift
- 17. Adopting Design Patterns in Swift
- Index
Product information
- Title: Mastering Swift 2
- Author(s):
- Release date:
- Publisher(s): Packt Publishing
- ISBN: None
You might also like
book
iOS 11 Swift Programming Cookbook
iOS 11, Swift 4, and Xcode 9 provide many new APIs for iOS developers. With this …
video
Swift Video How-To, 1/e
Learn how to... Create Swift Code in a Playground Create Swift Code in a REPL Assign …
book
iOS Programming Cookbook
Over 50 exciting and powerful recipes to help you unearth the promise of iOS programming About …
book
Dokumentation in agilen Projekten
Prägnante und gut strukturierte Dokumente bieten eine hohe Lesbarkeit und einen schnellen Zugriff auf das darin …