Mastering Swift 4, 4th Edition-Packt Publishing(2017).pdf
Chapter 1, Taking the First Steps with Swift, introduces you to the the Swift programming language and discusses what inspired Apple to create Swift. We'll also go over the basic syntax of Swift and how to use Playgrounds to experiment and test the Swift code. Chapter 2, Learning about Variables, Constants, Strings, and Operators, introduces you to variables and constants in Swift and when to use them. We will also look at the most common operators in the Swift language. Chapter 3, Using Swift Collections and the Tuple Type, exp lains Swift's array, set, and dictionary collection types and shows examples of how to use them. We'll also show how to use the Tuple type in Swift. Chapter 4, Control Flow and Functions, shows you how to use Swift's control flow statements. These include loops, conditional, and control transfer statements. The second half of the chapter is all about functions. Chapter 5, Classes and Structures, dedicates itself to Swift's classes and structures. We'll look at what makes them similar and what makes them different. We'll also look at access controls. We will conclude this chapter by looking at memory management in Swift, so you will understand how ARC works and how to avoid strong reference cycles. Chapter 6, Using Protocols and Protocol Extensions, covers both protocols and protocol extensions in detail because protocols are very important to the Swift language, and having a solid understanding of them will help us write flexible and reusable code. Chapter 7, Protocol-Oriented Design, covers the best practices of protocol-oriented design with Swift. This will be a brief overview of what is covered in the protocol-oriented programming book. Chapter 8, Writing Safer Code with Availability and Error Handling, covers error handling in depth as well as the new availability feature. This feature is really important for writing safe code. Chapter 9, Custom Subscripting, discusses how we can use custom subscripts in our classes, structures, and enumerations. Chapter 10, Using Optional Types, explains what optional types really are and what are the various ways to unwrap them. For a developer who is just learning Swift, optional types can be one of the most confusing items to learn. Chapter 11, Working with Generics, explains how Swift implements generics. Generics are a very important part of the Swift language and it is essential to understand them. Chapter 12, Working with Closures, teaches you how to define and use closures in our code. Closures in Swift are similar to blocks in Objective-C except that they have a much cleaner and easier way of using syntax. Chapter 13, Using Mix and Match, explains mix and match and demonstrates how you can include Swift code in your Objective-C projects and Objective-C code in your Swift projects. Chapter 14, Concurrency and Parallelism in Swift, shows you how to use both grand central dispatch and operation queues to add concurrency and parallelism to your applications. Understanding and knowing how to add concurrency and parallelism to your apps can significantly enhance the user experience. Chapter 15, Swift Formatting and Style Guide, defines a style guide for the Swift language that can be used as a template for enterprise developers who need to create a style guide. Chapter 16, Swift Core Libraries, explores some of the functionality in the Swift core library. This will include accessing REST services working with JSON data and the formatting framework. Chapter 17, Adopting Design Patterns in Swift, shows you how to implement some of the more common design patterns in Swift. A design pattern identifies a common software development problem and provides a strategy for dealing with it.
用户评论