Object–Oriented Programming with Swift 2(Paperback)

Gaston C. Hillar

  • 出版商: Packt Publishing
  • 出版日期: 2016-01-29
  • 售價: $1,970
  • 貴賓價: 9.5$1,872
  • 語言: 英文
  • 頁數: 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應用程式中運用最有效的面向對象設計模式
- 使用生成對象的藍圖來編寫堅固、更安全、更優秀的代碼
- 通過使用現實世界元素在應用程式中構建面向對象代碼平台

本書適合對面向對象編程有基本了解並希望將其概念與Swift結合以優化應用程式代碼、創建可重用且易於理解的構建塊的iOS開發人員。對於希望從Objective C、C#、Java、Python、JavaScript或其他面向對象語言轉向Swift的開發人員來說,這是一個非常有用的資源。

你將學到什麼
- 使用Swift構建堅固、穩定和可靠的應用程式
- 使用Swift 2.0進行封裝、抽象和多態性的工作
- 根據需求自定義構造函數和析構函數
- 使用類、實例、屬性和方法開發Swift 2.0
- 利用通用代碼來最大化代碼重用和泛化行為
- 使用繼承、特化和成員重載的狀態
- 編寫高質量的面向對象代碼,為iOS或Mac OS X構建應用程式

詳細內容
面向對象編程(OOP)是一種基於對象概念的編程範型;這些對象是包含數據(通常稱為屬性)和代碼的數據結構。對象無處不在,因此非常重要能夠識別現實世界中的對象元素,並知道如何將其輕鬆轉化為面向對象代碼。

《使用Swift進行面向對象編程》是一本易於理解的指南,充滿了實際的解決方案示例,用於解決Swift中面向對象代碼常見問題。它從幫助你識別使用現實生活場景中的對象開始,並演示如何使用它們使代碼更容易理解和重用。

你將學習如何使用Swift的封裝功能來保護和隱藏數據。然後,你將探索如何通過編寫能夠處理不同類型對象的代碼來最大化代碼重用。之後,你將發現參數多態性的威力,並將通用代碼與繼承和多重繼承相結合。接著,你將重構現有代碼並組織源代碼以便於維護和擴展。

通過閱讀本書,你將能夠創建更好、更強大、更可重用的代碼,這將幫助你構建更好的應用程式。

風格和方法
這本簡單的指南充滿了實際的解決方案示例。每章包括練習和問題,讓你測試自己的進展。