Skip to main content

2021 | Buch

Getting Started with WidgetKit

Create Widgets for iOS and iPadOS

insite
SUCHEN

Über dieses Buch

Develop handy, UI/UX friendly and eye-pleasing widgets using the brand new WidgetKit. Apple’s brand new widgets allow iOS users to work with their favorite apps in the home screen of their iPhone or iPad without even opening the app!

Join us in this exciting journey as we explore the APIs introduced in Apple’s WidgetKit framework. You'll dive into the human interface guidelines (HIG) for creating widgets and review the recommendations Apple gives to developers for developing widgets with intuitive, easy-to-learn, and consistent user interfaces. In addition, you’ll take a look at some SwiftUI views that are useful not only in creating widgets for iOS apps, but also for creating iOS apps themselves.

You’ll put everything you learn into practical application by actually writing code and creating widgets. Get a clear view of how everything works so that you’re able to incorporate widgets into your real-world projects authentically and successfully.

What You'll LearnConfigure widgets and make them talk to APIs using URLSessionWork with timelines and event handling in widgets

Fetch content from a remote server and display the data in a widget

Make content dynamic both remotely and locally

Who This Book Is For

iOS developers working in the Apple ecosystem with a basic understanding of SwiftUI.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Getting Familiar with WidgetKit in a Flash
Abstract
This chapter will quickly introduce you to WidgetKit, Apple’s framework to develop beautiful and handy widgets for iOS homescreen and macOS Notification Center.
Sagun Raj Lage, Prakshapan Shrestha
Chapter 2. SwiftUI, Human Interface Guidelines, and Widget Family
Abstract
Now that you have a general idea about WidgetKit, you can move forward to learn about some basic building blocks of a widget. In this chapter, you will learn about some views of SwiftUI that will act as the building blocks of your widget. Then, you will get an overview of Apple’s Human Interface Guidelines for creating intuitive, easy-to-learn, and consistent user interface for widgets. In addition to these, you will learn more about WidgetFamily that enables you to create widgets of various sizes.
Sagun Raj Lage, Prakshapan Shrestha
Chapter 3. Writing Your First Widget
Abstract
Now comes the chapter in which you will finally get to make your hands dirty by working on a project. In this chapter, you will create a widget extension of an existing project and break that widget extension down to see what it is made up of – timeline, timeline provider, widget view, placeholder, snapshot, and widget configuration.
Sagun Raj Lage, Prakshapan Shrestha
Chapter 4. Making Widgets Configurable and Interactive
Abstract
One special thing about widgets is that users can configure them and also interact with them to some extent. In this chapter, you will learn how you can make your widget configurable and interactive so that users will fall in love with your widget. To make your widget configurable, you will use IntentConfiguration. And you will make the views in your widget tappable so that users can tap them and navigate to various screens using deep links. As this chapter has a lot of important things to cover, you may find it longer than other chapters of this book. So, it is a good idea to give this chapter some days and even perform revisions.
Sagun Raj Lage, Prakshapan Shrestha
Chapter 5. Fetching Configuration Options
Abstract
If you have made it to this chapter of the book, then till now you have gained an idea about how you can develop widgets of different sizes that not only display static data but also have the capability to fetch fresh data from a server at a specified interval. Also, you have learned how you can add tap targets to your widgets and also make your widgets configurable.
Sagun Raj Lage, Prakshapan Shrestha
Backmatter
Metadaten
Titel
Getting Started with WidgetKit
verfasst von
Sagun Raj Lage
Prakshapan Shrestha
Copyright-Jahr
2021
Verlag
Apress
Electronic ISBN
978-1-4842-7042-4
Print ISBN
978-1-4842-7041-7
DOI
https://doi.org/10.1007/978-1-4842-7042-4