Learn to create iOS 14 Widgets in SwiftUI 2.0 | DevTechie Interactive | Skillshare

Learn to create iOS 14 Widgets in SwiftUI 2.0

DevTechie Interactive, Learn new everyday

Learn to create iOS 14 Widgets in SwiftUI 2.0

DevTechie Interactive, Learn new everyday

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
10 Lessons (3h 33m)
    • 1. Introduction to WidgetKit in iOS 14 and SwiftUI 2.0

      6:00
    • 2. What is WidgetKit?

      10:17
    • 3. Creating Simple Widget in SwiftUI 2.0

      34:57
    • 4. Creating Weather Widget in SwiftUI 2.0

      43:26
    • 5. WeatherWidgetUpdate

      3:33
    • 6. Widget Family in SwiftUI 2.0

      31:00
    • 7. WidgetFamilyUpdate

      5:09
    • 8. Creating Configurable Widget in SwiftUI 2.0

      37:24
    • 9. Creating Widget Bundle in SwiftUI 2.0

      46:29
    • 10. ExpenseWidgetUpdate

      13:09
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

79

Students

--

Projects

About This Class

WWDC 2020 introduced a new way to interact with iOS apps. They called it widgets. Widgets are small glanceable tiles that live on user phone's home screen and gives a quick snapshot of app's features. In this class you will learn to create basic to advance widgets written in SwiftUI 2.0. You will need Xcode 12 beta 2 or 3 to work and follow along. 

Meet Your Teacher

Teacher Profile Image

DevTechie Interactive

Learn new everyday

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction to WidgetKit in iOS 14 and SwiftUI 2.0: Hello. Everyone. Hope you all are doing great. I'm very excited to announce this new video Siris on IOS 14 wicket gate. In this easel, we will be creating our own Iowa's wages in Iowa's 14 using Sergio I and rigid Kate. Though we will be creating various different regions in this course are and they're going to be ranging from simple Ah, widgets. How are we gonna learn how we can create a rigid? So you gonna learn about Bridget creation process and basically, what it takes to create a rigid and we're gonna be building this simple calendar, our widget, How and we're gonna push that into Apple's into IOS is rigid library, so we can actually see that and add it to our screens. Okay. And from there on, we will be Ah, real. Go on and create a weather regent. So let me show you that one. So that's weather reject and, uh, you gonna see you gonna learn how to support different types off rejects on different sides of families. So you have small are you have medium and you have large on how to support different kind of content on different kind of fidgets Okay, So you're gonna be gonna be learning about that. Gonna be learning about how to create a preview mode. Basically, when you're vegetative being loaded and when you're rigid is gathering the information. What do you show to your user and how to keep them in sync off data being loaded So they know that there's something going on in the background So you can be learning about visit family, small, medium, large, how to show the preview of the placeholders and stuff. And we also look at Country Grable, which is so which is that can be that can be configured. So, for example, if you look at if you create another rigid for expensive jets So this is what we're gonna be creating and add this expensive idiot on your screen, you can simply hold, tap, hold and edit that ridge it to basically choose another category. And depending upon which category you have chosen, for example, food, your budget is going to change that. Now. This gives you an opportunity to add another reject. So I'm gonna go and add another region. And these two visits can live on their own with their own categories. So for example, by changes to grocery expenses. So there we have it. So you have, like, you know how you have grocery experience. We have food expense, same Bridget, two different variations. So you're gonna learn how to create configurable rejects, so you can have different rigid style for different configuration, and they all refresh on their own timeline. Now, at the end, we'll build a visit bundle, and this visit bundle is gonna be where you gonna see how you can create a rigid library for your app and package different kind of ridges in the same app. Okay, so for that, we will be building this out. Multiple reject coats, of course. Reject library. Okay. Where you're gonna have your widget. It's gonna support different, different modes. And this is basically gonna fetch online quotes, friend, um, coats from famous people. And it is also gonna have a exchange rate, which it So let me select and find the exchange rate. So So basically, you can find out the current exchange rate, What is going on? So these a different sort off nature off visits, So you're gonna be a packaging these two different digits into a single app, all right. And then you're gonna basically ship that within that same app into the user's phone, a user can actually take advantage of two different kind of pictures from the same map. So basically, things class will cover all the information that you need to build your own bridges. And it's gonna be Regis. We're gonna have, like, no beginner level, and then we're gonna go medium in advance. So we gonna take every step towards gaining that knowledge to build really advance bridges . And we're gonna be using IOS 14 and safety I 2.0, for this. So this class cancer of all group of students, whether you're a big ner or your advanced level, this is gonna give you something or the other fidget kid is very new to the market, so we all are learning. So this is a great time to actually gather this knowledge and because we'll start will be starting from scratch it it will not leave no room for guesswork. And you're gonna see a practical implementation and practical approach as how to go about and build your rigid kit. So join me in this journey out when we will be creating so many vigils to learn. All there is for the digit kit. I thank you so much and I will see you guys in next radio. 2. What is WidgetKit?: alone. Welcome Where it's Hopi. All are doing great. And today we are starting a new series on Apple's newly announced which it get Okay, so what we're gonna be doing in this syriza s Oh, don't make set a context a little bit before we start, as we are going to be building various different Halbridge, it's and we're gonna start with a very simple one. Now, one thing to keep in mind that widget kit is changing constantly, and I have changed. I have seen it change from X code Beta frustrate er when when it was released in second beta when it was released in they're beta released some more new things, and deprecate did a lot of old things and stuff like that. So, um, things air still like, you know, sort of shaky, But it's a great way to learn, actually. I mean, with each beta making things more strong, eyes what you need, and you get the opportunity to try it out first hand before it goes out for full, full release. Yep. So which is why I decided that I think Beta three is a right point where things are like, you know, looking a little bit more promising and stable. So I thought, like, you know, we can start at this point and then they have run, make some more videos to cover. Um, more recent changes or updates and stuff like that. Okay, so if off that sounds good, let's go ahead and explore what we did get. Has some Shamsher you guys have seen, um, Debbie, Debbie D c. And, uh, you So I was getting apple. It's demo on a widget. Get, but let me show you how we just look like So this is our simulator And against all it out. So you have this regular phone screen, and this happens no longer in there. So let me remove this. And, uh Oh, Okay, So this is a new dialogue that comes up. You can either remove from home screen, are you? Control it completely. I'm gonna delete it. And yeah, So this is your home screen, and you can add widgets. Stewart's all you need to do this. Stop. Hold for long press and click on this plus sign. Next thing, you're gonna see the list off APS that actually have some sort of rigid. So if you select, for example, calendar. Maybe you get thes calendar, sort off updates. Right s. So this is one form, and as you can see, like you know, all these items are listed here. They don't have they didn't have any value and let Iran valleys appeared. That's actually called placeholder, and we're gonna be looking at that. But Apple has changed a lot of things in place, Holder. So just do warn you up until, um Xcor Beta to placeholders and rigid updates are usedto work different Then Now, Now the whole visit becomes black, and I think that's ah, that's a park that they're gonna fix in future leaders I read in Apple's form that are there actually actively working on So the placeholder native bucks, But anyways, um so, yeah, these are different kind of reject. So they have three different families. How you have swell, you have medium, and you have large okay. And if you go ahead and take a look at other, we just, for example, if they take a look at battery, so battery has same thing, right? And you can actually take that so you can simply grab on these And if you long press. Okay, I actually think this misstep. So let me select it and click on Advocate and actually places it on the home screen, and then you can let it go. You can hold tap to basically, if there's any configuration, you can actually added that configuration. Looks like this one does not have it. So let me go ahead and remove this visit. Let me go ahead and add it another one and result and show you this because we are going to be creating, we are going to be creating configurable digital, so like you can provide the configuration. So I'm gonna add this news one. We're here and the step hold they go. So you see this advocate, right? And it regent of this edit rigidity. Click on it, have which flips around, and you can provide your own. You I, uh this is a custom you are that apple is providing, or you can have a configuration related. So as you can see, this is still like, you know, not very cobb. It is not getting configure. Probably. So let's find the one that can. Honestly, I haven't haven't had chance to explore Apple's existing. We just myself evolved. So let's edit this one. And, uh, let's take a look. Got okay, and it And OK, so it shows you this list, and then you can quick on this and that actually launches a custom motile and stuff like that, and, uh, in future radios, you're going to see how we can create this. But like, you know, there's another list that actually comes up as a sheet, and you can select from better, but yeah, there are a lot off configuration opportunities and he have I am here. Okay, there shows you like, you know, how many reminders do you have And this is tied directly to the reminder. So if you tap on it, it will open your reminders app. There you go. So you don't lose up. Thea reminder step right. So that is gonna be that These are divisions, okay? And they take, like, you know, four icon sites on the screen. And what Apple is designing these to be our plans. Herbal ah, content information only. So you cannot put like animations are toggle buttons are stuff like that onto the screen. It should be a classical quick glance information that I can supervise the information about your app and basically app how it actually has relation to your users. So whatever. Whatever they say you are for an app that has pizza terribly great. So that AARP actually shows piece of delivery status so your region can allow your customers to see where their peace at that. Like you know it as it left the pizza shop here did that Made is ready. It's on the way when it's gonna arrive and stuff like that so you can provide that sensible information in here are news like, you know, your reminders and stuff like that. So those are some of the examples that you have for which is now, Like I said, they come in three flavors. Um, so let's take a screen time and, uh, you can take 2nd 1 eso that's called medium, and it takes the text to rules complete to Rhodes. Um, and, uh, two columns. So two rows and two columns are four columns, actually. 1234 and two rows. Yep. So Ah, and you have, like, you know, more space to work with. And here you can provide links s So there's a new A P. I called links, and you can provide heart spot, like, you know, four links that can be tapped that can deep link in two different locations off your app. Now, this one is one giant link. Have any tab? Run it. It actually opens up That, uh, that 11 place where you targeting? Okay. Now, um, if you add the last one the lonely and the battery stores 3rd 1 he has a lot of things him here. So this the biggest one, And this takes almost half the screen. And it has, like, you know, all these. All these rows can act as link individual links as well. And as you can see, it has, like, a lot more information than your other rigid scan have. Now, there's one thing that Apple has not operated the documentation yet. O r a t least I haven't found yet is how to provide this transparency so you can see, like, you know, December transparent. Um, and there showing the background a little bit. So, like, you know, I haven't seen that documentation yet, so that's yet to find, uh, but we'll we'll find out soon like you know all about which is okay. Anyways, So what? We're gonna be starting up starting up, like, you know, the SYRIZA. They're going to be creating a whole bunch off regents, and, uh, we're gonna be starting off with a simple reject. So to understand how we just actually how the work and a lot of the required components are there. There are simple because there's a lot of things that go on and we need to understand all those. And then we're gonna take it slow and, like, make it a little bit more complex, complex and areas. Okay, so there's a lot to discuss. So let's go ahead and get started in the next video. We're gonna be starting up on and creating our very first, which Okay, so I'll see you guys in next video. Thank you. 3. Creating Simple Widget in SwiftUI 2.0: Hello and welcome back. And in this video, we're gonna be starting off. Are you first, idiot? So let's go ahead and create that. All right? So I have this project created. So before we start, I want to show you what we have. X code 12 beta three. Okay, so we're working off off. Paid a three. Okay. And with that, let's go ahead. And at any rate, it So to add in, usually to an existing project. And this project is basically simple are the simplest it can be. There's literally nothing in it. I simply did file a new project, and that's about it. Okay. I mean, after that, you you can just go ahead and create, like, you know, from the template, select IOS app and then click next, providing information about the product. Click next and create that. That's about it. Okay. So we can go ahead and create our what it now. So go to file new and add a new target. Okay, Now, when you click on you tarted their so I could be hoping to think they're gonna show up several extensions that you create, the one that you're interested in and The newest member in this family is without extensions. So we're gonna select, reject extension like here and click next. OK, then we're gonna give our rigid a name. So I'm gonna name this simple regent, okay? And you can name it. Whatever you want to, you might have the first time and you're creating. You might have this include configuration intent selected. Leave it off. Our de selected. Basically, if it's like this just on, select that one and leave it off because we're going to see how to add this on our own leader on in the videos during the seriously going to see how we can include configuration intent and provide the configuration information. OK, um, next up is a project high. You can have only one choice. If you have more than one project within your workspace, it resort faith. Any gonna have a selection for that? But believe the default 10 or, like, you know, the main one where you're trying to add embed in. Make sure this is actually this is gonna be there. Just make sure that it's actually embedded with the application because we just always ship with the app yourself. with that this click finish, it's gonna be another dialogue that's gonna pop, and that's gonna be about activating the budget. And we do want to activate the widget and create a scheme. So we're gonna activate it, and it's gonna create a scheme right here. And this scheme actually will allow us do directly run the widget, and it's gonna add that region right here. If it doesn't add it, that just fine can actually go ahead and add Reject traditional way Which tap Holden, then my accomplice sign on the home screen s so that's how it can do it. Okay, so with all this set up, you are ready to go. So you would have this new folder right here that says simple widget, the name that he gave. And it had its own appeal in populist its own efforts and its own simple widget file. Now, this file has ah whole bunch of things, and as you can see, this Ah, new warning studies showing up and this is actually pretty knew it came, started coming up with this beta release and what they're what I was trying to do is basically trying to get rid of stairs or get away with this place holder. So they remove this place holder of U and that actually is still trying to figure out, like, you know what to do. So, for this, scores were gonna keep our placeholder of you because like I said, things are not fully fleshed out for placeholder views on and they're still working actively working on it. So we gonna leave it as is, and we get a youth and work with warning until next payday comes out and hopefully they're going to be much more decides of on what they want to do with the placeholder of you. OK, but let's go ahead and and run this widget right as is, And this should show us a time. Okay, so this is actually launching on iPad. IPod touch. We don't want iPod touch. We want I phone 11 pro Max. So that's quite a night in that, uh, let's give it a minute hand. It's basically gonna launch. And what this widget is gonna show is a simple time. So if you look at here, it's just a text entry off date and the style is time, so it's only gonna show us time. There we go. So this is what, um you see? And, uh, if you remove this widget so miserable this and you tap hold, click on plus and go all the way to project Quit explored. Simple. You can see your regent being shown him three different family size and you can click on add and then we go. It adds that. And if I run it again, I can see the placeholder view being shown here. And it just shows placeholder you until the time actually comes. So okay, we tried one more time. And this it's always I know. So it's gonna take him in to talk to you. Oh, yeah. Still still working through that? Okay, uh, a man is like I said, like, you know, things that are still not ah, 100%. Okay. Um, yeah, that actually happens. No way. You're see Xcor not being able to connect to two year similar sometimes And you're gonna see that that air is pretty consistent on the beta release have seen this since pay no one . Okay, it's let's go ahead and get started with our budget development. And, uh, we're gonna do is we're gonna First thing we're gonna do is we're going to remove everything. We don't need all these, okay? And you're going to start from scratch. OK, So first thing I like to do is basically arrange my code someone a created new group without folder, and this one is going to be called views. There might be so models And also let's create models and let me create APA's all. Where we gonna We're gonna put all these ap related things in here, and I'm gonna create one more that's gonna be widget. So all reject really that stuff. It's gonna go inside, and I'm gonna put simple we get inside that. Okay, so we put this at top, okay? Um, okay. All right. So let's go ahead and create Thea first thing. So you the first thing that you need is basically a model for your reject, okay? And the visit that we're gonna create is again gonna be It's gonna be a time, but we're gonna actually display it a little bit differently. Okay, We're gonna display the date to be collectively sort of a calendar with date and month, OK? And, um so we're gonna get the day, date and month. The three shown in the counter. Okay, so first thing we're gonna need is A and entries to something called Timeline entry. Okay, so we will create Hey, time on entry costs. Let me say this hand. I'm gonna we get a new file, and this is gonna be a sir file, and we got to simply say this'll One is because simple region entry. Okay, so this is sort of your model, okay? I mean, it's get it could this can have, like, another model. If your object become complex, which is gonna be in the next reject we're gonna create, we're gonna create a little bit more complex, which it rate is gonna have its own model. But for this yet, we not gonna need much because we're still trying to, like, you know, learn about basics off budget. Okay, So you gonna named it, uh, make sure like it's your simple region. Where is going group? Make sure it's actually selected by default. As like, you know, whichever folder you're putting in. And, uh, then you have target selection as simple widget extension. Okay, So go ahead and create that right there and then import. We're gonna change it to Regent Kit. Okay? And, uh, we're also gonna import. So do I. All right, now we're gonna create our struck. You're gonna call this one simple. Read it. Entry Timeline Entry. Okay, so this this is basically gonna be the content provider for your widget, and we only need date for now. Silicon say's let take is often date. Okay, so that's gonna be your model. Next thing you're gonna need is basically, So let's create a timeline s I'm gonna go and create in your file, and we're gonna call this a timeline. And the way Bridget works is basically it creates these timelines where regular updates happen. So it's sort off like a like apple actually described in their WWDC 20 demo is ah, sort of like watch how water s schedules. It's updates. So it basically schedule says it's updates on timeline. Where, like, you know, you define your entries to be 12 and three. This is a time and, uh, been first timeline expires. Second, entry becomes active when second entry x by a stern entry becomes active. And then once third entry is about to expire. That's when update is called and more timelines have created. And you can create as many entities as you want for the same land. And basically, they all gonna execute one after other and when they are expired, based on the policy that you have to find for the for the execution, it can actually update on the timeline, depending upon that. Okay, so that same time land sort of concept applies here as well. And so we're gonna say, important, kid, and we're gonna actually create the timeline here. Okay, So for to create timeline, it's very simple. How are we gonna name this struck as simple? Reject timeline And this is gonna be timeline provider. Okay. And talent provider takes an entry type eso. It's a type alias entry type. Okay. And this is your entry that you have created. So single Sorry. Simple widget entry is gonna be the type now, next. It requires two functions to be implemented. Plus one a snapshot. Okay. And this snapshot is basically, um, this guy right here when you open the reject art gallery, you see these thes values, right? These are called snapshots. Teaser. Stada can be fished from server. This can be a real data, or you can actually create a fake entry like, uh, like, wow, batteries does. I think, uh, receive batteries has? Yeah, So they go, you see this fake you board and all the things. So, uh, this can be, like, you know, something that he can create. So that's what we don't do. We're going to create a fake entry for us. So let's just is miss all this and click done. And for snapshot, begin to simply say, let entry is equal to simple raises entry. And this one takes, um, date. So it should actually, Yeah. There we go. And we gonna supply the current date, like so Okay. And now we're going to simply call completion with entry. Okay, so this is basically gonna create that snapshot for us. Next up is basically the actual timeline, and we're gonna choose the timeline with context and completion. I mean, if you look at it, both of them are same. I don't know. It could be a buck. Um, but our entries. So this is their Remember we talked about those cold bunch off entries in the time like eat entry providing one instance and you can have, like, you know, basically thes entries. You can have them line up. So that's what we're gonna do. We gonna show you gonna create, um, a collection off entries, simple Reggie Gentry collection. And you can initialize it empty array. And then we're gonna put a four loop. So before for Lupus to get the current date. So current date and this is gonna be date. So so we don't do is ah not gonna generate that timeline. Okay? So for 200 a time when you can simply say they offset and it's just Ah, a loop off, like, you know, seven days off timeline that we're creating. I'm entries, and we can simply say crust compute entry date. Okay, Entry date is gonna be calendar. To begin to choose the calendar, not current. Don't date. And we need the We need the overload that actually takes by adding value and two Okay, so let's look for by adding value and two okay. And we gonna say we wanna add how you is by adding day. How much? Valley 11 day to eat value, right? Or you can say they offset So what we're gonna do is we're gonna create entry date for from today. So today, next day. So 123 like that. Okay, so do you Today is gonna start today, Okay. And then we're gonna say current date, right? I'm gonna force unwrap this. That is fine. That well, you never gonna be, Neil. But if you're if you feel and safer, but it go ahead and undrafted if let or something, um, then we're gonna create our entry. An entry is gonna be off type simple with your pantry once again, OK? And the stakes date, and we're gonna provide this as entry date that we just created right here. OK, so that is our entry that has created Now we're gonna a pin this to our entries, so entries don't append entry. That disk election is gonna have basically collection off all these entries for seven day works off timeline that is created for us. And then we're gonna simply create timeline with help off timeline. Um, and we're gonna supply entry and entry is gonna be entries. It takes a a collection. So we're going to say entries. And this a policy that were doctor were. So when year entries are about to expire, But that's when this policy is gonna get triggered. So we are going to say when you reach to the last date last time line, right? So once again, this is a crime line, right? And your entries are like, passing, and your timelines have expiring or your entries and expiring in the timeline. And then you reach the last one when this is about to expire. That's when you're Tomlin is going to get filled with sound more entries like that. Okay, so you are simply gonna say at end right here, okay? And then you can say completion. And this is where you're going to supply the time land back. So this is your timeline provided, Okay. And, uh, then, uh, let's go ahead and create our main entry point for the visions. So we know what all components we're gonna need. So go back to the Simple Region torture file and we're gonna import rigid kit import safety . I and we're gonna decorate dysfunction. Oh, are like, you know, this struck with main. Okay, this is gonna be the main entry point for your widget. Now, one thing. I will. I'll show you in a minute. That you have to keep in mind is the membership. So, I mean, get this simple, which had created Egypt and, uh, you know, create kind eso This is simply a string. And, um, you can put, like, you know, kind as as this truck name and then party and body is off times off type some rigid configuration. Now, this takes two types of conflagration. There's an 10 configuration there. Static integration, severe interested in static configuration. Okay. And, uh, this provide. So as you can see, like, you know, there's this deprecating method We're gonna use this one because Apple is still working on this new one that's coming up. So I saw some of the issues, like, you know, when I was working with the other one. So that's why I would suggest and recommend how that you work on the replicated one until the new beta comes out. So this is basically the time and provider that you created. So you're going to simply say simple for the provider is gonna be simple timeline, simple timeline. Okay, now the placeholder view really to create an entry, you need to create those two stinks we need to create. Okay, so we're gonna create those next But before that, let me show you something. So one thing that you need Teoh keep in mind is that because you have this, um, this file that's actually that has made in it. And you have this this vile That's actually the simple app. APP file in new project is called. It's also decorated in Maine. These do cannot be like this. So this file cannot have like, you know, target membership for both. And this file, The main inter files cannot have terribly membership or boat. What's gonna happen is if you leave that checked or by default, If it gets checked like by mistake, then what's gonna happen is you're gonna start seeing some compiler link occurs that there's a duplicate main. It does not tell you where this sometimes it does sometimes doesn't. But you need to be sure that wherever your main is your basically target membership is selected to that particular Parrett area only. So the simple widget is basically the main launch or entry point for rigid, so make sure it had started membership for Bridget extension home. Okay, though, but that Let's go ahead and create our is going and create our next item, which is the place. Order you. So place overview is is look, the temple. I mean, it's a simple, um, we just create a new file, and we select safety our view template here, and we're gonna call this one place holder. You think that? And Ah, now here we are simply going to se someplace older, just a placeholder. And there's a new our tradition that to you at that table has actually added, it's called Redacted and re elected has this place order, so it's gonna show a redacted line until your reloads. Okay, so if it's loading that it's gonna show That's redacted line for the placeholder. So So that's actually gonna create that. So that's our placeholder. So let's go ahead and provide that place overview placeholder. You like that? Now, next thing we need is content. Content is actually given for the entry, so entry is gonna be coming from the timeline. So this is where um, the widget kid is gonna basically provide you a timeline, right? An entry for the timeline that your view can display. Okay, So what you need to do is go to your view, create any file, and this is where we're gonna create our view for our timeline are an entry to many too many talents. Um simple Bridget in tree view? No, uh, for the interview. It's gonna be simple. So if you have you, so we are going to be expecting are rigid to provide the entry. So we're gonna say, let entry simple widget and true. Okay. And we have that information now so we can start sending our view. So we gotta create a simple the stack here. And the staff were gonna have ah, heavy sack with some spacing, okay? And it's gonna have a text which is going to be showing month. So we're gonna create a helper function for that. Let's go ahead and just type month for now. Oh, this making bold and give it a forum color. White then had some padding to it. And padding is basically going to be on the horizontal site with 20 points and, uh, background with rectangle called out. Right. Ok, um then we're gonna have a day, so we're gonna show the day like that and, uh, to sleep Everything default X text is gonna be the date and going to give it a bunt. LA restrained one. Except okay for the whole thing. We're gonna give it a background, and this background is gonna be a rectangle with Phil, and we're gonna create a color someone actually paste a color, literal. Let me see that. Um, okay, so me get the color literal, and it's going to be this one right here. And this is actually sleight s. So this is the the hex code E B B E b for this color. Okay. And it's slightly tart, like off white. Someone removed the preview section. And next, we're gonna add some padding about 20 points of patty. Let's give a circle clips, you clip, shape, circle. Okay. And then let's add some shadow, and we're going to use the other or color. It's gonna be great. Radius is gonna be five X is gonna be five. And why is gonna be five and we will not make edges ignore safe area dot All all right. Now, let's create some functions to popular these month date and they value. So gonna say private funk Get a day this returns a string, all right? Had simply return eight for mentor got string entry dot date. Now you can actually create just one function to return all the three based on such statement, but to keep things simple, I'm gonna copy and paste and, uh, and basically gonna return three different values. So date, and it's just gonna be month, okay? And we are simply going to say, get a month, get day and get date. Okay, so that is our entire view that we have created. Okay, so let's go ahead and go to our Bridget. And here we are simply going to say we have an entry we're gonna call Single are simple. Which it entry view. And we can supply our entry that's being passed by the configuration to us. Okay, so what that that's going to do is whatever your, um, your view has given your static configuration has given that's been supplied on this date out, we're gonna use to basically populate our view right here. Okay, So let's go ahead and run this and see if we've got everything and ignore this warning for now. Like I said, and, uh, let's go ahead and try this which it out and see what we what we get. So the killer placeholder for you, I think eso one thing that he gonna notice There's another bug that the placeholder view does not, um, update sometimes. So what it does is basically it does not show you, Um, it does not show you. Ah, placeholder. It still will show you, like old place or review and that, actually, it's something that I figured like, you know, sometimes if you remove everything So let's say if you remove your app and then come back, um, you gonna notice that it's actually gonna Sometimes you fix of that. Okay, so that's good. And see if it, uh, if Rick fixes this issue. Um, okay, so then we go ahead every lunch, and no, it's still cached. So one more thing I've found is like, you know, you might have to reset here content, and then it will actually reflect the changes, but yeah. Anyway, so we have little bit issue. We are Dexter's, huh? Liberte? More bold than we want a panning. Maybe gin produced this, the padding around it and, uh, yeah, okay. Oh, and this? Ah, that's Ah, That's the layout tissue. We can we can figure it out. Um, let me show you what to her. The other, which families look like. So let's load this. And, uh, I'll actually hold end. Show you all the other rigid families. Okay, so our region is not showing up this. Okay, Alright. How would actually leave? Just 20? I'm not going to try to e. Okay, um, he's going around this. All right? So nice building now, Okay. And, uh, we have our reject loading Still waiting. Okay. Bacon gets like, you know, it's so it's running low, go slow, but yeah, there we go on. And now, if I hold and, uh, add rigid, There you go. It's now showing up, so I'm gonna click on it. And these are our other budget families, as you can see, right? So if you add all those, it looks like you know, little there's a lot of space that's being wasted here. Were like, you know, you're just trolling showing one cell, but that's okay. Like, you know, we can work with that and create new digits that are going to show you more details, stuff like that. And you also gonna learn how you can control your readers to not show. So let's say, if you just want to show if they see you build a video just for this single purpose like small area, then you only show it for a small area. You don't short for medium or large for that particular reject. Okay, so you can control that, too. And that's actually gonna be something that we're going to be covering very soon. Okay, but congratulations. You have created your very first, our widget, and ah, um and yeah, you learned Hopefully you learned a thing or two along the way. Um, so in the next year, we're gonna create another rigid and explore a bit more about How did it get? So we are going to basically try to create a feather reject and in the weather reject. What you can do is that we are going to actually call different AP eyes externally, P eyes, and you're gonna see how you can make networking calls and everything in that in that region to download data and display on your future. 10 how it can refresh automatically based on different times that have been provide. You can schedule those updates and stuff like that as well. Okay, so that's gonna be coming up next. Okay, so thanks again for watching, and I will see you guys in next video. Thank you. 4. Creating Weather Widget in SwiftUI 2.0: Hello, Mac. And in this video, we are going to be creating a simple weather reject. And And if it what we're gonna do is we're gonna download some weather data from Internet, and I'm gonna use this ap. I called a p. I don't Little software. Ah, slash rather reason. I'm using this one because this is, like, you know, really simple api I that takes your latitude and longitude, and it gives you forecast for a few next few days. Okay, this is perfect, for example. But Deacon, uh, choose open weather map or any other ah, FBI that you want to use for your for your purpose. Now, the best part about this ap eyes, it doesn't require any a p I cure anything like that. You simply go to this ap I don't little software ap, i dot L i l lil soft dar softer slash weather and give your latitude and longitude and then you get your data. Okay, Um, so they had sexually what we're gonna be using, So let me keep this aside and let's go ahead and get to our project. So I have simple project created and it does not have which had created yet, So let's go ahead in. I had a new reject into this. So add new target and we can choose our project extension target here. I'm gonna call this weather budget, okay. And, uh, it create activate hand. Now, we are gonna create some folders first. Okay, So I want to create folder without oh, our only want to create, like, a war show older structure. OK, so I screed what's your folder structures? App. And, uh, then you have use You have models, and we're gonna need services. So gonna need one service just gonna download. And, uh, you might need some you tills. Okay, so let's go with ease and budgets, Bridget, for sure. Although we just related stuff is gonna go in here. Okay. Um, next up, how are we going to move? Our app? Relieved things in here and widget into Bill, please it. We're gonna delete all the content of the of before we do that. Let's go ahead and start creating some thea models and stuff. So first thing we're gonna create is a better model. Okay, so I'm gonna select model folder and add a new file Select Surf file. Click next create. Call it whether Make sure the target membership is extensions. Reject extension, okay. And then create. All right, Next up, gonna create a struck destructor is gonna be called weather is gonna be portable, conforming to affordable protocol, and we need name, and we need everything that is there as a key for the c B I. So I'm gonna take temperature. It's I think it's a listed as int wealthy. And then next is our unit. That is a string, by the way, this ap, I only gives you whether for United States, I think, um, I think this is listed in on their website. That's only limbo for us. The FBI is available for, like, you know, throughout the globe, but latitude and large, your information is like, you know, considered only for us. Okay, so we have a lot these according keys created, and that actually is our complete model. Okay, So, basically, but this model created Let's go ahead and create a model or our entry file. So we're gonna go into models once again. Yeah, that's also a model, and we will create a weather entry and once again to stuff file whether Entry and, uh, in import, which it kept. Okay. And we might need safety eyes just imported in case struck. Let's create its trunk, and destructive is gonna be off called weather entry. It's gonna be off type timeline entry, and it takes has two things. Has public let date cake and public met better whether all right, so those two things are gonna be there now, this is our complete entry. So remember, in the last video we talked about, like having a more complex example or more complex model for our entry, and this is this is it. So our timeline, we expect it to provide not only the date, but we also expected to provide the weather whether object, Okay. And, uh, and whether is actually something, um, that we can now. Okay, so whether it's something that we're gonna get from our FBI. Okay, so let's go ahead and go to the next, which is going to be the service. So we need to create a service that's gonna download this weather information. Okay, so what we can do is go to service it and create a new file cold weather services or weather service whether Start with okay. And here. Are we gonna import stuff? Try, um, cause it's gonna also include the U I kid stuff in your obsession and stuff like that are not here. I get Sorry. Your old session, this stuff information. Uh, so, class, you're gonna create whether service okay, And this class is gonna have you are else. And this Ural is going to be that you are. Now that we've been looking for little software. So but me, But I didn't copy that. And, uh, basted here. Okay, that is the d wawrow that we're gonna working off off or downloading data, and we're gonna create function. Oh, get whether and this is gonna be a have. Ah, that's gonna have a completion block. So probation Block is gonna be escaping, and it's gonna provide result. Now, Result type is gonna be an array off whether our air, if it fails, not our second parameter, it's gonna be his old second perimeter. It's gonna be air. Okay, um, outright to be close. All propensities properly. Okay, I think we did all right. Yeah. I wonder why it's actually suggesting me too. Do this. I'm sure I'm missing something. Well, I'm missing. Ah, Well, so you have a result type weather? Um, yeah. This is very strange. Um, okay, so I'm actually okay, let me do something. Uh, that time, maybe l trigger s I'm going to create a euro directly like that and, uh, gonna say, but hey, have this and close this class right here. So I have a class and I have a function within the class and okay. And when I start typing, you know, session Come on, Exco specked and open. Uh huh. High. OK, that it was wrong. And I'm just being stupid here, OK? I knew, Like, you know, there's something wrong here. Um, a little session. OK, so you're a session that shared that data task. Okay, with your Oh, so you rop have already created right here. And this actually gives us three things data response and enter in. Okay, so you get that be actually, check for really quickly. Guard air should be now by the wife. We are simply going to say completion dot failure with error. Okay, and return. All right. Otherwise, witness a completion about success. Okay? And we gonna parse are by the response bed. I would function right would focus better response from data Dad returns and a ray off weather. Okay. And, uh, here, we're going to get our heads of data. Now, we are going to need a weather response. Object, Okay? And whether response object is basically the response that's being sent to us. So if you look at the a p I one more time, So let me pull up. Do you be I AP I actually sent you an array off values in a key called forecast. Okay, so that is our response. So we don't get directly an array, we get a key value pair that where we have ki has forecast and value as an array. Okay, so you do is we are simply going to create a response. Moral, And, uh, we're gonna use that to decode better response. Okay. And here we are, simply going to say, struck whether response and this is going to conform to portable forecast. So just should be exactly same as Theo. The key. Unless you wanna deal with them. Unless you wanna deal. It's calling kids and stuff like that, which, um, I don't want to right now, So I'm simply gonna copy and paste, and it's gonna have a type value is gonna be a pipe in a rail, Whether Okay, now, this gives us a new opportunity to basically directly parse that data using Jason Dick order. So we are simply going to say Commander Data is equal to try Jason Dick, Order that decode. Okay? And we're gonna decoder are the weather response. So we can simply say whether response start self like that and data is gonna be the data because being supplied to us. And we can simply say if let whether he called to better data and the other d Okay. Ah, then going to simply return weather dot or whether deduct forecast. Okay. Uh, otherwise we gonna return. Hey, an empty array. Miriam deering actually, on the screen a empty weather and weak. Unless a police a error temperature ASIO no description. No unit and description is gonna be enter. So that way we know, like, you know, that something, something bad, um, for successfully simply going to say Then l start, get with responds and get with the response. It is gonna take data, okay. And, uh, I'm gonna force interrupted because just because way haven't. Uh Well, you can try Teoh do it safely. I'm just gonna leave it out just for the tutorial sake, But he can do it flat en garde, lit and stuff like that. And please do it. Um, OK, so but that our services done. All right, so we've got our service. And now we are getting our whether data are entries created her marvellous created. So let's go ahead and create our rigid first. So we actually get we get our Oh, all the components put together. So we did is going to start telling us, like, in order to think that it needs So first thing I'm gonna do is I'm gonna actually do all this. Okay? Um, yeah. Okay. And then we're gonna say at mean, trusting our next thing when it's check its target membership. How? It's very important, um, struck whether Egypt and this is gonna be ends again. We checked, and, uh, we're gonna create private, private kind stream by with war kind string like that. And, uh, this is gonna be whether Reject. All right. Okay. Next up, it's gonna be body written rigid configuration. We're gonna once against a static configuration. This one right here. And you're gonna choose the second, uh, school note, the one that heads strike through in it. I feel reusing beta three if you're losing bear to, uh, still works fine. Okay. There's only one. There's no overload. There's only one static configuration. Okay, next thing we need is a timeline. So let's go ahead and and create our timeline. So we are going to create in the file and, uh, let's go ahead and creates, like, sir, file which it timeline like that. And ah, this timeline is gonna have are really it related timeline related information. So we get Kit Import, so do I. Hey, and we're gonna create instruct. I co edit a call it for digital. And I don't know, I it should be whether a timeline, but the timeline they go Alright, it's called it whether time line and this is gonna be timeline provider. Okay. And once again, entry. So let's give type really is in grief, too, whether entry which we already have, right and next is snapshot. Our snapshot gives us, um, basically the just It's basically just a sample data sort of think. So let's create entry. And, uh, this entry is gonna be Hey there, Entry. And we're gonna simply say date and or whether he are going to say asseff 67 common for tonight. Hand description. Maybe you clumpy It always is. Um then we're going to simply call completion and entry that go. All right, so that's sort of snapshot. Then we're gonna create a timeline, okay? And the Tomlin is gonna have current date, you know, do it slightly differently in this time, then the last video. So we're gonna get the current date gonna create refresh state, and we gonna use this. Refers state to a fresh are timeline entry our regent calendar. Not current, not date by adding and we're gonna add, um, minute. Okay. Hey, we're gonna add 15 minutes, okay? And, uh, data is gonna be the current date. 15 minutes to current date. Next up, How we are going to basically call our weather service their service, not get weather completion. Okay, we get our result. Okay? And i'll be sensibly Say if case dump success let I stayed out, is equal to result. All right. And here we are simply going to say whether is equal to then we should create a weather object so that whether off type with her like that and whether it's gonna be a shop checked out first, you need first in, first off first from the return result. Why that Because we are going to be getting a whole bunch off response. It's an array. Remember, for our single entry are small Regent, You can I just show 11 days forecast. So first entry, that's gonna be as the current weather forecast. That's only gonna show. Okay, um, and we're gonna come back, like, you know, and basically modify the switch it to have, like, more information later on in the next video. But for now, we're simply going to say, take the first entry, um, health. It is going to be whether it's equal, do oh, weather with name. And this is where the other cases. So we could not fetch the weather. So that's why we gotta say there getting whether, like that? Um, all right, so that's no, that's good. Okay, Now let's create our weather entry, okay? And, uh, now, remember like, this is all happening within the completion block because we have access to our Rather here . So we're gonna simply screened our entry now, whether entry and date is gonna be the current state and whether is gonna be the weather that we have extracted from our service, and then we're gonna create our timeline. I think so. And, uh, entries is gonna have an array, which is gonna have just one value entry policy. This is new, and this is gonna be after date. Refresh date get. This is how you can schedule to refresh your budget. Um, at certain time. Okay. You can. Yeah, that What we're saying here is like, whatever, there's 15 minutes passed to the current time, then updated regent, then next 15. That next 15 like that. Okay. And last thing is called completion with the time line. Okay, So with that, let's go ahead and build it, and Ah, yes, we know that you need to update those. So that's what we're working for. Whether Tom Line is gonna be our provider. Next up is our placeholder. Okay, So, um, for the placeholder, what we can, uh, what we can do is, uh, can create a placeholder. You So me go ahead and create our our God who are abused to have you see abuse creating your file and, uh, you go select sector drive. You base holder feel like that. Okay. And this place, old review is gonna be a, uh, the stack and that he stack we are greater fakes and take some color. So I'm going to use color literal, maybe literal like that, and less select something off white. Maybe this one is okay. Yeah. And then we're gonna have a stack. And this is, um there's something that you can use if you want to create your own redacted worsen. And, uh, I'm going to just show you how you can create your own preview with your own redacted version. All you need is ah, whole point of rounded rectangles us. I'm gonna create rounded rectangle with corn radius. Stand out, Phil. And the filling is gonna have color, not white. And frame is gonna be with about 80 20. And we don't care about lions to take center. He falls Kliment, and I'm gonna take this and copy pieced three times like that, okay? And we can have some bedding and I'm gonna say it is ignoring safe area. Oh, okay. So that his are place holder of U. And let's go to a rigid and tell if that we have a placeholder be for you now, Next up is content. So we get the entry once again, and this time it's gonna be rather entry. And, um, we need to create the weather entry here. So for rather entry, we can actually need some. Um we might need some date exhortations and stuff, so we'll see. Okay, Not whether entries are a rather entry view is what we need. Okay, so let's go ahead and create whether you safety are you, whether you our weather entry, you like that, and, uh, you can expect entry. All right, um, next up is basically we gonna create our Tillis, create our base color, so let me copy the base color from police holder and make it as basic Alor based color counts. Let's make it private, because we don't need to explore that one. And, um, next it's gonna be easy stack, which is going to have that base color. Okay, And then we can ever be sack. The three stack is gonna have next which is gonna be so the's coordinates are from San Francisco. So what I'm gonna do is I'm gonna hardcore this and in your a p I if you're you think somewhere else is a P I like in open weather map or something, and you have a city. That city actually is part of the response how that get taken and grew up on this example. But I'm gonna actually simply show you how. I mean, the intent for this video is to show you how you can, um, call ap eyes using your session and show some data on the midgets itself. So that's why I'm using this little software a PR regions, like, very minimal in nature. What we're gonna do here is we get like, you know, our entry. So entry has information about our weather because we created that tight and inside the weather, we have information about our temperature. So we're gonna take that temperature, and then I'm gonna put I'm gonna click control command space to search for a degree symbol this one right here and going to select that so I can insert that here, and then we're gonna ask entry to give us unit unit. Okay, so that's gonna be for tonight. All right. And, um and then we are saying, but this one is large title. So their weather temperatures in blushed title. OK, next up is our text. So we're gonna show our weather condition using this helper function. So let's create per function and once again, because the hippie has minimal doesn't give you much, so we're just improvising whether icon. So I'm gonna create a condition string, um, in conditions string is gonna be supplied by the weather response. And depending upon what it has beginner, I return some sort off some sort off response. So let me a copy and paste down, okay. From my sample project that I created the has this information already. So you don't see me typing all these unrelated things, Okay, So simply uncommon. It this one and all we are doing here is we're getting the current condition, okay. And from that current condition or what we're telling it is, uh, that if you find if that current condition contains partially Sonny, then show this icon cloudy than show plowed result and show this and stuff like that. Okay, so that's what that's what this is. Um, it's simply getting a weather based on, um, based on the conditions text. So begins a policing, get condition our weather condition. I come for condition, texture and condition. Text is coming inside. Actually, it's a string, so entry dot whether don't description Okay, so description gives us that I can are basically that description gives us that string that actually can be can be, like created as an icon. So we're gonna get that I just spat on matching. Um, what women do is batting and stop for 10 and then next text is going to be by the doctor description. Okay. And want is gonna be what? Not like that. And, uh, we are also going to have an Etch stack here, and this age Stack is gonna have a space for first. So we're gonna show when the weather was updated and it's gonna have a text updated at, so are updated, right. And, uh, you're simply entry dot date got time on lee, and we're gonna create this as an extension for date. So you tells us, create in your file and this file is gonna be a certain file date plus extensions like that . Okay. And here we are simply gonna create extension on date, which is gonna say time only. And it is Give me It's gonna give us a string, let from date itself. So we're gonna see eight. Format is equal to you. Need our minute and am PM OK, we got simply return or matter doubt string from prom date would yourself. Okay. Next is, uh let's go back and time only should be available. Now. Let's go. Okay, so that is that actually gives us just the time value When when the weather waas updated. Right. And all we need to do is send the foreign for this someone safe bond system size 12 point, and, uh, this give this e foreground color. Um, color, not gray. Dr. Capacity, maybe 0.5. Okay. Um all right. And, uh, we're gonna give our East Axum petting, okay. And, uh, the stack it is ignoring safe here. Yeah. Okay. Let's go build this and see, um, getting any shoe? Yes, we are. So when they roll that Okay, so let's see. Okay. Entry. Yes. So now it's time to show our entry. And this entry is basically your whether entry that we have created the view whether entry review that actually takes an entry, which is whether entry and our supply type by the static configuration is also a rather entry. Like we discussed. Um, Okay, so that is basically our budget now there a couple of more things that I want to provide. First of all, you can provide a display name, so configuration display name actually changes the name of the project. So if you look at the old Regent, it had No, I see it had the simple visit vaccination, conflict name, right. We want to provide a much more user friendly name. Okay, so for that, um, we're gonna do is we're gonna provide e friendly name FF whether Redoute like that. Okay. And we can also provide a description. And we say this reject displays like that. Right. So, um, now this is this basically, um you're there were of configuration information. Now, you can also limit this and say, supported family. Now the stakes and already, and we're gonna say we only one support system small. This is how you filter out. You say, like, you know how in this project, He had, like, you know, three different we just being present. But like, there was so much space, and it looks kind of far like in all the empty space. Um, Well, in our new budget, if you're going to say, like, you know that we only have, um, small reject, we only show a small which it. Okay, that's going to run this and see if once again, this launching on iPod touch. So let me change that device, and you are going to see it's in our excess. Max are 11 11 pro Max. Okay, so is installing now and, uh, our, which should be sure being created. Okay, there we go. So this is our preview that we created, and, uh and our weather data is all right if it's being downward, But let's see, let me remove this and let me add a new reject, as you can see by the reason. And there you go. This is what we show our sf. Whether Richard, this is our description and are sorry. This is our name. And this is the description that we have. And if you notice there is no other regions so we cannot scroll anywhere, right? I'm trying to scroll, but I cannot scrolling there because there's only this kind of agent that's available only support that family. OK, next up is there's something going on in the, uh um in this and I think we forgot to call Resume. That's my bed. Ah, this guy didn't try it again and see if you get the weather information God and build it again. And, uh, Bill succeeded and hopefully gonna get our weather information. Okay, There you go. Some error. OK, Eso that might be That's That's actually something that you might encounter. You're Yeah, I can throw. I've seen, like, not sometimes AP at throws in there, but if we get, like, okay, second time retort. There we go. So this is our weather. How and as happens, go is 62 degrees. It's mostly sunny. It's gonna be mostly sunny and then it's actually the time that's given its updated at 804 I am okay. And, uh, if you keep looking like, you know, just keep an eye on it in 15 20 minutes, that's gonna update. Now, this is one thing that I want actually mention as well that you're, um, visit can request to be updated. It cannot enforce that hate. I need to be updated liking after 15 minutes. So it's absolute trippin, man. No, that does not work System. Actually, Paradies Ah, prioritize Easier, Bridget Abate time. Based on all the other values there are, are all the other budgets are all the other operations that is waiting on. So it's gonna put your question the Q and gonna process it, but depending upon its priority, Okay, you can change that relevance by providing it at 11 score. And that is actually simple. And you can simply go to your entry and you can say relevance. And here you can basically simply return a relevance value So you can say return elements timeline, entry relevance, and, uh, they can give it a score, and the score can be between one and 100 right? We're 50 years like, you know, your prejudice. This update is somewhat important and hundreds, like, very important conflict. That so I'm gonna give it 50. But still, it does not guarantee that it's gonna be paradise. So you're rigid is gonna get updated her relative to that time that you have provided. But it's not gonna be absolute time. Okay? I've rarely seen the rarest absolute time. And I've tried, like, in a whole bunch of ah Ridge, it's on. And every single time, it's more than what we provide. Okay? So just keep that might and with that are simple. Better divergent is created. As you can see, this this example was a little bit more involved. We did, Ah, lot more things in this. And we learned about, like, nerve agent families and stuff like that. In the next video, we are going to be expending upon this video it and gonna create different variations for, like, you know, for these families how we're going to create another region that's gonna be still the weather rejected A is gonna be for medium size, and then there's gonna be large size, but they're all going to support different views. They can have different views and different kind of information filling the entire space that has been given to us. Okay, so that's what we're gonna be doing in the next video. So thanks again for watching out. See you guys in next video 5. WeatherWidgetUpdate: Alone roadmap. And let's go ahead and fix another widget that was that is broken now because of the recent update for Xcode beta. And once again, we are using Xcode beta, Xcode 12, meter six. Okay. So let's go ahead and fix few things. There are few more things that have been introduced and some things have been removed. For example, for the static configuration, that place holder has been removed. So let's go ahead and remove that. And I'm going to build again to see more more issues that had been that had been introduced. So let's go ahead and see to the timeline provider actually needs to in other entry. So let's go ahead and jump to definition to basically see what it needs. So if you notice a has a a new type alias. Well, I think it's needs a place holder. So let me go back. Let's go ahead and fix this. Okay. So yeah, so it's basically the place holder that it needs. So what we can do is we can first more entry to the top, and now place holder can become whatever you have in this snapshot. So a snapshot is changed to get snapshot. And I'm gonna use same value for the placeholder as well in a return, the entry right there, okay? And for their snap for the timeline. And I'm going to simply take the timeline that we had in order to get timeline and remove everything else. Ok, now let's go ahead and build again. And hopefully we should get everything working. So I'm just going through files because in my experience I've found that to be like, you know, one thing that S helped her finding they're both quicker, especially with these with these beta Xcode releases where if you open a file and actually actually opens up the, it actually show you the air rather quickly. Alright, so let's go ahead and take a look. Okay, there we go. So whether loading now and if you add in new rigid. So let's go ahead and add a medium size widget. And you can see the placeholder is taking effect automatically according to the content. And then when the content is available, it actually shows the uptake. Alright, so there it is. There's the fix for all the issues that you've been facing with new, newly released API with beta six, right, so that's it for this video. Thanks for watching. I'll see you next video. 6. Widget Family in SwiftUI 2.0: alone or Mac. And in this video, we're going to be looking at supporting different families for the weather reject that we created and last video. Okay, so if you haven't checked it out, our police check it out before continuing because we're gonna build up on that example. All right With that said, let's go ahead and get started. So if you remember in the last video we created on be added this rigid family in the vision itself right here supported family. So I'm going to remove this because what we wanna do is you wanna make our rigid available for all three families that there are, like, small, medium and large. And you want to provide different You i for different family to support, basically. So because there's different riel state that's available, like you know, that space that is available for those videos to show it's different in varies for each family. Okay, So in order to do that, we have to do some set of work. We have to actually update our weather widget somehow to support multiple different things . So let's go ahead and get that work going bust. Okay, so we're gonna start changing things out one by one, and that's actually going to get us ready for supporting multiple families. Okay, so first thing we're gonna change is gonna be the weather entry. And if you go in weather entry currently, our entry only supports a single weather. Now, what we're anticipating is, uh, a Honore off weather information. So we're going to simply change this to B, whether info and an array off whether and ah, that's the only thing that we're gonna need here. Now it's gonna start crashing other places because because every other place expects a feather, but not a rather entry. So that is fine. We can actually fix that really relatively quickly. So no change in services, anything. Now, let's change our timeline. So let's jump onto the timeline here, right there. Okay, So our timeline is how gonna have this rather entry that's gonna receive. And for the snapshot, right? Snapshot is something that we're gonna have to just so we're gonna create Oh, maybe weather snap. And here we are simply in the same case. An array off where there object. Okay. And I'm going to simply take this and create a for each oop. So for group I see you know, to nine. Okay. And, uh, going to see whether snapped out append and based on. Okay, so we're gonna create, like, about 10. Tell me wreckers. Okay, now, that is a better until you don't need whether until we just need the better. Okay, so about 10 whether me, her records and then for our entry, we can say whether entry and it's going to take date. So we still gonna supply our current date for that? And the stakes whether array which we already created with weather snap so we can just take that and supply that and completion is still gonna return that entry. Okay, now, what this is gonna say is basically I is not being used, So let's do this, I say, um, but the name SF day hi. Hi. And and say day I saw Day, one day, zero day, one day to come like that. And here just do provide some sort of variation. I'm gonna say, 10 times, I it's gonna be the temperature is going to produce in description. It's gonna be cloudy, so that's fine. Okay, So there's our snapshot. Next up is our timeline. So our timeline is gonna have same. So current value and refresh is not going to change. OK, and weather service dot Get Whether this gets ours are result. And here instead, off this we're gonna say whether info and convert this into an array off whether all right , and ah, here. How are we gonna say case we get this and they say, Just whether Inco is he cool? Too much data like that. Okay, so we get the full array off weather input and, um, for the else case, the else case, we can say whether in po all right. And, um, I'm gonna create in the air weather. So that air, whether so there was in there and we just want to show. And you can basically show some other information if you want to. I am simply going to say maybe sf and the temperature is maybe maybe 10 And for the nights in the description maze gonna be enter, right? Are you getting Oh, we already have. I should actually copy this or cut this and paste it here. Okay. And for the weather info, Begona, simply pass this. So, uh, let's do air there, there. Air weather, like twice. Okay. Um Okay. So next, How do we need to change? We do need to change this, do other info. And for the appreciate and everything is gonna be it's gonna be same. Yeah. This is called whether painful now. Okay. Anything else? OK, so I think I think that's good. Okay, so next up, we have some more air. So we're gonna handle those. Let's create Goto our view interview, and let's move this into its own. You told the American you can call this press three need, So I'm gonna call this Hey, create any file and call this file, rather you tell. Okay. And, uh, I will take. So do I. Guess we need it. And basically gonna just cut from here and paste it there and whether you told Okay, so yeah, and desperate in in a extract like that can make it static. All right, um, so our timeline has changed. Let's change our weather view now, where view is fair. You gonna need the most change because we're supporting different families now. Okay, So, uh, the easiest thing I guess we can create a another private let for dark color. So we're gonna need a dark color, and I'm gonna rely on let's take this copy and based and the winner. So, like this, Like this color? A little bit darker. Okay. Um, all right. So what I'm gonna do is I'm gonna actually remove all this so we can write it again. Okay, So whether until we get all right, and, uh, what we need is basically some way to determine which family we are rendering from four. Okay. So that can be easily solved with the environment where you will, because environment now includes a rigid family. So environment. And, uh, if you use if you, uh slash dot on and type, which it family. You still not? You still don't get the X cords support on a complete support for it, but we're something in a safe family here in skin. Recognize them. Okay, um, I guess we can actually jump, so they go on environment value, start gathered out which it family. It actually gives you a family for which it get okay. Now, with that information being available, we can simply create a switch statement here. And that's the statement. Can be on family like so. Okay, now get the three variations system, Small system, small. You can see Xcor crash right there. But that's okay. So they get system small hand. When we get system small, you wanna show a better view. So let me create some more help reviews and, uh, that way, like, you know, we can start using those helper views. So let's create a circular eye view. And, uh, but this one is Plus one is gonna be called daily weather so daily, whether you okay and for the daily, whether you are we are simply gonna say it expects a weather object. And for the body it says, Give me I have a V sac with alignment, okay. And we have a text without name. Don't lower case. Okay. Um, so basically, in the name on the p I get night family is also I'm going to simply say if it contains how well, you not it right. Then I wanna use just three prefix, so I only use, uh, whether that name don't prefix off to get this baby and a pen that with a moon symbol. So old this right here. Um, so this one we can use. Okay. And, uh, that was still click on it. And they So that is going to show the for the night. And, uh, if it's just regular than we're gonna simply shea simply say whether that name not prefix three. Okay, um, next up is our next four temperature. So for the temperature, it's gonna be whether thought and pressure and our Baron I symbol. Okay, so our degree symbol. Sorry, um, degrees down, then you have the actual temperature. Better sorry. The unit. Okay, so you have unit, and then next up is another text and begin a literature better utilize here. Don't get weather icon for whether don't description, okay? And we're gonna add some batting top 10 plays, and we're gonna give the overall thing. Patting is well, okay, gonna move this previous section and let's go ahead and create another view. And this view is gonna be whether you so Ah, these were just sort of like our cells. Basically, that we're gonna surrender our information in. So this one is gonna be called weather for you. Okay. And the stakes to values, whether and, uh, updated date. Date time. Okay, um, next are we going to create a V stack with alignment as leading, and then we can display all of our weather information. So city name current weather information. So then take sky right here. And, uh, Mr here, Okay. And, uh, change its phone to be a lot of stable. Okay. And then we're gonna get our I can't. So go ahead, then. Crap this here and paste it here. Put them icon. And then description consented for two. Footnote and it's stack, which is going to have the spacer. And this is where we're gonna show when this was updated. But the forint weakened. Say, system with size, it's called and the foreground color. It's gonna be color. Don't. Great, doc. Capacity 3.6. Your 0.8. Maybe while we were doing this, Noticed that aren't African, See, but but like, you know, this is barely visible, but 8 19 was the last time when this weather when this whether rigid was updated. Okay, so, um, it's actually up. So when you define these timelines and actually automatically trigger sent and refresh your Bridget now this information is sort off like static because it's like receiving the same merely of every 15 minutes. You might have a different case you like, you know, request a stock. Oh, stock price change for a particular stock. And you would see that update more often throughout the day s so you can experiment with that. Do OK. All right. So let's ah, keep moving forward. We have Ah, so we can get some padding going here, and that's about it for our whether it be OK, so let's go back, um, to our main interview. Okay. And for the small case, we're going to create a Z stack. Okay. Inside this Z stack, we're gonna have the beef color first of all in. Then you can have our weather view. The newly created you, which are expects her to thinks it expects the weather. So we can simply say whether Info So whether in poor, we're gonna get, um, already can know whether invoice part of entry. So whether info that zero at zero index and against police entry dot date here. Correct for the updated and, uh, going to say I just ignoring safe area, all of this one. So that is our small system. Small case. Okay, now. Next ISS our system medium. Okay. Says some medium. We're gonna display a the stack, and it's gonna have an etch stack. And I'm gonna are the spacing to be zero and gonna create two rectangles, but based color and dark color. Okay, uh, an on top. We gonna place our weather views. So whether you so I'm gonna basically copy this guy right here and, uh, gonna say, have you get the information from, you know, and one. Okay, So remember, this one is we're showing a medium for the medium size, rigid, and, um, medium size has, like, you know, it's more white, so we can simply say you can have, like, you know, two regions showing or to weather Richards showing site beside. Okay. Eso That's what we're doing. We're creating a stack and creating two different interviews. Right there. Uh, next last one is system large family, okay. And for the system, large family, what we're gonna do is create hate re stack. Okay. Inside the restocking create easy stack beach stack. Well, the spacing explored. It's, um, exporters crashing a lot, which is making it super, um, slow to, uh, basically type. And that actually proofs toe had dependency on auto complete. As you can see, dark color go. And, uh, it's a like these two, I hear and paste. So that's gonna be on the system large. We're gonna show similar view as the medium, but top two are gonna be large. And then, um, underneath that this is the stack. I'm going to create another restock. We're gonna show smaller info, okay for the daily view. So basically, they leave other rigid has, like, smaller And for with day and night Simbolon stuff like nice embolden stuff like that. So that's what that's what we will actually dio. Okay, we will show that one. So we're gonna say h stack, and, uh, I'm gonna call this on Daily Weather View and Daily Weather View is gonna expect just the weather info. So we're already showings. You're on one. So I'm gonna show too, Okay. And three, as you can see, like, you know, creating those creating those helper the helper used helped us a lot. Oh, so I have restrike it. Stack. Let's create another re stack inside to see stag. I'm gonna create these two, and I'll copy this and based it and paste it one more time. And how much time? Maybe. OK, so four, five, 67 hate and nine. Okay. Um, so basically, this is gonna have all the print out. All the whole nine well use. Um, are you gonna actually created it in in a in a loop? But yeah. Um, that's okay. So we have, like, you know, um, a C three stack iss. Hold it here. This is hard. I mean, the main re stack. Um, and, uh, here after this, we stack, we gonna say default. And, uh, for the default, we gonna simply say a Z stack, okay. And, ah, this I learned that you have to actually provide otherwise X code is gonna complain about it, and we're going to simply say whether of you and stakes are intrigued out weather info, um, and zero index, an entry dot date like that. Edges Norick. Safe area called. All right. Um, so that change. Ah, uh, that change. I think we should try to build and see if we have, um, yeah, missing arguments. Okay. And this is gonna be the preview. So, Scott, and build it again. Let's make sure that everything is up to date. We don't need to change anything else, I think. Okay, so it seems like spelling. So let me go ahead in. Uh, okay, run this. And, uh, let's go ahead and take a look. What? We begin, what we get? Um, testing is our weather started show. Um, are actually you know what? Yeah, it's loading. So we have our other and let's go ahead and add a new reject so we can open our which is example, whether Example, As you can see, this is our first small case, and this is our 2nd 1 And we are, um, definitely missing some info, Um, or some formatting. She was like, if these needs to be white, actually, so let me go ahead and go to our whether it be your So is go to her whether entry and whatever. We're using the dark color right here. It's cute. A foreground color that's white. And see if that actually fixes for the medium. And then we're gonna dio Same for all the first. Okay, um so they had built, and, uh, I've noticed one thing as well, Like, you know, between major too, and beta three that build a process are building it has being slow for beta three. So whenever I build, it was much more faster and Beta do so it has gone down for some reason, I don't expected who to go down. I expect things to go like, you know, moving positive direction. But it could be something people we'll see when the next beta comes out. Um okay, so let's go ahead and add the budget. And, uh okay, that's actually perfect. And this is our 3rd 1 This is are the largest system large of you. And as you can see, it's showing us a little bit more detail. Um, and, uh, if he ad if you add the medium one is all just for the completion sake, go ahead and add on to they go, OK, and, uh, this one actually needs that foreground color, that's all. So that's quite and had that. And, uh, okay, I'm not going to run again, huh? Just because it's gonna take a little more time. But anyway, the eyes can see, like, you know, it's ah, it's rather easy. We took several steps to actually accomplish this, but like if you If you go over this again, you can notice that it actually rather easy to support all these different families. By dis approach, we had to actually re fact a lot of things, and that's why it took labour time. But this is how you can actually create variations for off, like, you know, one region for three different families that size that that are supported in the widget. Kid. Um, now you can include multiple ridges into a single AP, right, Multiple different types, and that's actually call bundling. And we're gonna be looking at that example as well very soon, But for now, we're done with our weather reject. Okay, So what's gonna happen in and next video? It is Basically, we will build a an expense app. So we're gonna just build a sample expense, which it Okay. And in that, um, expense. Bridget, Hello. What we're gonna do is, um we'll just create a simple reject that's gonna show different. Different complexity off like, you know, video. But it's gonna have configured rebuilt e aspect. So basically, you can have a configuration. And are you gonna create intent? Definition? And that in turn definition is basically gonna provide? Ah, this long temp and and it configuration thing, eso that which it is solely focus on how to make your regis configurable and how same Vigen different configuration can live on your home screen. Right? So we're gonna see all that in the next video. We're going to create this expense. Um, sample expense happen, and we're gonna add different expense scenarios for our budget in the Okay. So I will see you guys in the next video for that, which is creation. Until that time. Thank you very much for watching enjoy. And, uh, I'll see you guys in the video. 7. WidgetFamilyUpdate: Hello and welcome back. And in this video we're gonna UPI fixing the issues that have been introduced to an Xcode beta six. So once again, the XCode, XCode probe beta six. And there are some API changes that we are going to address. So if you open your radio, you run into these issues. And I'll you need to do for a static configuration, the placeholder is gone, so it's no longer there. So let's go ahead and remove that and create and build so you can see where else the error is. So let's go ahead and her MOOC. Place holder or from everywhere and outright Telerik content. Okay, so let's go ahead and build again. Okay. And they'd go timeline provider has there are changes to the name and beliefs corner has to be in more into timeline provider. So for that, we need to do is take whatever we have in this snapshot and put it in, get snapshot function as well as in placeholder and return the entry like so. And for the timeline exchange to get Timeline and moved the warrior type alias at the top. And then there are some more teeth. Unused. Functions. Do the same thing for the other widget. So simply use snapshot. And placeholder is same, same functions, so you can actually even take them out, take that logic garden if you like to offer complicated, complex logic, then taken out into another function and return from there. In our case is rather simple. So that's why I just pasted that in there. So that should actually fix all the issues there are with the current budget. Let's go ahead and build and install. And let's go ahead and add a new widget. So we're going to look for multiple widget. And there we go. So we have our, we just working for different radiation. So let's go ahead and add widget. So now let me, while we're actually added, Let me add one more. That's going to be the courts rejected. And then I'm going to show you the stack that he can create because we have like two different radiations, that satellite color. Okay? So if you have like, you know, too many of these small rejects, what he can do is you can combine them by dragging them under darpa off each other. So for example, when this is how we can create a smart stack, for example, this one. And this one can go together. So let's them all out on the same page. And quite a stake it take it back. They know when they get do. Yeah, that's actually a very simple, linear or more deaths. Deaths. Because I want to show you how the stacks work so well in the ad from the expanse we don't have. Okay, so let's add this widget and the weather widget onto the screen. And what we can do is we can create a stack for the, okay? So as you can see, are smart stack is ready and he can cycle through all your small widget. And you can cycle through all your medium size. And same goes for the, for the large size. The thing is, all your budgets have to be like whoever is gonna go in the stack. At this point, they have to be of the same family type so you can cycle them through. Okay. So yeah, so this is how you actually fix your tissues that have been introduced in hex. Go two out. So hope you guys enjoyed that. Thank you so much for watching. 8. Creating Configurable Widget in SwiftUI 2.0: blown work, Mac. And in this video, we're gonna be creating this expenses digit. And the intent for this video is to look at how you can create widgets that can have configuration options. So when you long press on a rigid and actually will show you, it will show you a configuration option. Okay, so that's what we're going to be looking at Internet video. So let's go ahead and get started. Eso for this one. I have created this simple app, so I'm gonna add a new target here. So add new target, and, um, you can select our budget extension and we're gonna call this one expense, Bridget. Okay. And, uh, it's called and finish this and, uh, we're gonna going to the folder now for this one. This let's work on this existing file. I'm going to start the leading stuff from this file and start replacing it with our own off her own content. But like, you know, we can work off off single file. You already know how to structure, and this is kind of your out of simple. So let's hooks on. What's the main content that you want to cover? So first thing we can do is that we won't do provide that configuration option. The configuration option is provided by something called intent definition. So we need to create a file for intent, definition, And if you so if you go click add new file, he can have go ahead and search for intent. Definition. So see you get intend definition pile. I thought we need and, um, target membership. Make sure it is depicted extension, and we're gonna call this one expense intent definition. Now, when the file of creator is completely empty, so we're gonna create our intense here. So first thing gonna do is we're gonna create an enough. This Inam is gonna basically prison represent our intent value, Okay, that we're gonna create. So, uh, let's create category, and this category is gonna have some valleys in it. So by default is unknown. And are we gonna create a category that's gonna take values from 0 to 5. So fast rail you're gonna add is gonna be all for all expenses. Okay, then we can add maybe food for food expenses. So whether he can actually, it's play changed display name all expenses, for example. Oh, accents what expenses? So two. Okay, uh, as you can see yourself automatically commending that. So that's actually perfect. Um, then we can have our growth. Three example. And, uh, grocery valley is gonna be grossly expenses. Um, maybe guess in rent guess and it. So OK, all right. So these five valleys that we're going to support unknown is gonna be zero on, uh, then you can get all these other rallies next up there. You're gonna create an intent by creating new and dent, okay. And the sun is gonna be we can save you monthly expense. Okay, that's gonna be the name. And, um, for this expense is gonna be category type. You okay? So it's gonna be information only. And, um, we're gonna make sure that we're gonna say intent is eligible for rigid, and we can uncheck all these other rallies intent as you are configurable win by Siri Short . Curt. And this serious suggestion next week and add parameter parameter is going to be our category. And, uh, it's gonna be category display. Name is ultimately gonna change. Type is gonna be our custom type category. It's just going to start showing up here. Um now, this is gonna be the user can edit shortcuts, stuff like that. So you can leave that and we can check this on off a perimeter. Parent perimeter is gonna be none. And default. Well, you is gonna be all expenses. Okay? One thing. One thing I just remember that I want to tell you guys, was if you have created your project in ex Corde 12 beta to our beta one. And if you try to open that in beta three for me, at least it's actually crashing. Um, so the best way to open it is open year project with regular X code. Maybe you have, like, extra 11. Open your project with that. Okay, keep that open and then open your ex Corde 12 beta three are later on with our work in your using what's gonna what it's gonna do is it will try to map and take whatever you have. Open an existing X code and open that same project inside your beta. So that's how you can actually get away with it. It at least worked for me. So hopefully is gonna work for you. Just want to give you a little tip if you're I was getting super annoyed with the fact that I couldn't open any off my projects. And I figured out, like, you know, this trick by accident. Okay, so let's go to our expensive eight now, and we're gonna start creating some objects. Okay? First object we need is the intent timeline provider. Okay, so we are going to create our own provider, so I'm gonna start moving our remove everything, actually. So must we gonna create our struck for provider intent? Timeline provider. It's time. So if you remember the last time he created timeline provider this time we're creating intent timeline provider because there were gonna provide configuration options. Okay, We're still gonna need entry. Um, So it's gonna be pumped public pipe alias entry, and ah, the steak. Simple entry or something. And now, okay. Simple entry is not creative. I know. So let's go ahead and and create that simple entry. I'm just gonna say struck, um, maybe expense entry. You call it space in tree. It's gonna be time lined entry. Okay. And, uh, and I have public. Let date off the date. Public, let category cough type expense. Catty Hillary. Okay. How is this expense category coming from? Well, we're gonna create E and even for that, it's gonna be a pipe, and she's gonna map our values. Okay, so basically, we're going to create this expense category, and it's gonna map the category that we created and 10 definition. So you're gonna try to keep all the same values from similar values. Um, that's gonna be too much typing. So I'm gonna do is I'm gonna go here and change these 20 food because I want to provide, uh, description. Oh, in our cinemas. Well, so I don't want to is gonna keep it simple. So oh, pulled. And this secret seems to be seems all food and grow three because I don't actually, uh, use default. Denham values the grocery. It's the 3rd 1 and I've initialized. 1st 1 has one. So other ones are energy esta incremental values. Um, but they're not. Maybe an incorrect thin. Next up is gas and rent, So Okay. And then we're gonna provide a function for description, which is going to return a strength switch on self. - Thanks . Home. Okay, so with that Oh, all right. So that we have all of our expense categories. Career did. And, uh, our expense entries Creators to be simply going to say expense entry here. Okay. And, uh, now let's see what else. Okay, so we need to get category. So first we gonna get create a function workaday cory, and we're gonna say it actually takes a configuration, which is a few monthly expends intent and returns and expense category. You know, once again, put a switch statement here on convict out category. So let me see if I can actually, I cannot find Yeah, I know. Yes. Okay, um, a stick. Look, um, me commented out, and let's create snapshot. It's a snapshot, and I'm getting creative, less built. Um, okay. Yeah, OK, provided does not conform. So can we provide the snapshot, please? Okay, so snapshot is gonna be in tree Spence entry. An expense entry takes out to value, so it takes a date and a category, So category is gonna be expensed category. Don't. Oh, just for now. Okay. And we're gonna come back and fix this completion. It's gonna be entry. The reason I'm doing this, so X cold start to cooperate, you expense team. There you go. Now it's actually working. Okay, so snapshot is good timeline. Let's create that one. Um and, uh, now it looks like it's happy, so I can go back and create this category. So what we're doing here is we're creating a category in mapping between the category that's defined hair in expense intent, which is vehemently expense intent right here. So you're gonna get its category right? Config dot category, and we're gonna map it to our expense category. Okay, for for the values. OK, so we simply going to say pattern, uh, take all and return own for the expense category. Now, we're going to repeat that for all the other cases. So food and we're gonna have a default, which is gonna return all for all the other scenarios, which is gonna be basically unknown. If it's unknown that return this. Okay, now, here, instead of returning expense category, we get this information from the configuration from the snapshot. So what we can simply say is here, give us a category as well. Category four and the four is gonna be supplied inside the configuration. So this configuration right here is gonna have, um, the current selected value that user has provided, right? So for that configuration, we're going to simply extract that configuration dot category and match that gunnery to her expense category and passed that expense category. Indoor expense entry. An expense entry is gonna then use it to render our view. Okay, so that's how users configurations are passed along into the budget. All right, for the timeline, we gonna have a say entries, for example, which is an array off expense entry. Okay. And we're gonna generate our timeline. Basically, that's going to consist. Five entries, Um, and there may be an hour apart starting from current date. Okay, So current date and then and create our off it zero to fine and gonna say entry eight is equal to calendar. That current date and, uh, going to say by adding to our and well, you is gonna be our off it to current date. Okay, then we're gonna create our entry, and we're gonna supply within the entry the entry date that you did. And the category is once again gonna come from configuration so and say category for configuration paint. So we're gonna map that, and we're gonna say entry stopped append entry All right, then, next up, we're gonna create our timeline for entries with policy as at end to update now, completion Going to supply that one like that. Okay, so that is going to be our timeline. That's created with the configuration option that we have created for the intern definition . So that's our intent. We have our entry created. We have our category created. Let's create our placeholder. You. So we're gonna simply create placeholder of you now in creating this in simple in in a single file. Just because we can actually wrap this story up, it's only one rigid, but some settings. But I would still recommend taking folder and file this approach That's much more practical loading but the placeholder and he can actually, um, use redacted. Oh, placeholder Xcor designed super slow right now, um, expense, rigid entry, BUE discreet or interview. And we're gonna create our entry. And this is gonna be provided or to intrigue in simply saying that, uh, whatever provider is providing as an entry, we can simply get that our we can actually get it as expense entry, um, and begin creator body, which takes some view in a restock expense U S creator expense view that takes category so category as entry dot category. Okay, has created us. Ah, view right here and, uh, gonna be expense. You you life and it takes category like that, and, uh, agents body. And here are we gonna actually have are such statements Switch statement for category, Okay. And x court crashed again, actually steer. It's the out of complete that crashed. So, uh, what we're gonna say for all? No sea stack and, uh, the only gonna create the cost one and then rest. Gonna copy based. Oh, pass it e Okay. And we stand total expanse. Like I said, it's gonna be all dummy data title. Okay, then you create a dummy graph really quickly. A bar graph alignment is gonna be leading, and all you need is rounded rectangle. It's corner radius iss 10. It's feel yes, color don't white. Don't pass it easy. A 0.5 and I want a copy. This and based it. And the color for this one is going to be blue capacity to a 0.9. Okay. And no, that frame. But quit to show how much off this has filled the graph bed by 20. It's gonna be some padding, horizontal and then or color is gonna be white. Okay. All right. So that's our first, the sec. All right. And then a copy this and based it for all the other so food category is gonna have Easter. It's gonna be food expense. And, uh, let's keep it small like that and, uh, in the states color. So I gotta say orange just to show, like, you know, how they're different expenses. Oh, when we put them as it as, like different, um, different regents, they're going to show up in different colors. So 3rd 1 is gonna be guess in this illness may be purple. Okay. Purple. Yes. Okay. And you're almost done. You more categories. It's a grocery and rent so que it pink. Okay. And, uh, then, you know, rent. Let's make us 6000. Ok, um, see, you have extra. I think you probably probably messed up the brackets. Let me city dishonest clothing. It's what it's calling the stack the stack Gay Closing the sack. Okay. Perfect. Competing with these Jack and funny is extra, I guess. Control, I Okay, um expected so. What? It's are you closing, Calling Z stack. Okay, so let me clap sees and collapse. Okay, so that's sweet Statement, then body and then our view. Perfect. Okay, so that is gonna be is view and then are rigid. So mean obstruct expense. Read it, Pro which it and, uh uh, create our kind. Just copy and paste this name. And then we're gonna create our body for rigid configuration. And this is gonna be intent Configuration. This time with kind is gonna be the kind that created not King. And the intent is gonna be view monthly expense, intent ourself. Okay, that's gonna be the intent provider is gonna be the provider that we created placeholder. It's gonna be the placeholder view. And then you have your timeline entry, which is gonna be the expense entry that's being supplied. Tow us and we're going to simply say, expense entry, expensive. Just interview. And it expects an entry. So we're gonna give it a new entry here. Okay? And now even simply give it a configuration display. Name on. This is gonna be expensed. And that's it. Oh, with that her Let's go. Hadn't see if everything builds. Okay. Looks like eyes building. Let's go ahead and run it and see if we can get are expensive idiot showing up and we can configure it. So expense app It's installed. There's one more buck that I noticed that I just wanna that you guys know it sometimes, Um, it's like whenever it's installing, you won't be able to, like, interact with the with the reject itself. And there you go like we have our We're just showing up. We can't happen old. And, um, see, you has threated to add button. Go. Wow. Okay, um, we cannot add any more budgets. What do you mean, we? I don't know. There was a limit. Okay, let me remove the weather, Ridge it down so we can remove all the widgets there are. And, uh, Okay, so let's see how come to the echoey. Okay, that's your app. Gonna go away? No. Oh, okay. Okay, we go a started showing up. That was a bug of a pretty cool. Okay, so there you go. This is what do you see? Like, you know, like said we only have one reject. That's why it's actually showing up. But you have in our new option now we should have edit Regent so you can click on the edit Regent, and it should show you the options. And, uh, that is in you that anything you think of also healthy unable to load. Like I said, IHS Super. It's super picky right now. That's tried one more time. Maybe this time it's gonna load. Excuse me a minute and still not able to load. Okay, so hopefully you know they'll fix this. Let me try the other rigid and see if that one is actually loading hopes, not loading. And, uh, that is very strange. Okay, So, um, I tested this one on beta two and it was actually loading. And it's a show like, you know, basically a an option for us to choose away. So But I think that should actually be all right. I'll, for the rest, see it and see if there's any upgrade, our any change that we need to do. I don't think there's any change because this is a tested code, but I'm pretty sure it's like Xcor bug. Okay, so let me go. I mean, let me know guys like, you know, if you see the same thing and if you find ah, the route cards off the issue of same thing is happening. Or if I made some mistake. Okay, so, um, we can we can definitely circle back on that. So and I'll keep investigating. I'll try to, like, run this with, um X code beta two, and, uh, show you another video. If we can do about that, Okay? Because it seems like you know everything. Like, if expenses are showing fine, then the first expense is like, you know, the default expense. This is what we have actually said here, default value. So if we say, like, you know, hey, so gonna be the food and for your on it, um, it should show us a food expense. Which it It fell here. Oh, let it compiles and, uh and yeah, so I don't we see the don't remember show. I mean, Tony, membership has to be correct. Otherwise, it's not even gonna show up. Yeah, I don't remember. Ships is correct. OK. And this is public intent class. Um, okay, so it's definitely there's something. Um, that's actually you see, every three Duke this go a stupid Let's try. Um, have you doing it again. And, uh, or we should see is hitting this break point You're not hitting the brake board? Why? All right, So there's one thing I found out that there's something seriously wrong going on here. I have so many break points right here. You can see, like, so many break points, but no, the big points are being hit. Okay, so there's something going on with paid up free. That's actually not good. So what I would I would suggest you guys to use It's basically a beta two, okay? And I'm gonna actually download Beneteau myself as well and run this project and better, too. And see if that fixes. How are these issues all posted An update to the video, but as you can see, like, you know, here, um, we selected the configuration. So if I choose configuration gas here and if I could and removed a sergeant, Right, Um, the next budget that I'm gonna add it's basically gonna be defaulted. Teoh, Guess Okay. So that means that our configuration is being her read correctly. Okay? It's just X code is being weird about it. And, uh, not showing us the correct Well, you but Yeah. Do do. Let me know if you guys encounter the same issue. There you go. See, Like, you know, it's Ah, it's loading this and is showing the edit reject, and it loads the the configuration, But it cannot. Let's play the early, and I don't understand why it's it can't do that. So, um, does not need to be a parent parameter. Okay. Um, yeah. This is how that's very strange. Uh, honestly, like, you know, I can't I can imagine, Like, you know what? This. Okay, now, maybe watch shotgun, so nothing here. Okay. Well, um, I don't know what can be, uh, what can we do here, So Oh, I think I'm gonna I'm gonna try toe, believe it, and do more investigation on why it's not happening. And, uh, maybe downgrading excursion would help. Okay, Um, but yeah, this is it for this video. This is how you create your configuration reject. And, uh, I know that this video is not complete because we were not able to see the actual configuration. Um, like demo. But how? Posts an update to this video. Okay, but thanks again for watching, and I will see you guys in next video. Maybe in next year we're gonna switch Teoh Bay. That too. And, uh, we're gonna build out a region Monday, all begin to see, like, you know how you can bundle different wishers. Um, like, you know, like we created expense budget. We can create another vision off different kinds with another target, and we can bundle those together and display them. Um, as the as the library right here, instead of showing, like, you know, this one rigid for three, you initiations, you're gonna have, like, six digits. They're gonna have different variations in our case is gonna be Just do because we're gonna just support the small is the smallest possible. But we're gonna have to different regions that we're gonna show, for example. So that's gonna be coming up in the next video, so I'll see you has an extra thank you 9. Creating Widget Bundle in SwiftUI 2.0: hello and welcome back. And in this video, we're gonna be creating multiple digits within the APP and that can explore widget bundle. That's a new feature where you can bundle multiple different types of digits in do a single set. And when you present your digits list, do your users you can actually show them, like, you know, just like single Ligety. So show with different form factors. Okay, But before we actually go on and create that example, I want to show you I want to circle back on last videos discussion where we were having that issue off. Ex corde are beta three and you could not configure Thea the digit basically based on different categories that we created with intend definition. So what I ended up doing is I I ended up downloading again. Ex Corde Beta, too. So it gets isa was your ex cold version Tall beta too. Okay, so I'm no longer running beta three home burning better too. And if I run basically this this one right here, uh, they have your app, and, um, I'm gonna go home and then old and tap and edit rigid. You gonna notice this is the category selection that you see. Okay. And this is what we're not seeing in ex Corde Beta three scenario. Okay, so court is exactly same. Now, if you want to select a different category, you can do that, and he simply click out of it and your fridge interest configured with that category. Now, let me show you what I was talking about when I was telling you can have multiple once said , you go expense widget, and you add another rigid. And now you can actually configure this to have maybe rent. Okay, so you've got food expense. You've got rent expense. He can add more. And what this is going to do is basically, uh, this is going Teoh keep refreshing these regions based on their own set of conditions. So this is how you can have, like, configurable rejects, and then you can have different style for each configuration. An editor fresh independent, off other. OK, so that's how you could create multiple rigid variations out of same which it just by using the intent. Integration. Okay, so that is it for this, uh, for this example. Not for the video. Okay, so I'm gonna close this one And I hope you you can get this like, you know, Exco Pena to just go to Apple, download and download Beta two again and use that on hopefully ah, in beta four or five. Apple fixes this issue off configurable regents. Okay, so I'm gonna close this worked and let's head back to our main topic of the day and that is visit family. Okay, so we're gonna get started. I am going to create a new turn it and we gonna bad with your target. So we're gonna go down in select Thanh and gonna name this one, which it family. Okay, um multiple multiple widgets. Amount of religion is our product name. So I say is your family's OK, okay. Leave all the options he falled on check if include configuration into distract unchecked that one and click finish. Okay. And we do inactivate this king and there we go. Ok, so we have our which it created. Now let's go ahead and create some older, so I'm going to create a folder without a group without a folder, and I'm gonna call this one rejects, okay. And inside this we can create more so and create one called Exchange. And we're going there basically show exchange rate for this region. So exchange rate widget. And, uh, there's going to be another one that's gonna show random courts from an A p I so we can call this one courts We kicked. Okay. And, uh, and now within these rejects, we're going to create more groups. Eso I need a abuse and, uh, question good for models and equal for services. Okay. And so, Lissa, get the exchange rate we had created and that we're gonna go on and, uh, create our other would it? Which is gonna recourse legit. Okay, so let's go in and start with the models. So I'm gonna create a, uh, a model so added new file, and we gonna choose swift file, and, uh, make sure the target is the family. Bridget probably. Okay. And, uh, we're gonna name this one exchange. Right. Okay, So I'm gonna use basically Ah, this ap I, um we pull up the a p i. She's a really simple FBI, but it's slightly limited in use for portable or please, I don't know, like, you know how to use quotable this way, but let me show you what I'm talking about. So I have this a p i c p a s a p ahead of exchange rates ap. I don't I owe and latest question Mark base is equal to us dollars and symbol is ust and I nr so ust and I in our our rates, it's what we are actually trying to get. Okay, um, the very well part, what I was talking about is that these rates are given between two currencies in their own now symbols. Right? So And if you're quoting quotable class than these names have to be exactly same. Right? So, uh, if you change this to, let's say a d for example, then the key changes do a u D. Okay, so I think, uh, if you want to make it variable, make this a PR available, maybe use chase on serialization instrument. He's incredible. But for our example, we're gonna use our portable because now it's going to show you how you can pass this information and show, but even still use, like your own version off Jason passing on and then work with that. OK, so this is this is gonna be thebe I that we have using. Um Okay. So back to the code. And what we're gonna do is we're gonna create our exchange rate for us. So we're gonna say import foundation is fine. Obstruct exchange rate, and this is going to be a decode herbal. Okay, Like I said, we're gonna or quit de Cordoba, and I'm gonna rely on those hardcore did keys. But like I said, you can change using Jason serialization and search for the key that user has selected to be converted for the exchange rate. There's going to be another structure which is gonna have exchange rate response. And this one is also gonna be de Cordoba all. And you're gonna get rates in and rates is gonna be up type, exchange rate and date, which is gonna be up type string. OK, now that is your model. Now, next up is your service. So that's going on inside the service. Create new file, and we're gonna create surf trial once again, and this is gonna be called exchange rate manager. Okay. And, uh, import from you. I could You might need something. Ah, Struck exchange. Great manager. Static bunk, Current rate. Okay, you gonna use completion block escaping type our exchange. Right. Which is going to return white. All right, I'm gonna call our Ural session. Not shared, not data task with u R l. And I'm gonna just construct the euro right here, and we will use that FBI links. Let me copy that. I think so. And, uh, una force unwrap it. Um, you can do all the checks if you like, um, get data response and enter. And then how we simply check for here. All right, Our response is equal to try these on decoder dot decode change exchange. Rachel is passed our sell from data, Okay. And then we gay. We say, if let the spas our exchange right is equal to response. If you get that valley, if it's not know, then call completion, have completion block and, uh, simply supply the rates. Okay? And don't forget to call resume. So that is our service. Okay, now, next up, let's do our widget. So let's create start creating our timelines and stuff. So gonna go creating the file and we're gonna create this one and call this exchange. Great timeline are exchanged. Island provider. Think so. okay. And, uh, import from being etiquette as creators trucked tabling provider. Okay. And, uh, for the entry into type is gonna be exchange entry. We haven't created that. So let's go ahead and create that. Creating euro exchange entry and exchange entry is gonna be simple. Um, Bridget, Kate struck timeline entry and then exchange rate next up. All right, so you've got exchange entry, so go back to your Thailand provider. Um, XY entry is not in scope to make sure their target membership is correct. If you try to jump definition awesome, it's actually there is gonna go away in a minute. Um, Okay, now, next up is our snapshot. And we didn't create an entry or date some random data. Oh, States, double not string. Okay. All right. And we call the completion with entry. That's a snapshot. Then you have timeline and, uh, going to say current, right? You can't date. Yes. State and refresh state is calendar, not current dot Date By adding day, so is gonna refresh every day. Value is gonna be one. So every single day adding to current, um, the current date, like so Okay. And then you simply call your exchange manager, exchange rate manager dot current rate, and you get a completion block. And this is where you get the rate. Okay, so we used to play Say, let's entry is equal to exchange exchange pantry, and you supply your current date and you supply the rate that he had received. And you take your timeline and construct that with timeline and say, entry is going to be the entry as provided and refresh is gonna be after date, and that is going to be your fresh bait. Okay. And, uh, it's gonna go here, and then you got your completion. That needs to be called it online. Okay, so that issue your timeline provider and we already have exchange entry. So now let's go ahead and create our Bridget. So we know what views we're gonna need, so we can actually work on those. So exchange which it Okay. And, uh, here, I'm gonna import Did you get and maybe some guy okay. Gonna create a struck exchange. Egypt once again widget and ah, let's create our kind. So private, let kind string is exchange rate it and we need body. And this is gonna be static configuration. Oh, kind Thailand provided we already created We know that his exchange change don't provider placeholder of you. We have not created so this card and create that. So gonna simply saying you file 50 I life older, you our exchange placeholder of you. Ok, and, um, exchange place interview. We are going to simply say I'm gonna say loading, but you can change. Um, you're rigid to basically used a fancy with it with for redacted need. If you want to create a reductive effect, just create a rounded rectangle a za police order, and show that that's actually gonna per or perfect. Okay, then we get our entry, and we need to use that entry. So let's create an interview. So create exchange rate exchange. Great entry. You okay? And exchange rate interview iss um, going to basically take the entry. So let entry off type exchange entry I and then you're simply gonna have a the stack inside Deceased are coming. Now, get this off white copper. I'm going to copy and paste. Okay, So this all white color, um, let me see if I can get tax value for this one. Yeah, F four or five f seven. Okay, so that's X value. And, uh, then you have, ah, be stack. Let's get some spacing about 10 points. And, uh, let's get Saca's. Oh, with spacing but five points. Okay. And, uh, we're gonna have a text. Yeah, this is gonna be our dollar symbol and formed. It's gonna be lost. Idol padding background is basically the same color clip shape circled and shadow it color . Ask color, not black. Talk capacity 0.2 radius I X buy and why, Pie? Okay, I'm gonna copy that Based here, change discolor toe white capacity to seven and gonna cost the shadow and negative fives. Next up, we're gonna have a text, and this Texas texture is gonna have a string for matter. Um, format are you? And And this is going to show two decimal. So your dot percent zero dot you know, to f k. And for the arguments is gonna have entry. So I don't know if you need are textually entry dot change rate, not to USD. Okay. And this is gonna be bold and forget on color. It's gonna be color, not black dark capacity. Do you know, quiet. So Okay, um All right, so next to one is gonna be similar. Oh, for the stacks I'm gonna copy is and paste it here. It's just gonna be I am not symbol. So the way you can get it is press command, control space. Yeah. Look, for maybe. Yeah. So I'm gonna use that. And that's Indian currency symbol and, uh, rest remaining everything? Yeah. Everything will mind saying. Okay, so you got your got your haystack closed, and then you're three stacks unless given. But if patting here like that, default mapping is get in for the attack wedges in moorings. Hesperia Hall. Okay. And, uh, when our oldest guy from here and there you go. Okay. That this Go ahead and see how we forgot something. We forgot our widget. Okay, so we need this one right here. Okay, So it's country simply in, and this is gonna be exchange entry. Real entry is gonna be the entry that's being supplied. And this card build one more time. I'm gonna select everything and format control. I and, um, as soon as it built. All right? So all right. So we have our first to get ready now. We're gonna work on Second Ridge. It okay? And that is gonna go fast. It's all because we already know most of the components, so we can just create those. Let me show you the service that we're gonna use A and this service is actually, I really like it because there's no AP. I cure anything needed, and you get a random courts. Sometimes you do get errors and stuff some. Okay, so like this, you get a random quote, every refresh so you can create, like a court's widget that actually refreshes the court every few minutes. Okay, so that's what we're gonna do. We can actually create stand Bridget, and we're gonna see how we can do it. So let's go ahead and get started. So I'm gonna create some new files here. So you're going to start with Dr Older first. So me, Okay, you're gonna need models. Okay. And, uh, I skipped use. I might need some You tilth. So says is it Okay, so we have a model, which it your bills. Henry is okay. I felt do it the started models. So we're going to create a new file here, and, uh, sift file. Gonna call this fun quote. Okay? And, uh, this one is basically going to contain the quote. So already seen that what it returns. So I'm just gonna say de Cordoba Wall, Okay, but that's here. Model. And, uh, next up is your service. So let's go ahead and create that. So I'm gonna create serious so far, okay? Destruct data task. And we gonna use the You are overload. So once again, you are l from string, and we already know the string. It is this guy right here. Maybe I don't for its manic dot com slash ap I ah, one that slash $1.0 slash question mark method physical to get quote and length and laying is called to e n and former identical to Jason and going for something that one night, um, we get data response in air, just, like usual in. And then simply check or guard air it equal to Nell else return, and you might wanna report these enters somewhere or lock them. At least I'm just gonna skip this for the Rudy and, uh, consider that you gonna do that. Um, So wrong data. Okay. F the completion. Gonna call court like that. Okay? And don't forget to call is you on this guy. All right, so that is our service, and, uh, let's see, we mind. Actually, not for you tells you might need a random are color generator so that we create a colors. Colors are class, color plus extensions. Colorless extension. So extension color. It's not gonna get detected because you need to import safety, I but that like that. Okay. And what do you need? ISS static, funk. Random and capacity is what we're gonna expect user to pass. And this is when we have time off double is gonna return a color, and it's just gonna return some random colors. So we're gonna use color. Um, rgb Okay, double dot Random ain't range zero dark, dark dark dot Don't one today. So we're gonna get random color or rant between 0 to 1. Same for blue, and opacity is supplied. Tow us, right. That's a color taxation. And let's go ahead and create our timeline provider now, so I'm going to create a timeline provider. Ah, select, Sir. File quote. Time line provider. Okay. And, uh, guy import, we just kicked and import turkey. I we need something from there. Obstruct. Okay, How my provider But my prior like that and the format it. And next up, we're gonna create our entry entry is going to be a pipe quotes entry. So that's created quote entry and entry file is gonna be simple. Like, uh, like, other entry for house what you get and it's gonna be struck, pat line entry a little at a date. Date. Okay. And public, let vote quote. Okay, so go back. And, uh, quote entry gonna give it, uh, that. So that's our entry. Let's creator Snapshot and our timelines snapshot and snapshot is gonna have an entry date type. So it's telling me that there's something wrong with oh, quote. So we're going to see what it is. I'm gonna use one of the court today. God from the a p I and gonna baste it here. Okay. For our snapshot hand gonna call completion entry. And I have no idea why. Saying is the center type so skied a chain out. Okay, Then build that data's mountain scope. That's why import Bolland ation go back. And that should actually at least build. Okay, so, uh, that current date is our date That for fresh date is calendar current taught date by adding minutes to Well, you is gonna be 10 minutes. So we're going to refresh every 10 minutes to current date, Okay? And then we're going to simply say, court manager dot Get a quote and we get our quote here, okay? And we simply say guard, let Q is equal to quote. House return is nothing we can't do. Oh, you can actually write some default value if you like. Court entry data is gonna be current date and court is gonna make you a fine line timeline , and then you're gonna have your entries s. Your entry and policy is after a date, and that date is refreshed. Eight. Okay. And call your completion. Our timeline. Okay, so it's gotten build that Yes, we do need to call it return and build that one more time. And let's go ahead and create our widget now. Okay. So I gotta create you file, and we're gonna call this court, which now there's one thing you might wondering. How that is missing is the main. And that's where we can actually use our magic. It bundle. Okay, So you're just getting there as fast as we can, Okay? Instruct quotes, reject and, uh, by it. Let kind strain up to Stipe, okay? And then now can have our body. Once again, that's gonna be static configuration and kind. Taiwan providers are quote time client provide her its creator placeholder. You so create. - Okay , so that's gonna be her quote placeholder of you. And next stop is our tree. Okay, so let's create our interview now. An tribute is gonna be a cell. Except me, I template is this time and a quote entry. You okay? Interview is gonna be that simple. It's not gonna happen much of their time in Durham Aeltus preview. And then I'm gonna say this expects an entry, Okay? And, uh, next is are the stack. It's stakes color. Start random with capacities. Your 0.6. That's how you gonna use our random color. And here you're simply gonna show a text off our entry. Don't quote dot quote text, and I'm gonna put in a new line in a dash And our author name so entry dot quote dot court . Walter. Okay, not fault. That foreground color. It's gonna be right padding people patting as you think nor accept video. Okay. All right. So those are, Well, let's connect. Average it before we call it done. So we are simply going to say here that we need coat entry. Were you quote so entry. And for me, take this guy out. Okay? All right. Or Matt? Okay, So one thing we want two is fixed to center first, and then we doing a provide supportive family. So I want to say, supported family for this widget is gonna be system medium okay. And configuration, configuration option. And, uh, description. I'm gonna copy and paste. So we're gonna restrict the deeds to Okay. Basically, um, I'm not restricted. These 20 we're gonna say is like, you know, we're getting there's ghosts here. And some description as a border family is ah, system medium. And for the exchange rate, I'm going to copy these three things right here and gonna go to the midget and provide it's modifiers. Well, for system small. Okay. And, uh, okay, like, All right, So do if our reject there's one going to be small when one gonna be medium off size, family size. Okay, Now, the entry point. So how are we gonna create the entry point? So I left this file on purpose, Okay. And, uh, we can be did not create absolute can create if you like. Well, we don't need any of thes, so we're gonna removed everything from here and you simply say, struck extra. You can call it, like, you know, rigid family or something. Egypt family region. Um, tight. Um, let's call this the average family, which it bundle with a. So this is not the Vigee it. It's This one is called Widget bundle. And this one we're gonna decorate with May. And, uh, we're gonna create body, so it takes a body. Oh, and return some kind of rigid. And we have to attribute Dissed with with Bridget bundle builder. So this is gonna be of type Pichit visit bundle builder. Now, we're gonna use that exchange we get here. He had, uh, quote. We didn't just like that. So you got those stupid jets ready to go. And if we build and run, and if we haven't done something terribly wrong, hopefully it's gonna build, and it's going to show us two different midgets. Okay, so I'm gonna do is that's OK. So when I remove this old AB said for most all the bridges, there you go. So let's add in you, is it? I'm gonna click at multiple widgets and they go, So you have he have your exchange rate for we did that you created and he have your famous course. And if you notice that it only there are only two digits that you're providing right taken , let's say, add this one and, uh, just sad the other one, that's all. Petty and Egypt. And, uh, well, I have no idea why this must be the FBI issue. It is. Um, the intent was to show you how you can had Richard Bundle and even figure out the a P I related issue Iran. But but yeah, um, for our case thistles how you can actually create widget our family off agents with different variations. Now, if you had a case, I let me show you something really quickly. If you had a case where you said courts, which it supports, small and large. All right. In that case, what's gonna happen is you can see three visions. One is gonna be off type exchange Because you only support small family for that one and 2nd 1 Our other two are going to be off type quotes because we support to families for that . So let me do it again, or it wouldn't go car. It's not showing up me. All right? Now it is showing up. So that's a nice loaded. Now it's gonna show up. So as you can see, we have three budgets now, right to be have, uh, medium large in the swallow one off, different kind. Get. So that's how you create your reject family. Okay, so hopefully you found this video helpful. So thanks again for watching. And I will see you in another video, so thank you. 10. ExpenseWidgetUpdate: Hello and welcome back. And I just wanted to take and create, take a minute and create a new video on the recent update that came out for Xcode 12. So right now, or we are using Xcode Tuo beta six. So the widget that you must have created in that last video, Bell was in Xcode, beta three and beta for. So basically, those are no longer working. And the reason is that a lot of EBI changes that have happened recently, so I just wanted to provide a quick update on how to fix those issues. So let's go ahead and talk about those. Okay. So first of all, when you open if you open your expense, an expense video that we created. In the last video. If you open that, you can see this error right here says provider does not conform to intent timeline protocol. And the reason is, if you look at the definition for the intent timeline, you're going to notice there is an introduction to a new type alias. Alright. It did not, it did not open that. Okay, there we go. So we have this new alias that actually, So earlier we are only taking an entry and now we are taking an intent health all. So that's another associated type that you have to provide. And basically it would that change your First of all, your budget is going to break because of that reason. The second reason is placeholder is now part of the provider timeline provider yourself. So you have to provide a place holder that does entity in your function names have been changed from just snapshot to get snapshot in get timeline. So those are a few of the changes. So let's go ahead and make those changes to make this widget working. So post for what we're gonna do is we're going to create public type alias for intent. And if eagerness say this is going to be real monthly expense intent. Okay? So that's the first change. Next change that we're gonna do is gonna be the snapshot. So this signature has not changed. So we can simply say gets snapshot and timeline and best shirt actually do it. Although we might have extra parameters are. Okay. So there are a few more changes. So let's go ahead and do this essay and get a snapshot. Okay? And we're going to move these guys into that until it. And you're gonna create a timeline. And we simply take our timeline provider and move into that term. Okay? And last, we're going to have a placeholder that we'd have to provide. So place holder can be same as your snapshot, so you simply need to return an entry. So we're going to return the entry like that, okay? And if you notice, so this is gone. But now we are getting this new era where configuration is not wild because configuration that has not passed as a parameter. So what we need to do is we simply need to say expense category dot o because this is just a place holder. So we can just say take the category as expense category down to o, what this placeholder, okay? And with that, if you build your share, at least see few of the errors go away. So let's go ahead and fix all the others. So, so now this is the main widget. And if you take a look, it has this content is not being recognized. And the reason is that this placeholder is no longer valid. So just remove that. Go ahead and build them in to see more errors if there are any. And we seem to be building fine, so hopefully deliver all the errors that we have so we can actually then go, so we have successfully built. And now you can actually just go ahead and run, see basically if it's working or not. And one of the things that are actually glad to note that the configuration issue that was introduced in beta for basically that was not displaying the configuration options when you long PEP, long hold on on your device. On your budget is now working. Okay. So that seems to be, they seem to be some issue with simulator. So let's go ahead and take a look. Device simulator. Alright, so simulator, sir. So this simulator is seems like, you know, it's trying to load, but it's not, it's not launching. So that could be another step, could be another issue with beta, of course. But there's not much you can do about it. Okay, so this change our destination. Hence, CFE can actually launch a different. So let's try this. Let's try to enlarge the app. And maybe that or change. Alright, so they're finally launching up. I guess one of the thing that in the meantime, I'll load should launch the app or the cumulative so automatically. But if in case you run into issue, the solution I found is like you select a different simulator and select the target app, target as, as your app rather than your wagered extension. That seems to have. Then the trick, although it is still slow. So I'm going to pause the video again, and I'm going to pause the recording and come back as soon as it's loaded. Okay. Alright, so the app is finally loaded ahead to kill the simulator one more time and launch. So okay, let's go home. And my only when the app is launched, I'm gonna press hold to launch the video gallery. So always click on plus. And this is basically our expense app. So let's take a look at expenses app. And we are only interested in the small widget. So there we go. We have had a bad. And now if you press and hold and edit widget, There you go. You see this screen. Alright? And it seems like configuration option is broken again. Okay. Alright, well, let's see. Hopefully it'll, it'll load. Alright, anyways, if it seems like it is, is a little bit tricky to get the beta working. Anyways, it was loading in one or the other, similar to that I had. So hopefully someday minor. Anyways, hotels, One more thing I want to show you. Although now I can't really show you because it's only, I mean, I can show you, but you're not gonna see much difference. So if you have two widgets of same size, you can take them and drop them on each other. That actually creates a stack. And now in the stack, you can basically scroll through. So this is actually our expense we did was a perfect example of a bad for that reason because it had a different kind of widgets that we couldn't actually chose. Okay? See if we can actually, okay, so right now it's actually selecting as now as you can see like you now to similar data. So going gas expands and water this taking as a, as a default expense. So we can take a look at which agentry placeholder entry that category. Ok, so let's go ahead and expense and change this to food. And let's go ahead and launch. So are technically or existing widget should be maintained. And we should get like, you know, a new widget lauded as soon as there's belt. So I'll, I'll let it compile. I wanna I wanna show you like, you know, how those stacks actually look like because they're pretty cool down. And it's actually one of the benefit that you gonna get, but it seems like it has changed a C. Alright, so there was another dos dot whole bunch of books. But I've noticed. But anyways, let's go ahead and add a new widget. And there we go. Now we have food. So now as you can see, we have a different categories. I'm going to add this into the stack. And now we can cycle through these. We can actually edit stack. And you can actually sort of enabled us smarter or date because already there. And then he simply swipe through them. And they got so yeah, those are, those are the stacks that he can create for yourself. The configuration, once again is not working. I'll try it again by killing the wrinkling there, the visit itself, the similar trips are off, but it seems like there's something broken in their current beta hats are ok. Anyways, now has the quick update to fix the build out. What are the changes that you need to do? And we're gonna see similar changes in other widgets as well. Okay, so, thank you so much for your time and I will see you again in another video. Thank you.