Swift编程实战:构建跨平台Notes应用

需积分: 10 62 下载量 66 浏览量 更新于2024-07-20 收藏 26.99MB PDF 举报
"Learning Swift(O'Reilly,2016)" 是一本面向具有编程经验但对Apple开发不熟悉的读者的实战指南,通过构建三个不同平台(OS X、iOS和watchOS)上的Notes应用来教授Swift 2编程语言。这本书详细介绍了Swift的基础知识,包括语法和特性,以及Cocoa、CocoaTouch和WatchKit框架的基本概念。同时,读者将学习如何为Apple平台设计应用程序,以及如何将应用提交到App Store。 书中分为四个部分: 1. **Swift 2基础**:这部分介绍Swift面向对象开发的特点,以及各种开发者工具的使用。Swift的特性包括强类型、可选类型、模式匹配、闭包等,开发者工具则包括Xcode IDE、Playgrounds等。 2. **OS X应用开发**:讲解如何设置应用,处理文档,并扩展应用功能。这部分涵盖Cocoa框架的使用,如NSWindow、NSViewController、NSDocument等,以及如何实现OS X特有的功能,如菜单栏、通知中心等。 3. **iOS应用开发**:在iOS平台上构建功能齐全的Notes应用,涉及多媒体处理、联系人集成、地理位置服务、推送通知和iCloud文件存储。这部分会讲解CocoaTouch框架,如UIViewController、UITableView、UIImagePickerController等,以及如何使用CoreLocation和CloudKit。 4. **高级应用扩展**:支持Apple Watch,介绍如何为不同设备间的交互编写扩展。还包括调试、监控和测试所有三个Swift应用的方法,这涉及到WatchKit的使用和应用扩展的生命周期管理。 作者Jonathon Manning、Paris Buttfield-Addison和Tim Nugent都是经验丰富的开发者,他们通过简洁易懂的方式引导读者逐步学习Swift编程,让读者具备构建实际应用的能力。 本书适合希望进入Apple生态系统的开发者,无论是对Swift新手还是希望更新Swift知识的老手,都能从中受益。通过这本书,读者不仅可以学习到Swift编程语言,还能了解到Apple平台开发的全貌,为成为专业iOS和macOS开发者打下坚实基础。
2016-06-10 上传
Learning Swift - Second Edition by Andrew J Wagner 2016 | ISBN: 1785887513 | English | 308 pages | PDF Key Features Write expressive, understandable, and maintainable Swift 2 code with this hands-on tutorial Unveil the complex underpinnings of Swift to turn your app ideas into reality This book is packed with real-life examples to help you implement concepts as you learn Book Description Swift is Apple's new programming language and the future of iOS and OS X app development. It is a high-performance language that feels like a modern scripting language. On the surface, Swift is easy to jump into, but it has complex underpinnings that are critical to becoming proficient at turning an idea into reality. This book is an approachable, step-by-step introduction into programming with Swift for everyone. It begins by giving you an overview of the key features through practical examples and progresses to more advanced topics that help differentiate the proficient developers from the mediocre ones. It covers important concepts such as Variables, Optionals, Closures, Generics, and Memory Management. Mixed in with those concepts, it also helps you learn the art of programming such as maintainability, useful design patterns, and resources to further your knowledge. This all culminates in writing a basic iOS app that will get you well on your way to turning your own app ideas into reality. What you will learn Form 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 Utilize the vast resources written in Objective-C to better inform your Swift programming Develop a basic portfolio of Swift code by learning the critical concepts Experience both object-oriented and functional programming Get to know the new coding techniques made available by Swift 2 Discover resources to ensure you never stop becoming a better developer About the Author Andrew J Wagner is a software developer who concentrates on iOS development and backend web services. He has a degree in computer engineering from Rensselaer Polytechnic Institute, New York. Currently, he works for a development shop named Chronos Interactive based in Denver, CO. He has experience of working with and for large-scale and small-scale companies, as well as running his own contracting and app companies. He is passionate about using computers as a creative outlet and writing software that is beautiful in implementation, functionality, and experience. When he isn't working or spending time with friends and family, he writes for his blog at http://drewag.me. Table of Contents Introducing Swift Building Blocks – Variables, Collections, and Flow Control One Piece at a Time – Types, Scopes, and Projects To Be or Not To Be – Optionals A Modern Paradigm – Closures and Functional Programming Make Swift Work For You – Protocols and Generics Everything Is Connected – Memory Management Paths Less Traveled – Error Handling Writing Code the Swift Way – Design Patterns and Techniques Harnessing the Past – Understanding and Translating Objective-C A Whole New World – Developing an App What's Next? – Resources, Advice, and the Next Steps