Get familiar with WidgetKit and SwiftUI frameworks in Xcode - iOS app development for beginners

preview_player
Показать описание
🟢 LIMITED TIME OFFER - SAVE 37%
Practical iOS and macOS app development tutorials with SwiftUI in 4K

In this tutorial, we will learn how we can create a Widget for our iOS mobile application using SwiftUI in the Xcode editor. Using this WidgetKit framework and API, we can easily build widgets in SwiftUI and make them available across iOS, iPadOS, and macOS.

CHAPTERS

00:00 Introduction to WidgetKit framework
00:15 Final project demo with iOS Widgets
00:30 Widget Gallery
00:45 How to add a widget to the iPhone's home screen
01:02 Learn how to create a Widget Extension in Xcode
01:20 Add a new target to the iOS project
02:00 Activate the widget extension
02:30 Get familiar with the new Widget template and its assets
02:50 Learn how we can test Widgets in Xcode's Simulator
04:33 Learn the basics of how WidgetKit framework works
05:20 Why creating a useful widget is important
05:35 What are the building blocks of a Widget?
05:40 Learn about the Widget Family
05:53 Learn about the Widget Timeline
06:27 Learn about the Widget Entry
06:50 Get more details about the reload policy
08:17 Learn about the limitations of Widgets
08:45 Get familiar with the default Widget Template
12:52 Let's work on the Widget's preview in Xcode
14:06 Adding new assets to the Widget's catalog
14:40 Let's add some dedicated icons for the widget
16:05 Learn how to edit the Widget's background color
17:13 Learn how to share an existing file with another target
18:18 Learn how to edit the Widget's content
19:48 Learn how we can share Swift code with the Widget target
21:18 Working with SwiftUI's geometry reader
25:40 Let's create a new Widget Family property
26:18 Adding conditional views for the Widget
28:19 Adding font varieties for the Widget
29:45 Let's test the completed Widget extension in Xcode's simulator
30:55 Launch the iOS application with the Home Screen's widget
31:30 Wrap up

As you may know, Widgets come in multiple sizes, and users can visit the new widget gallery to search, preview sizes, and place them anywhere on the Home screen to access important details at a glance.

Adding a widget to our app requires minimal setup and a few decisions about the user interface's configuration and style.

What you also should know about Widgets is that they display content using SwiftUI views.

In this tutorial, we will focus on how to create a static Widget extension in SwiftUI.

Alright, without further ado, let us launch Xcode and start coding along with me.

WidgetKit Basics.

Since the new WidgetKit framework and its SwiftUI API is a huge topic itself, therefore it's impossible to teach everything about it in this short lecture.

That's why we need to take baby steps to get familiar with it.

My main goal with this class is to build together a static Widget.

However, before doing that, it's worth knowing the basics of how a widget works.

Having said that, let's get started.

So, what Widgets are in a nutshell?

With widgets, users get timely information from their favorite apps at a glance.

Also, users can use widgets on Home Screen to keep some content or helpful information at their fingertips.

But not only that, users can use widgets from Today View by swiping right from the Home Screen or Lock Screen on iOS devices.

As for widget developers, we need to get familiar with three fundamental building blocks and how they work.

These are the Widget families, entries, and timelines.

This SwiftUI tutorial is part of the best seller SwiftUI Masterclass course.

#SwiftUI #Xcode #Widget #programming
Рекомендации по теме
Комментарии
Автор

Hi we want a practical app for wallpaper, nobody has mentioned that before and thankyouuuu

appsstudio