Object–Oriented Programming with Swift 2(Paperback)
暫譯: 使用 Swift 2 的物件導向程式設計(平裝本)
Gaston C. Hillar
- 出版商: Packt Publishing
- 出版日期: 2016-01-29
- 售價: $2,000
- 貴賓價: 9.5 折 $1,900
- 語言: 英文
- 頁數: 332
- 裝訂: Paperback
- ISBN: 1785885693
- ISBN-13: 9781785885693
-
相關分類:
Apple Developer
海外代購書籍(需單獨結帳)
相關主題
商品描述
Get to grips with object-oriented programming in Swift to efficiently build powerful real-world applications
About This Book
- Leverage the most efficient object-oriented design patterns in your Swift applications
- Write robust, safer, and better code using the blueprints that generate objects
- Build a platform with object-oriented code by using real-world elements and represent them in your app
Who This Book Is For
If you are an iOS developer who has a basic idea of object-oriented programming and want to incorporate its concepts with Swift to optimize your application's code and create reusable and easily to understand building blocks, then this book is for you. This is a very useful resource for developers who want to shift from Objective C, C#, Java, Python, JavaScript, or other object-oriented languages to Swift
What You Will Learn
- Build solid, stable, and reliable applications using Swift
- Work with encapsulation, abstraction, and polymorphism using Swift 2.0
- Customize constructors and destructors based on your needs
- Develop Swift 2.0 with classes, instances, properties, and methods
- Take advantage of generic code to maximize code reuse and generalize behaviors
- Use state of inheritance, specialization, and the possibility to overload members
- Write high quality object-oriented code to build apps for iOS or Mac OS X
In Detail
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects; these are data structures that contain data in the form of fields, often known as attributes and code. Objects are everywhere, and so it is very important to recognize elements, known as objects, from real-world situations and know how they can easily be translated into object-oriented code.
Object-Oriented Programming with Swift is an easy-to-follow guide packed full of hands-on examples of solutions to common problems encountered with object-oriented code in Swift. It starts by helping you to recognize objects using real-life scenarios and demonstrates how working with them makes it simpler to write code that is easy to understand and reuse.
You will learn to protect and hide data with the data encapsulation features of Swift. Then, you will explore how to maximize code reuse by writing code capable of working with objects of different types. After that, you'll discover the power of parametric polymorphism and will combine generic code with inheritance and multiple inheritance. Later, you move on to refactoring your existing code and organizing your source for easy maintenance and extensions.
By the end of the book, you will be able to create better, stronger, and more reusable code, which will help you build better applications.
Style and approach
This simple guide is packed with practical examples of solutions to common problems. Each chapter includes exercises and the possibility for you to test your progress by answering questions.
商品描述(中文翻譯)
掌握 Swift 中的物件導向程式設計,以有效地構建強大的實際應用程式
本書介紹
- 在您的 Swift 應用程式中利用最有效的物件導向設計模式
- 使用生成物件的藍圖編寫穩健、更安全且更優質的程式碼
- 通過使用現實世界的元素來構建物件導向的程式碼平台,並在您的應用程式中表示它們
本書適合誰閱讀
如果您是一位對物件導向程式設計有基本了解的 iOS 開發者,並希望將其概念與 Swift 結合,以優化您的應用程式程式碼並創建可重用且易於理解的構建模塊,那麼這本書適合您。這是一本對於希望從 Objective C、C#、Java、Python、JavaScript 或其他物件導向語言轉向 Swift 的開發者非常有用的資源。
您將學到什麼
- 使用 Swift 構建穩固、穩定且可靠的應用程式
- 使用 Swift 2.0 處理封裝、抽象和多型
- 根據您的需求自定義建構子和解構子
- 使用類別、實例、屬性和方法開發 Swift 2.0
- 利用泛型程式碼最大化程式碼重用並概括行為
- 使用繼承、專門化的狀態以及重載成員的可能性
- 編寫高品質的物件導向程式碼,以構建 iOS 或 Mac OS X 的應用程式
詳細內容
物件導向程式設計(OOP)是一種基於物件概念的程式設計範式;這些物件是包含以欄位形式存在的資料的資料結構,通常稱為屬性和程式碼。物件無處不在,因此識別來自現實世界情境的元素(稱為物件)並了解它們如何輕鬆轉換為物件導向程式碼是非常重要的。
使用 Swift 的物件導向程式設計是一本易於跟隨的指南,裡面充滿了針對 Swift 中物件導向程式碼常見問題的實用範例。它首先幫助您使用現實生活場景識別物件,並演示如何與它們合作使編寫易於理解和重用的程式碼變得更簡單。
您將學會使用 Swift 的資料封裝功能來保護和隱藏資料。然後,您將探索如何通過編寫能夠處理不同類型物件的程式碼來最大化程式碼重用。之後,您將發現參數多型的力量,並將泛型程式碼與繼承和多重繼承結合起來。稍後,您將進行現有程式碼的重構,並組織您的源碼以便於維護和擴展。
在本書結束時,您將能夠創建更好、更強大且更可重用的程式碼,這將幫助您構建更好的應用程式。
風格與方法
這本簡單的指南充滿了針對常見問題的實用範例。每一章都包括練習,並提供您測試進度的機會,通過回答問題來檢驗自己。