Mastering macOS Programming

Take your macOS Sierra to the next level using the latest tools, designs, and best coding practices while developing with Swift 3.0

Mastering macOS Programming

Stuart Grimshaw

2 customer reviews
Take your macOS Sierra to the next level using the latest tools, designs, and best coding practices while developing with Swift 3.0
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786461698
Paperback626 pages

Book Description

macOS continues to lead the way in desktop operating systems, with its tight integration across the Apple ecosystem of platforms and devices. With this book, you will get an in-depth knowledge of working on macOS, enabling you to unleash the full potential of the latest version using Swift 3 to build applications.

This book will help you broaden your horizons by taking your programming skills to next level. The initial chapters will show you all about the environment that surrounds a developer at the start of a project. It introduces you to the new features that Swift 3 and Xcode 8 offers and also covers the common design patterns that you need to know for planning anything more than trivial projects. You will then learn the advanced Swift programming concepts, including memory management, generics, protocol orientated and functional programming and with this knowledge you will be able to tackle the next several chapters that deal with Apple's own Cocoa frameworks. It also covers AppKit, Foundation, and Core Data in detail which is a part of the Cocoa umbrella framework. The rest of the book will cover the challenges posed by asynchronous programming, error handling, debugging, and many other areas that are an indispensable part of producing software in a professional environment.

By the end of this book, you will be well acquainted with Swift, Cocoa, and AppKit, as well as a plethora of other essential tools, and you will be ready to tackle much more complex and advanced software projects.

Table of Contents

Chapter 1: Hello macOS
It's going to be Swift
And more than Swift
It's going to be Xcode and more
The book's overall structure
The serious developer's toolkit
What you'll get from this book
Summary
Chapter 2: Basic Swift
Variables and types
Comments
Arrays, dictionaries, and sets
Value and reference types
Operators
Structs, classes, and other data structures
Enumerations
Optionals
Control flow
Functions
Summary
Chapter 3: Checking Out the Power of Xcode
A quick and simple sketch app
Speeding it up with code snippets
Logging with special literals
Getting the most out of breakpoints
Behaviors
Understanding schemes
Why build configs are so cool
Summary
Chapter 4: MVC and Other Design Patterns
Programming paradigms
Encapsulation
A path through the forest
Summary
Chapter 5: Advanced Swift
Control flow
Functions
Enumerations as data structures
Protocols
Customizing operators
Collection types
Optionals
Summary
Chapter 6: Cocoa Frameworks - The Backbone of Your Apps
Understanding Foundation Kit
Import statements
Leveraging key-value observing
Cocoa bindings
Summary
Chapter 7: Creating Views Programmatically
Why code instead of IB?
Setting our goals
Coding a table view
Observing without bindings
Adding further control elements in code
Summary
Chapter 8: Strings and Text
Strings and characters
NSTextView
Summary
Chapter 9: Getting More from Interface Builder
Advanced IB navigation
Debug View Hierarchy
Encapsulating views with NSStackView
Taming the storyboard
Summary
Chapter 10: Drawing on the Strength of Core Graphics
Why not use an image?
Why not use native views?
Creating custom views
Custom buttons
Dial clock
Pie clock
Summary
Chapter 11: Core Animation
What is Core Animation?
Introducing CALayer
Animating CALayer objects
Animating NSViews
Summary
Chapter 12: Handling Errors Gracefully
Errors aren't mistakes
Expecting the unexpected
Swift error handling
NSError handling
Summary
Chapter 13: Persistent Storage
Creating a project
Using UserDefaults
Saving text to the Documents folder
NSCoding/NSKeyedArchiver
Presenting open and save dialog boxes
Summary
Chapter 14: The Benefits of Core Data
What Core Data is, and isn't
Core Data, Cocoa Bindings, and no code
Using our data model
More about Core Data
Summary
Chapter 15: Connect to the World - Networking
Patterns for downloading data
Downloading using closures
Downloading using a URLSession delegate
No third-party frameworks?
The URLSession framework
Cache rewards
Summary
Chapter 16: Concurrency and Asynchronous Programming
Concurrency and asynchronicity
Summary
Chapter 17: Understanding Xcodes Debugging Tools
Checking out Xcode's debugging tools
Leveraging breakpoints
Summary
Chapter 18: LLDB and the Command Line
LLDB
Summary
Chapter 19: Deploying Third - Party Code
Common use cases
Distribution methods
Pros and cons
Different installation methods
Other package managers
The price of complexity
Summary
Chapter 20: Wrapping It Up
App distribution
Summary
And finally

