
iOS 15 Programming Fundamentals with Swift
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
Move into iOS development by getting a firm grasp of its fundamentals, including the Xcode 13 IDE, Cocoa Touch, and the latest version of Apple''s acclaimed programming language, Swift 5.5. With this thoroughly updated guide, you''ll learn the Swift language, understand Apple''s Xcode development tools, and discover the Cocoa framework.
- Explore Swift''s object-oriented concepts
- Become familiar with built-in Swift types
- Dive deep into Swift objects, protocols, and generics
- Tour the life cycle of an Xcode project
- Learn how nibs are loaded
- Understand Cocoa''s event-driven design
- Communicate with C and Objective-C
In this edition, catch up on the latest iOS programming features:
- Structured concurrency: async/await, tasks, and actors
- Swift native formatters and attributed strings
- Lazy locals and throwing getters
- Enhanced collections with the Swift Algorithms and Collections packages
- Xcode tweaks: column breakpoints, package collections, and Info.plist build settings
- Improvements in Git integration, localization, unit testing, documentation, and distribution
- And more!
More details
Other editions
Additional editions

Content
- Cover
- Copyright
- Table of Contents
- Preface
- The Scope of This Book
- From the Preface to the First Edition (Programming iOS 4)
- Versions
- Acknowledgments
- Conventions Used in This Book
- Using Code Examples
- O'Reilly Online Learning
- How to Contact Us
- Part I. 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?
- The Keyword self
- Privacy
- Design
- Chapter 2. Functions
- Function Parameters and Return Value
- Void Return Type and Parameters
- Function Signature
- External Parameter Names
- Overloading
- Default Parameter Values
- Variadic Parameters
- Ignored Parameters
- Modifiable Parameters
- Calling Objective-C with Modifiable Parameters
- Called by Objective-C with Modifiable Parameters
- Reference Type Modifiable Parameters
- Function in Function
- Recursion
- Function as Value
- Anonymous Functions
- Using Anonymous Functions Inline
- Anonymous Function Abbreviated Syntax
- Define-and-Call
- Closures
- How Closures Improve Code
- Function Returning Function
- Closure Setting a Captured Variable
- Closure Preserving Captured Environment
- Escaping Closures
- Capture Lists
- Curried Functions
- Function References and Selectors
- Function Reference Scope
- Selectors
- Chapter 3. Variables and Simple Types
- Variable Scope and Lifetime
- Variable Declaration
- Computed Variable Initialization
- Computed Variables
- Computed Properties
- Property Wrappers
- Setter Observers
- Lazy Initialization
- Singleton
- Lazy Initialization of Instance Properties
- Built-In Simple Types
- Bool
- Numbers
- String
- Character and String Index
- Range
- Tuple
- Optional
- Chapter 4. Object Types
- Object Type Declarations and Features
- Initializers
- Properties
- Methods
- Subscripts
- Nested Object Types
- Enums
- Raw Values
- Associated Values
- Enum Case Iteration
- Enum Initializers
- Enum Properties
- Enum Methods
- Why Enums?
- Structs
- Struct Initializers
- Struct Properties
- Struct Methods
- Classes
- Value Types and Reference Types
- Subclass and Superclass
- Class Initializers
- Class Deinitializer
- Class Properties
- Static/Class Members
- Polymorphism
- Casting
- Casting Down
- Type Testing and Casting Down Safely
- Type Testing and Casting Optionals
- Bridging to Objective-C
- Type References
- From Instance to Type
- From self to Type
- Type as Value
- Summary of Type Terminology
- Comparing Types
- Protocols
- Why Protocols?
- Adopting a Library Protocol
- Protocol Type Testing and Casting
- Declaring a Protocol
- Protocol Composition
- Class Protocols
- Optional Protocol Members
- Implicitly Required Initializers
- Expressible by Literal
- Generics
- Generic Declarations
- Type Constraints
- Explicit Specialization
- Generic Types and Covariance
- Associated Type Chains
- Where Clauses
- Extensions
- Extending Protocols
- Extending Generics
- Umbrella Types
- Any
- AnyObject
- AnyClass
- Collection Types
- Array
- Dictionary
- Set
- OrderedSet and OrderedDictionary
- Chapter 5. Flow Control and More
- Flow Control
- Branching
- Loops
- Jumping
- Privacy
- Private and Fileprivate
- Public and Open
- Privacy Rules
- Introspection
- Operators
- Memory Management
- Memory Management of Reference Types
- Exclusive Access to Value Types
- Miscellaneous Swift Language Features
- Synthesized Protocol Implementations
- Key Paths
- Instance as Function
- Dynamic Membership
- Property Wrappers
- Custom String Interpolation
- Reverse Generics
- Result Builders
- Result
- Chapter 6. Structured Concurrency
- Multithreading
- The Main Thread
- Background Threads
- Asynchronous Code
- Structured Concurrency Syntax
- async/await
- Async Contexts
- Tasks
- Wrapping a Completion Handler
- Multiple Concurrent Tasks
- async let
- Task Groups
- Asynchronous Sequences
- Built-in Asynchronous Sequences
- Making an Asynchronous Sequence
- Asynchronous Sequence Methods
- Actors
- Actor Isolation
- Actor Serialization
- The Main Actor
- Context Switching
- Implicit Context Switching
- Explicit Context Switching
- More About Tasks
- Task Priority
- The Current Task
- Sleeping
- Yielding
- Cancellation
- More About Actors
- Reentrancy
- The Keyword nonisolated
- The Keyword isolated
- Global Actors
- Sendable
- Part II. IDE
- Chapter 7. Anatomy of an Xcode Project
- New Project
- The Project Window
- The Navigator Pane
- The Inspector Pane
- The Editor
- Project File and Dependents
- Contents of the Project Folder
- Groups
- The Target
- Build Phases
- Build Settings
- Configurations
- Schemes and Destinations
- From Project to Built App
- Build Settings
- Property List Settings
- Nib Files
- Resources
- Code Files
- Frameworks and SDKs
- Swift Packages
- The App Launch Process
- The Entry Point
- How an App Gets Going
- App Without a Storyboard
- Renaming Parts of a Project
- Chapter 8. Nib Files
- The Nib Editor Interface
- Document Outline
- Canvas
- Inspectors
- Loading a Nib
- Loading a View Controller Nib
- Loading a Main View Nib
- Loading a View Nib Manually
- Connections
- Outlets
- The Nib Owner
- Automatically Configured Nibs
- Misconfigured Outlets
- Deleting an Outlet
- More Ways to Create Outlets
- Outlet Collections
- Action Connections
- More Ways to Create Actions
- Misconfigured Actions
- Connections Between Nibs - Not!
- Additional Configuration of Nib-Based Instances
- Chapter 9. Documentation
- The Documentation Window
- Class Documentation Pages
- Quick Help
- Documenting Frameworks and Packages
- Symbol Declarations
- Header Files
- Sample Code
- Internet Resources
- Chapter 10. Life Cycle of a Project
- Environmental Dependencies
- Conditional Compilation
- Build Action
- Permissible Runtime Environment
- Backward Compatibility
- Device Type
- Arguments and Environment Variables
- Version Control
- Editing and Navigating Your Code
- Text Editing Preferences
- Multiple Selection
- Code Completion and Placeholders
- Snippets
- Refactoring and Code Actions
- Fix-it and Live Syntax Checking
- Navigation
- Finding
- Running in the Simulator
- Debugging
- Caveman Debugging
- The Xcode Debugger
- Testing
- Unit Tests
- Interface Tests
- Test Plans
- Massaging the Report
- Clean
- Running on a Device
- Obtaining a Developer Program Membership
- Signing an App
- Automatic Signing
- Manual Signing
- Running the App
- Managing Development Certificates and Devices
- Profiling
- Gauges
- Memory Debugging
- Instruments
- Localization
- Creating Localized Content
- Testing Localization
- Distribution
- Making an Archive
- The Distribution Certificate
- The Distribution Profile
- Distribution for Testing
- Final App Preparations
- Screenshots and Video Previews
- Property List Settings
- Submission to the App Store
- Part III. Cocoa
- Chapter 11. Cocoa Classes
- Subclassing
- Categories and Extensions
- How Swift Uses Extensions
- How You Use Extensions
- How Cocoa Uses Categories
- Protocols
- Optional Members
- Informal Protocols
- Some Foundation Classes
- NSRange
- NSNotFound
- NSString and Friends
- NSDate and Friends
- NSNumber
- NSValue
- NSData
- NSMeasurement and Friends
- Equality, Hashability, and Comparison
- NSArray and NSMutableArray
- NSDictionary and NSMutableDictionary
- NSSet and Friends
- NSIndexSet
- NSNull
- Immutable and Mutable
- Property Lists
- Codable
- Accessors, Properties, and Key-Value Coding
- Swift Accessors
- Key-Value Coding
- How Outlets Work
- Cocoa Key Paths
- Uses of Key-Value Coding
- KeyPath Notation
- The Secret Life of NSObject
- Chapter 12. Cocoa Events
- Reasons for Events
- Subclassing
- Notifications
- Receiving a Notification
- Unregistering
- Subscribing to a Notification
- Posting a Notification
- Timer
- Delegation
- Cocoa Delegation
- Implementing Delegation
- Data Sources
- Actions
- The Responder Chain
- Nil-Targeted Actions
- Key-Value Observing
- Registration and Notification
- Unregistering
- Key-Value Observing Example
- Swamped by Events
- Delayed Performance
- Chapter 13. 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
- Notification Observers
- KVO Observers
- Timers
- Other Unusual Situations
- Memory Management of CFTypeRefs
- Property Memory Management Policies
- Debugging Memory Management Mistakes
- Chapter 14. Communication Between Objects
- Visibility Through an Instance Property
- Visibility by Instantiation
- Getting a Reference
- Visibility by Relationship
- Global Visibility
- Notifications and Key-Value Observing
- The Combine Framework
- Alternative Architectures
- Model-View-Controller
- Router and Data Space
- Model-View-Presenter
- Protocols and Reactive Programming
- SwiftUI
- Result Builders and Modifiers
- State Properties
- Bindings
- Passing Data Downhill
- Passing Data Uphill
- Custom State Objects
- Appendix A. C, Objective-C, and Swift
- The C Language
- C Data Types
- C Enums
- C Structs
- C Pointers
- C Arrays
- C Strings
- C Functions
- Objective-C
- Objective-C Objects and C Pointers
- Objective-C Objects and Swift Objects
- Exposure of Swift to Objective-C
- Bridged Types and Boxed Types
- Objective-C Methods
- Selectors
- CFTypeRefs
- Blocks
- API Markup
- Bilingual Targets
- Index
- About the Author
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.