10

macOS Apprentice [SUBSCRIBER]

 1 year ago
source link: https://www.kodeco.com/books/macos-apprentice
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

macOS Apprentice is a series of multi-chapter tutorials where you’ll learn about developing native macOS apps in Swift, using both SwiftUI — Apple’s newest user interface technology — and AppKit — the venerable UI framework. Along the way, you’ll learn several ways to execute Swift code and you’ll build two...

more

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

Section I: Getting Started

Begin your journey by learning how to install Xcode and the basics of programming in Swift. Along the way, you’ll learn several different ways to execute Swift code.

Ensure your tools are working so nothing slows you down when you dive into this book. Install Xcode and create a new project to take a quick tour of Xcode and Swift basics. You'll learn some tips for using Xcode efficiently.
Start finding your way around Swift by running it in Terminal. Learn about Swift's data types, operators, variables, constants and collections.
Use Xcode to build a command line app that runs in Terminal. Learn more Swift features including conditionals, loops, functions and optionals.
Use a Swift Playground to learn how to combine Swift types and functions into your own custom types.

Section II: Building With SwiftUI

In this section, you’ll use Apple’s newest user interface technology — SwiftUI — to develop a word-guessing game called Snowman. You’ll learn about data flow in SwiftUI, managing multiple windows, using charts and adding macOS-specific features such as toolbars and menus.

Start building a full app using SwiftUI. Design and implement the layout using SwiftUI components.
Start adding real data to the user interface. Learn about SwiftUI data flow and property wrappers.
Learn more about data flow in SwiftUI and how to send data to all parts of your app. Make an observable object that's available to all your views.
Learn more about operating with multiple windows in your app. Add a Settings window for user preferences and a completely new view window.
Use the SwiftUI Charts library to display your game statistics in a more interesting format.
Mac users expect their apps to look and operate consistently. In this chapter, you'll add a toolbar to the main window and customize the menus to suit your app. Finally, you'll add an icon and export your app.

Section III: Building With AppKit

From the very beginning of macOS X, AppKit has been the workhorse behind the user interface of all apps and there are still a number of tasks where it is the superior choice. In this section, you’ll explore such an area while building an app to browse movie data from IMDb, the online movie database.

Use AppKit to create a new app. Learn what AppKit is and use AppKit tables to display movie data.
Select movies in the table to show their details. Design a more complete user interface using the storyboard and Auto Layout. Mark your favorite movies.
Add more features to the table. Sort and search the list. Save and reload your edited data. Learn about the Mac sandbox.
Menus are an important part of the user experience for any Mac app. Edit existing menus and add your own. Create a contextual menu. Add an app icon and display the table status.
Add a new window to edit a movie. Set up the user interface for the new window. Pass data to and from it. Configure the view using Auto Layout.
Set up the data flow for the edit window using Cocoa Bindings. Learn the different methods of working with data in AppKit views.

Section IV: Combining SwiftUI & AppKit

Apple has made it simple to include pieces of both user interface frameworks in a single app. In this section, you’ll do just that in order to add some finishing touches to both of the apps from the previous sections.

SwiftUI can't do everything, so you'll learn how to integrate AppKit features into a SwiftUI app and when this is a good approach.
In a reverse of the last chapter, add SwiftUI elements into an AppKit app. When is this the right way to build an app?

Authors

Contributors

Over 300 content creators. Join our team.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK