ebook img

Programming Swift! Mac Apps 1 [Swift 3 Edition] PDF

613 Pages·2016·11.11 MB·English
by  Smith
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Programming Swift! Mac Apps 1 [Swift 3 Edition]

Programming Swift! Mac Apps 1 Swift 3 Edition by Nick Smith ISBN: 978-87-996701-9-2 AppSmith Books DK. 2016 Copyright "Programming Swift! Mac Apps 1" Swift 3 Edition (Dec 2016). ISBN: 978-87-996701-9-2 Copyright © Nick Smith - AppSmith Books DK 2016 All rights reserved. Programming Swift! Mac Apps 1 - Swift 3 Edition, by Nick Smith. This book contains material protected under International and Federal Copyright Laws and Treaties. Any unauthorized reprint or use of this material is prohibited. No part of this book may be reproduced in any form or by any electronic or mechanical means including information storage and retrieval systems, without permission in writing from the author / publisher. The only exception is by a reviewer, who may quote short excerpts in a review. Apple, OS X, macOS, El Capitan, Sierra, iPad, iPhone, iPod, Xcode, Swift, Objective-C, iOS, Cocoa, tvOS, WatchOS are all trademarks and/or licensed trademarks of Apple Inc. AppSmith Books has no direct affiliation with Apple Inc. Any opinions expressed or implied in this book are those of the author only. Quick Contents Cover Page Title Page Copyright Introduction Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15 Chapter 16 Chapter 17 Please note: for the full and detailed table of contents, please use the built in Table Of Contents feature of your device and eBook software. Introduction Hello, and welcome to "Programming Swift! Mac Apps 1 - Swift 3 Edition". My name is Nick Smith and I'll be your author :-) This book is the first in a two-part series dedicated to developing Mac Apps. Volume 1 will give you a detailed introduction to Mac Apps with Swift and the regular Cocoa Frameworks. This is the Swift 3 edition. If you're reading a book like this, then I have to assume that you know a little bit about the Swift language and object oriented programming. If you don't then keep reading this introduction and you'll find a suggested reading list towards the end. This book is designed to take what you already know about Swift and apply that to making software or Apps, for macOS (the rebranded name for OS X). Knowing a programming language is only part of the challenge when building software for a specific platform. What you need to learn now is, all about the various frameworks, classes and objects and then you need to learn about design patterns - the best way and the right way to do things when building a Mac application. You'll also learn about Xcode and how to use it and find your way around in it. The Book's Structure In the first few chapters of this book you'll make lots of small, throw-away, demo apps that are not quite useful applications but cover and demonstrate a specific topic or technique. Later, these demo apps will evolve into larger apps that you should keep around, because I'll come back to them and add more features as we learn about them. The book is divided into chapters and sections. Chapters and sections are numbered like this: 4.2 - and that example means chapter 4, section 2 - so, 10.10 means section 10 in chapter 10. Screen Shots and Video A picture is worth a thousand words. There are hundreds of screen shots and diagrams in this book. Screen shots are taken from Xcode 8.x running on macOS Sierra (macOS 10.12.x). This book also has a some videos. The videos are not essential but do give you another perspective along side the screen shots. If you'd like to view the videos, check out my YouTube channel at: https://www.youtube.com/user/appsmithbooks Code Presentation Code examples and program output will be presented in this mono-spaced code font: var myString: String = "some string" If the code will produce output in a program there will be an output section like this: Output: debug program output Bold Code Examples I will sometimes highlight code with a bold font when I want you to focus on a particular piece of code when shown in the context of the surrounding code: import Cocoa class ViewController: NSViewController { override func awakeFromNib() { // debug print print("awakeFromNib") } ... The code in bold type is the code I want you to focus on. The surrounding code is there to help you understand the context - where the code should be added. The ellipses (...) indicate that this is only a partial copy of the code in the project. There is more code in the program, but it's not all shown here. Wrapped Code Wrapped Code Some code examples presented in this book need to be wrapped to present them properly in an eBook. I do this to avoid letting the eBook device reformat or clip the code presentation. The following examples demonstrate the difference. Not wrapped: let dict = DataModel.sharedInstance.dataArray[DataModel.sharedInstance.optionalIndexPath!.item] as! NSDictionary Depending on your device and font settings, the code example above might not display well. Wrapped: let dict = DataModel.sharedInstance.dataArray[ DataModel.sharedInstance.optionalIndexPath!.item] as! NSDictionary The second example works and compiles just fine in Xcode, but is not considered good coding style. I only do this to make the code easier to read in the eBook format. Suggested Reading If you're very new to programming or programming with Swift, then you should pick up a copy of my Swift book for beginners: "Programming Swift! Swift 3": This book focuses on writing Swift code and can be read by programmers with other language experience and programmers who are just starting out and have no previous coding skills. You'll be working mainly in Playgrounds and Command Line tools to concentrate on the Swift language without the distraction of the frameworks and GUI programming. You should also be reading Apple's own publication which is available for free in the iBooks store:

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.