
۴۴٬۰۰۰تومان
نوع فایل دانلود: EPUB
پس از خرید، یک فایل EPUB دریافت میکنید.
این فایل با Calibre، Apple Books و سایر کتابخوانهای دیجیتال مناسب است.
جلد -- حق نشر -- دستاندرکاران -- دربارهٔ نویسنده -- دربارهٔ بازبینها -- www.PacktPub.com -- فهرست مطالب -- پیشگفتار -- فصل ۱: اشیاء از دنیای واقعی تا پلیگراند -- نصب نرمافزارهای لازم -- گرفتن اشیاء از دنیای واقعی -- ساخت کلاسها برای ایجاد اشیاء -- تشخیص متغیرها و ثابتها برای ساخت ویژگیها -- تشخیص عملها برای ساخت متدها -- سازماندهی کلاسها با نمودارهای UML -- کار با اشیاء API در پلیگراند اکسکد -- تمرینها -- دانش خود را بسنجید -- خلاصه -- فصل ۲: ساختارها، کلاسها و نمونهها -- آشنایی با ساختارها، کلاسها و نمونهها -- آشنایی با مقداردهی اولیه و سفارشیسازی آن -- آشنایی با آزادسازی و سفارشیسازی آن -- آشنایی با شمارش خودکار ارجاع -- تعریف کلاسها -- سفارشیسازی مقداردهی اولیه -- سفارشیسازی آزادسازی -- ساخت نمونههای کلاسها -- تمرینها -- دانش خود را بسنجید -- خلاصه -- فصل ۳: کپسولهسازی داده با ویژگیها -- آشنایی با عناصر تشکیلدهندهٔ یک کلاس -- تعریف ویژگیهای ذخیرهشده -- ساخت ویژگیهای محاسبهشده با ستر و گتر -- ترکیب ستر، گتر و یک ویژگی مرتبط -- آشنایی با ناظرهای ویژگی -- تبدیل مقادیر با ستر و گتر -- استفاده از ویژگیهای نوع برای ساخت مقادیری که همهٔ نمونههای یک کلاس در آنها شریکاند -- ساخت کلاسهای تغییرپذیر -- ساخت کلاسهای تغییرناپذیر -- تمرینها -- دانش خود را بسنجید -- خلاصه -- فصل ۴: وراثت، انتزاع و تخصصگرایی -- ساخت سلسلهمراتب کلاسها برای انتزاع و تخصصیکردن رفتار -- آشنایی با وراثت -- تعریف کلاسهایی که از کلاس دیگری ارث میبرند -- بازنویسی و بیشبارگذاری متدها -- بازنویسی ویژگیها -- کنترل اینکه زیرکلاسها بتوانند یا نتوانند اعضا را بازنویسی کنند -- کار با تبدیل نوع و چندریختی.
با برنامهنویسی شیءگرا در سوئیفت آشنا شوید تا بتوانید برنامههای واقعی و قدرتمند را بهشکلی کارآمد بسازید.
دربارهٔ این کتاب
از کارآمدترین الگوهای طراحی شیءگرا در برنامههای سوئیفت خود بهره ببرید.
با طرحهایی که اشیاء را میسازند، کدی محکمتر، ایمنتر و بهتر بنویسید.
با استفاده از عناصر دنیای واقعی و بازنمایی آنها در اپ، بستری با کد شیءگرا بسازید.
این کتاب برای چه کسانی است
اگر توسعهدهندهٔ iOS هستید، آشنایی پایهای با برنامهنویسی شیءگرا دارید و میخواهید مفاهیم آن را با سوئیفت ترکیب کنید تا کد اپ خود را بهینه کنید و بلوکهای سازندهٔ قابلاستفادهٔ مجدد و بهراحتی قابلفهم بسازید، این کتاب برای شماست. این منبع برای توسعهدهندگانی که میخواهند از Objective-C، سیشارپ، جاوا، پایتون، جاوااسکریپت یا دیگر زبانهای شیءگرا به سوئیفت مهاجرت کنند، بسیار سودمند است.
چه چیزهایی یاد میگیرید
با سوئیفت برنامههایی محکم، پایدار و قابلاعتماد بسازید.
با کپسولهسازی، انتزاع و چندریختی در سوئیفت ۲٫۰ کار کنید.
سازندهها و نابودگرها را بر اساس نیاز خود سفارشی کنید.
با کلاسها، نمونهها، ویژگیها و متدها در سوئیفت ۲٫۰ پیش بروید.
از کد عمومی بهره بگیرید تا استفادهٔ مجدد از کد را به حداکثر برسانید و رفتارها را تعمیم دهید.
از وراثت، تخصصگرایی و امکان بیشبارگذاری اعضا استفاده کنید.
کد شیءگرای باکیفیت بنویسید تا اپهایی برای iOS یا مک اواس اکس بسازید.
با جزئیات بیشتر
برنامهنویسی شیءگرا (OOP) پارادایمی برنامهنویسی است که بر مفهوم اشیاء بنا شده است؛ اینها ساختارهای دادهای هستند که داده را در قالب فیلدها — که اغلب ویژگی نامیده میشوند — و کد نگه میدارند. اشیاء همهجا هستند؛ پس خیلی مهم است که عناصر — یعنی همان اشیاء — را در موقعیتهای واقعی بشناسیم و بدانیم چطور میتوان آنها را بهسادگی به کد شیءگرا تبدیل کرد. برنامهنویسی شیءگرا با سوئیفت راهنمایی ساده و دنبالکردنی است که پر از مثالهای عملی برای حل مشکلات رایج کد شیءگرا در سوئیفت است. کتاب با کمک به شما در تشخیص اشیاء از موقعیتهای واقعی شروع میشود و نشان میدهد که کار با آنها نوشتن کدی را که فهم و استفادهاش دوباره آسان است، سادهتر میکند. یاد میگیرید با قابلیتهای کپسولهسازی داده در سوئیفت، دادهها را محافظت و پنهان کنید. سپس میبینید چطور با نوشتن کدی که بتواند با اشیاء از انواع مختلف کار کند، استفادهٔ مجدد از کد را به حداکثر برسانید. بعد از آن، قدرت چندریختی پارامتری را کشف میکنید و کد عمومی را با وراثت و وراثت چندگانه ترکیب میکنید. بعدتر به بازآرایی کد موجود و سازماندهی سورس برای نگهداری و گسترش آسان میرسید. در پایان کتاب میتوانید کدی بهتر، قویتر و قابلاستفادهتر بسازید؛ کدی که به شما کمک میکند اپهای بهتری بسازید.
سبک و رویکرد
این راهنمای ساده پر از مثالهای عملی برای حل مشکلات رایج است. هر فصل شامل تمرینهایی است و میتوانید با پاسخ به پرسشها پیشرفت خود را بسنجید.
Cover -- Copyright -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Table of Contents -- Preface -- Chapter 1: Objects from the Real World to the Playground -- Installing the required software -- Capturing objects from the real world -- Generating classes to create objects -- Recognizing variables and constants to create properties -- Recognizing actions to create methods -- Organizing classes with UML diagrams -- Working with API objects in the Xcode Playground -- Exercises -- Test your knowledge -- Summary -- Chapter 2 : Structures, Classes, and Instances -- Understanding structures, classes, and instances -- Understanding initialization and its customization -- Understanding deinitialization and its customization -- Understanding automatic reference counting -- Declaring classes -- Customizing initialization -- Customizing deinitialization -- Creating the instances of classes -- Exercises -- Test your knowledge -- Summary -- Chapter 3 : Encapsulation of Data with Properties -- Understanding the elements that compose a class -- Declaring stored properties -- Generating computed properties with setters and getters -- Combining setters, getters, and a related property -- Understanding property observers -- Transforming values with setters and getters -- Using type properties to create values shared by all the instances of a class -- Creating mutable classes -- Building immutable classes -- Exercises -- Test your knowledge -- Summary -- Chapter 4 : Inheritance, Abstraction, and Specialization -- Creating class hierarchies to abstract and specialize behavior -- Understanding inheritance -- Declaring classes that inherit from another class -- Overriding and overloading methods -- Overriding properties -- Controlling whether subclasses can or cannot override members -- Working with typecasting and polymorphism.;Get to grips with object-oriented programming in Swift to efficiently build powerful real-world applicationsAbout 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 appWho This Book Is ForIf 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 SwiftWhat 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 XIn DetailObject-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 approachThis 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.