What You Will Learn

  • Combine beautiful design with robust code for the very best user experience
  • Bring the best coding practices to the new macOS Sierra
  • See what's new in Swift 3.0 and how best to leverage the Swift language
  • Master Apple's tools, including Xcode, Interface Builder, and Instruments
  • Use Unix and other common command-line tools to increase productivity
  • Explore the essential Cocoa frameworks, including networking, animation, audio, and video

Authors

Table of Contents

Chapter 1: Hello macOS
It's going to be Swift
And more than Swift
It's going to be Xcode and more
The book's overall structure
The serious developer's toolkit
What you'll get from this book
Summary
Chapter 2: Basic Swift
Variables and types
Comments
Arrays, dictionaries, and sets
Value and reference types
Operators
Structs, classes, and other data structures
Enumerations
Optionals
Control flow
Functions
Summary
Chapter 3: Checking Out the Power of Xcode
A quick and simple sketch app
Speeding it up with code snippets
Logging with special literals
Getting the most out of breakpoints
Behaviors
Understanding schemes
Why build configs are so cool
Summary
Chapter 4: MVC and Other Design Patterns
Programming paradigms
Encapsulation
A path through the forest
Summary
Chapter 5: Advanced Swift
Control flow
Functions
Enumerations as data structures
Protocols
Customizing operators
Collection types
Optionals
Summary
Chapter 6: Cocoa Frameworks - The Backbone of Your Apps
Understanding Foundation Kit
Import statements
Leveraging key-value observing
Cocoa bindings
Summary
Chapter 7: Creating Views Programmatically
Why code instead of IB?
Setting our goals
Coding a table view
Observing without bindings
Adding further control elements in code
Summary
Chapter 8: Strings and Text
Strings and characters
NSTextView
Summary
Chapter 9: Getting More from Interface Builder
Advanced IB navigation
Debug View Hierarchy
Encapsulating views with NSStackView
Taming the storyboard
Summary
Chapter 10: Drawing on the Strength of Core Graphics
Why not use an image?
Why not use native views?
Creating custom views
Custom buttons
Dial clock
Pie clock
Summary
Chapter 11: Core Animation
What is Core Animation?
Introducing CALayer
Animating CALayer objects
Animating NSViews
Summary
Chapter 12: Handling Errors Gracefully
Errors aren't mistakes
Expecting the unexpected
Swift error handling
NSError handling
Summary
Chapter 13: Persistent Storage
Creating a project
Using UserDefaults
Saving text to the Documents folder
NSCoding/NSKeyedArchiver
Presenting open and save dialog boxes
Summary
Chapter 14: The Benefits of Core Data
What Core Data is, and isn't
Core Data, Cocoa Bindings, and no code
Using our data model
More about Core Data
Summary
Chapter 15: Connect to the World - Networking
Patterns for downloading data
Downloading using closures
Downloading using a URLSession delegate
No third-party frameworks?
The URLSession framework
Cache rewards
Summary
Chapter 16: Concurrency and Asynchronous Programming
Concurrency and asynchronicity
Summary
Chapter 17: Understanding Xcodes Debugging Tools
Checking out Xcode's debugging tools
Leveraging breakpoints
Summary
Chapter 18: LLDB and the Command Line
LLDB
Summary
Chapter 19: Deploying Third - Party Code
Common use cases
Distribution methods
Pros and cons
Different installation methods
Other package managers
The price of complexity
Summary
Chapter 20: Wrapping It Up
App distribution
Summary
And finally

Book Details

ISBN 139781786461698
Paperback626 pages
Read More
From 2 reviews

Read More Reviews