Get valuable hands-on experience with Swift, the open source programming language developed by Apple. With this practical guide, skilled programmers with little or no knowledge of Apple development will learn how to code with the latest version of Swift by developing a working iOS app from start to finish.
You’ll begin with Swift programming basics—including guidelines for making your code "Swifty"—and learn how to work with Xcode and its built-in Interface Builder. Then you’ll dive step-by-step into building and customizing a basic app for taking, editing, and deleting selfies. You’ll also tune and test the app for performance and manage the app’s presence in the App Store.
Divided into four parts, this book includes:
Swift 4 basics: Learn Swift’s basic building blocks and the features of object-oriented development
Building the Selfiegram app: Build model objects and the UI for your selfie app and add location support, user settings, and notifications
Polishing Selfiegram: Create a theme and support for sharing and add custom views, image overlays, and localization
Beyond app development: Debug and performance test with Xcode, automate chores with Fastlane, and user-test the app with TestFlight
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A hands-on, project-driven introduction to Swift 4 and Apple development, this book teaches you the language fundamentals and object-oriented features while guiding you through building a complete, polished iOS app (Selfiegram) from scratch—ideal for experienced programmers new to Apple's ecosystem.
【Book Arc】
- **Opening (~0%–9%)**: Introduces the book's structure and goals, then walks you through installing and setting up Xcode, including a tour of its interface, the Interface Builder, and essential navigators—establishing the toolchain you'll use throughout.
- **Early (~9%–28%)**: Covers Swift language fundamentals: variables, constants (`let` vs `var`), type inference, operators, control flow (loops, switches), and core collection types like arrays, dictionaries, and sets—with emphasis on Swift's safety features like optionals and type checking.
- **Early (~28%–38%)**: Delves into object-oriented development: functions and closures, `inout` parameters, classes and structs, computed properties, property observers, lazy properties, and extensions—building the mental model for Swift's approach to OOP.
- **Middle (~38%–47%)**: Explores advanced language features: protocols and default implementations, error handling with `try`/`catch`/`try?`/`try!`, and memory management via reference counting and ownership—plus an introduction to Cocoa's delegation pattern for app architecture.
- **Middle (~47%–end)**: Transitions from language to app development: building the Selfiegram app's model objects and UI, adding location support, user settings, and notifications, then polishing with themes, sharing, custom views, and localization—finishing with debugging, performance testing, Fastlane automation, and TestFlight user testing.
【Key Takeaways】
- **Swift prioritizes safety through type inference and constants** (Early): The compiler infers types from context, and `let` declares immutable values that prevent accidental changes—reducing bugs and making code more predictable.
- **Optionals are a core Swift concept for handling absence** (Early): Variables can be optional (able to hold `nil`) or non-optional; unwrapping with `!` is powerful but crashes on `nil`, so prefer safe unwrapping or implicitly unwrapped optionals when appropriate.
- **Sets offer unique, unordered collections with high-performance operations** (Early): Unlike arrays, sets excel at unions, intersections, and membership checks—choose them when order doesn't matter and uniqueness is guaranteed.
- **Property observers and lazy properties add dynamic behavior** (Early): `willSet` and `didSet` hooks let you react to property changes, while lazy properties defer expensive setup until first access—improving both flexibility and performance.
- **Extensions and protocols enable flexible, non-invasive code design** (Middle): Extensions add computed properties and protocol conformance to existing types, and default protocol implementations reduce boilerplate—promoting loose coupling.
- **Error handling in Swift is explicit and multi-layered** (Middle): Use `do-catch` for recoverable errors, `try?` to convert failures to optionals, and `try!` only when you're certain a call won't fail—each approach trades safety for convenience.
- **Memory management is automatic via reference counting** (Middle): The compiler tracks object ownership, so you rarely manage memory manually—think in terms of ownership rather than numeric retain counts to avoid confusion.
- **Delegation is a key Cocoa pattern for app architecture** (Middle): Objects can check at runtime whether a delegate implements a method, enabling loose coupling and letting one object serve as delegate for multiple sources—central to building iOS apps.
【Reading Tips】
- **Skim the Xcode interface tour** (Opening): If you've used any IDE, you can quickly scan this section and return later when you need specific navigator or Interface Builder details.
- **Deep-read the Swift language chapters** (Early): These are foundational—pay close attention to optionals, type inference, and collection types, as they'll appear constantly in the app-building sections.
- **Practice the OOP concepts with small examples** (Early–Middle): Computed properties, observers, and extensions are best understood by writing and modifying code, not just reading—try extending a simple class yourself.
- **Focus on the delegation pattern** (Middle): It's the bridge between language features and real app architecture; understanding it will make the Selfiegram UI code much clearer.
- **Use the Selfiegram project as your guide** (Middle–End): Don't just read—build along. The app serves as a practical case study that ties together all the language concepts into a working product.
【Coverage Limits】
This guide synthesizes the book's first half (language fundamentals and OOP concepts) and outlines the app-building arc, but the excerpts do not cover the detailed implementation of Selfiegram's UI, location services, or the final debugging and deployment chapters.
Excerpt 1
97 Swift Package Manager 101 Conclusion 107 Part II. Building Selfiegram 4. Setting Up Our App. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....
that the type of the number variable isn’t defined—the com‐ piler infers that, given that numbers is an array of Int values, number should itself be an Int....
onalInteger = 1 1 + implicitlyUnwrappedOptionalInteger // 2 Implicitly unwrapped optionals are regular optionals: they can either contain nil, or not. Howeve...
t, you own it. When you are done you relinquish this owner‐ ship, and when no objects own another object, it goes away. You are only responsible for those ob...
gure 4-6. The Master-Detail template UI The Structure | 119 This property returns a UIImage from the disk that is the actual image compo‐ nent of the selfie—...
-action mechanism is used in many different Cocoa and Cocoa Touch frameworks as a way for objects to talk to one another. The basic idea is that the target (...
ghtforward. The method returns an array of locations, which may contain one or several items. We want the last location in the array, because the locations a...
ogether something ourselves using UIImageViews to create an approximation of what the camera sees, but it would be a bad hack and look terrible. It’s much ea...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Learning Swift Building Apps for macOS, iOS, and Beyond (Jonathon Manning, Paris Buttfield-Addison etc.)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Learning Swift Building Apps for macOS, iOS, and Beyond (Jonathon Manning, Paris Buttfield-Addison etc.)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Learning Swift Building Apps for macOS, iOS, and Beyond (Jonathon Manning, Paris Buttfield-Addison etc.)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
这本书面向已经具备编程基础、但对苹果平台开发几乎一无所知的开发者,以动手实践的方式带领读者从零开始完整构建一个可运行的 iOS 应用,并在此过程中掌握 Swift 这门由苹果开发的开源编程语言。全书的落脚点不是抽象地罗列语法,而是让语言知识始终服务于一个具体项目:一个用于拍摄、编辑和删除自拍的应用。
沿着这个项目,读者可以抓住几条主要线索。其一是 Swift 语言本身的基础与风格,包括如何写出符合“Swifty”习惯的代码,以及类型推断这类日常编写中会反复遇到的机制——例如编译器能根据数组元素类型推断出循环变量的类型,无需显式声明。其二是面向对象开发在 Swift 中的展开,涉及字节操作、泛型等概念,书中也点明 Swift 是一门静态类型语言。其三是苹果开发框架的实际运用,读者会接触到 Master-Detail 模板的界面结构,理解某个属性如何从磁盘返回 UIImage 作为自拍的实际图像内容,也会看到用 UIImageView 拼凑相机画面为何是糟糕的做法,以及为何把摄像头输出作为视频流处理要容易得多。其四是让类型更好用、更易懂的协议实践,比如 Coordinate 类型...
Digital LibraryAI Assistant
Hi — I can help you pick a book. Tell me a topic, language, or level, e.g. “a light English read”. If that's too broad, I'll ask one follow-up.
Loading comments...
Reply to Comment
Edit Comment