
iOS 9 Programming Fundamentals with Swift
Swift, Xcode, and Cocoa Basics
Publisher: O'Reilly Media
Release Date: October 2015
Pages: 604
Read on O'Reilly Online Learning with a 10-day trial
Start your free trial now Buy on AmazonWhere’s the cart? Now you can get everything with O'Reilly Online Learning. To purchase books, visit Amazon or your favorite retailer. Questions? See our FAQ or contact customer service:
1-800-889-8969 / 707-827-7019
support@oreilly.com
Move into iOS development by getting a firm grasp of its fundamentals, including the Xcode IDE, the Cocoa Touch framework, and Swift 2.0—the latest version of Apple's acclaimed programming language. With this thoroughly updated guide, you'll learn Swift’s object-oriented concepts, understand how to use Apple's development tools, and discover how Cocoa provides the underlying functionality iOS apps need to have.
- Explore Swift’s object-oriented concepts: variables and functions, scopes and namespaces, object types and instances
- Become familiar with built-in Swift types such as numbers, strings, ranges, tuples, Optionals, arrays, dictionaries, and sets
- Learn how to declare, instantiate, and customize Swift object types—enums, structs, and classes
- Discover powerful Swift features such as protocols and generics
- Catch up on Swift 2.0 innovations: option sets, protocol extensions, error handling, guard statements, availability checks, and more
- Tour the lifecycle of an Xcode project from inception to App Store
- Create app interfaces with nibs and the nib editor, Interface Builder
- Understand Cocoa’s event-driven model and its major design patterns and features
- Find out how Swift communicates with Cocoa’s C and Objective-C APIs
Once you master the fundamentals, you'll be ready to tackle the details of iOS app development with author Matt Neuburg's companion guide, Programming iOS 9.
Table of Contents
-
Language
-
Chapter 1 The Architecture of Swift
- Ground of Being
- Everything Is an Object?
- Three Flavors of Object Type
- Variables
- Functions
- The Structure of a Swift File
- Scope and Lifetime
- Object Members
- Namespaces
- Modules
- Instances
- Why Instances?
- self
- Privacy
- Design
-
Chapter 2 Functions
- Function Parameters and Return Value
- External Parameter Names
- Overloading
- Default Parameter Values
- Variadic Parameters
- Ignored Parameters
- Modifiable Parameters
- Function In Function
- Recursion
- Function As Value
- Anonymous Functions
- Define-and-Call
- Closures
- Curried Functions
-
Chapter 3 Variables and Simple Types
- Variable Scope and Lifetime
- Variable Declaration
- Computed Initializer
- Computed Variables
- Setter Observers
- Lazy Initialization
- Built-In Simple Types
-
Chapter 4 Object Types
- Object Type Declarations and Features
- Enums
- Structs
- Classes
- Polymorphism
- Casting
- Type Reference
- Protocols
- Generics
- Extensions
- Umbrella Types
- Collection Types
-
Chapter 5 Flow Control and More
- Flow Control
- Operators
- Privacy
- Introspection
- Memory Management
-
-
IDE
-
Chapter 6 Anatomy of an Xcode Project
- New Project
- The Project Window
- The Project File and Its Dependents
- The Target
- From Project to Running App
- Renaming Parts of a Project
-
Chapter 7 Nib Management
- The Nib Editor Interface
- Nib Loading
- Connections
- Additional Configuration of Nib-Based Instances
-
Chapter 8 Documentation
- The Documentation Window
- Class Documentation Pages
- Sample Code
- Quick Help
- Symbols
- Header Files
- Internet Resources
-
Chapter 9 Life Cycle of a Project
- Device Architecture and Conditional Code
- Version Control
- Editing and Navigating Your Code
- Running in the Simulator
- Debugging
- Testing
- Clean
- Running on a Device
- Profiling
- Localization
- Archiving and Distribution
- Ad Hoc Distribution
- Final App Preparations
- Submission to the App Store
-
-
Cocoa
-
Chapter 10 Cocoa Classes
- Subclassing
- Categories and Extensions
- Protocols
- Some Foundation Classes
- Accessors, Properties, and Key–Value Coding
- The Secret Life of NSObject
-
Chapter 11 Cocoa Events
- Reasons for Events
- Subclassing
- Notifications
- Delegation
- Data Sources
- Actions
- The Responder Chain
- Key–Value Observing
- Swamped by Events
- Delayed Performance
-
Chapter 12 Memory Management
- Principles of Cocoa Memory Management
- Rules of Cocoa Memory Management
- What ARC Is and What It Does
- How Cocoa Objects Manage Memory
- Autorelease Pool
- Memory Management of Instance Properties
- Retain Cycles and Weak References
- Unusual Memory Management Situations
- Nib Loading and Memory Management
- Memory Management of CFTypeRefs
- Property Memory Management Policies
- Debugging Memory Management Mistakes
-
Chapter 13 Communication Between Objects
- Visibility by Instantiation
- Visibility by Relationship
- Global Visibility
- Notifications and KVO
- Model–View–Controller
-
Appendix C, Objective-C, and Swift
- The C Language
- Objective-C
- Bilingual Targets
-