Mastering macOS Programming Copyright © 2017 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Credits Author Copy Editor Stuart Grimshaw Dhanya Baburaj Reviewer Project Coordinator Fernando Rodríguez Ritika Manoj Commissioning Editor Proofreader Ashwin Nair Safis Editing Acquisition Editor Indexer Divya Poojari Aishwarya Gangawane Content Development Editor Graphics Arun Nadar Jason Monteiro Technical Editors Production Coordinator Akansha Bathija Shantanu Zagade Shivani Mistry .
About the Author Stuart Grimshaw has programmed for Apple computers since the days before OS X and has been involved with developing for the Apple Watch since its release. Born in the UK and having lived in Germany and the Netherlands, he is currently a freelance iOS/tvOS/macOS developer in Auckland, New Zealand, where he works on some of Australia-New Zealand's largest video and TV delivery apps and leads the research and development of both watchOS and tvOS applications. He is passionate about the potential of the Apple Watch and Apple TV, as well as Apple's Swift programming language, and is a keen proponent of beach coding.
About the Reviewer Fernando Rodríguez has more than 20 years of experience in developing and teaching other developers. Although he currently specializes in the Apple stack of tools, he’s a nerd of all trades with a strong interest in big data and automated trading.
Customer Feedback Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at .
Table of Contents Preface 1 Chapter 1: Hello macOS 7 It's going to be Swift 9 And more than Swift 10 It's going to be Xcode and more 10 Prerequisites 11 The book's overall structure 11 How Unix, macOS, Cocoa, and AppKit fit together 12 Darwin 12 macOS 12 Cocoa 13 Harnessing that power 13 The serious developer's toolkit 14 What you'll get from this book 15 Summary 17 Chapter 2: Basic Swift 18 Variables and types 19 Number types 21 Integers 21 Booleans 23 Strings 23 Printing to the console 26 Comments 26 Arrays, dictionaries, and sets 27 Arrays 27 Dictionaries 29 Sets 31 Naming of types and variables 31 Type aliases 32 Value and reference types 32 Operators 33 Mathematical operators 33 Augmented assignment 33 Comparison operators 34 Logical operators 34.
Preface This book will take your Swift programming skills to a level at which you can work as a professional software engineer, using a step-by-step approach, ensuring that the introduction of each new concept is preceded by a thorough understanding of those preceding it.
1 Hello macOS Goodbye and thank you OS X, hello and welcome macOS! Sierra is here, also known as macOS 10.12. Apple's latest OS release, announced at the 2016 World Wide Developers Conference, offers the modern app developer more tools than ever with which to create engaging, productive, and entertaining apps for what an ever- increasing number of people deem the world's most advanced operating system.