Book description
Unleash the power of Swift and discover the skills required to build incredible robust iOS applications
About This Book
- Write expressive, understandable, and maintainable Swift 2 code with this hands-on course
- Unveil the complex underpinnings of Swift to turn your app ideas into reality
- Specialize in developing real iOS apps, and 2D and 3D video games using Swift and Cocoapods
- Dive deep into protocol extensions, learn new error handling model and use featured Swift design patterns to write more efficient code
Who This Book Is For
This course would be for app developers who are new to developing for iOS or OSX and are trying to get grips with Swift for the first time.
What You Will Learn
- From a solid understanding of the Swift 2 language
- Get to know the practical aspects of how a computer program actually works
- Understand the paradigms used by Apple's frameworks, so you are not intimidated by them
- Create a server in Swift to deliver JSON data to an iOS app
- Take advantage of Cocoapods to use third-party libraries
- Build games with SpriteKit and SceneKit
- Develop an app running on the cloud to act as an API server for your client's apps
- Dive into the core components of Swift 2 including operators, collections, control flow, and functions
- Create and use classes, structures, and enums including object-oriented topics such as inheritance, protocols, and extensions
- Develop a practical understanding of subscripts, optionals, and closures
- Master Objective-C interoperability with mix and match
- Access network resources using Swift
- Implement various standard design patterns in the Swift language
In Detail
The Swift??Developing iOS Applications course will take you on a journey to become an efficient iOS and OS X developer, with the latest trending topic in town. Right from the basics to the advanced level topics, this course would cover everything in detail. We'll embark our journey by dividing the learning path into four modules. Each of these modules are a mini course in their own right; and as you complete each one, you'll gain key skills and be ready for the material in the next module.
The first module is like a step-by-step guide to programming in Swift 2. Each topic is separated into compressible sections that are full of practical examples and easy-to-understand explanations. Each section builds on the previous topics, so you can develop a proficient and comprehensive understanding of app development in Swift 2. By the end of this module, you'll have a basic understanding of Swift 2 and its functionalities.
The second module will be the an easy-to-follow guide filled with tutorials to show you how to build real-world apps. The difficulty and complexity level increases chapter by chapter. Each chapter is dedicated to build a new app, beginning from a basic and unstyled app through to a full 3D game. The last two chapters show you how to build a complete client-server e-commerce app right from scratch. You'll be able to build well-designed apps, effectively use AutoLayout, develop videogames, and build server apps.
The third and the last module of our course will take an example-based approach where each concept covered is supported by example code to not only give you a good understanding of the concept, but also to demonstrate how to properly implement it.
Style and approach
This course includes all the resources that will help you jump into the app development .This course covers all the important aspects Swift application development and is divided into individual modules so that you develop your skill after the completion of a module and get ready for the next. Through this comprehensive course, you'll learn how to use Swift programming with hands-on examples from scratch to finish!
Table of contents
-
Swift: Developing iOS Applications
- Table of Contents
- Swift: Developing iOS Applications
- Swift: Developing iOS Applications
- Credits
- Preface
-
1. Module 1
- 1. Introducing Swift
- 2. Building Blocks – Variables, Collections, and Flow Control
- 3. One Piece at a Time – Types, Scopes, and Projects
- 4. To Be or Not To Be – Optionals
- 5. A Modern Paradigm – Closures and Functional Programming
- 6. Make Swift Work For You – Protocols and Generics
- 7. Everything Is Connected – Memory Management
- 8. Paths Less Traveled – Error Handling
- 9. Writing Code the Swift Way – Design Patterns and Techniques
- 10. Harnessing the Past – Understanding and Translating Objective-C
- 11. A Whole New World – Developing an App
- 12. What's Next? – Resources, Advice, and the Next Steps
-
2. Module 2
-
1. Welcome to the World of Swift
-
The first look at Swift
- Let's go to the playground
- The building blocks – variables and constants
- Collecting variables in containers
- Controlling the flow
- Transforming the values using functions
- Structs – custom compound types
- Classes – common behavior objects
- Loose coupling with protocols
- Composing objects using protocol extensions
- Checking the existence of an optional value
- Enumerations on steroids
- Extended pattern matching
- Catching errors
- Swift functional programming patterns
- Summary
-
The first look at Swift
- 2. Building a Guess the Number App
- 3. A Memory Game in Swift
- 4. A TodoList App in Swift
- 5. A Pretty Weather App
- 6. Flappy Swift
- 7. Polishing Flappy Swift
- 8. Cube Runner
- 9. Completing Cube Runner
- 10. ASAP – an E-commerce App in Swift
- 11. ASAPServer, a Server in Swift
-
1. Welcome to the World of Swift
-
3. Module 3
-
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
-
1. Taking the First Steps with Swift
- A. Biblography
- Index
Product information
- Title: Swift: Developing iOS Applications
- Author(s):
- Release date: August 2016
- Publisher(s): Packt Publishing
- ISBN: 9781787120242
You might also like
video
iOS 11 Programming with SWIFT: Develop iOS mobile applications from scratch
You want to build iOS applications for the iPhone and iPad, but where do you start? …
book
iOS 11 Swift Programming Cookbook
iOS 11, Swift 4, and Xcode 9 provide many new APIs for iOS developers. With this …
book
iOS Development with Swift
iOS Development with Swift is a hands-on guide to creating apps for iPhone and iPad using …
book
Migrating to Swift from Flash and ActionScript
Build on your knowledge of ActionScript to take the fast track developing iOS apps with Apple's …