Тёмный

How to Build a Widget in Swift with WidgetKit 

Sean Allen
Подписаться 156 тыс.
Просмотров 63 тыс.
50% 1

Опубликовано:

 

5 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 62   
@seanallen
@seanallen 2 года назад
Use code PREVIEW to get 15% off the WidgetKit Course at seanallen.teachable.com
@okjosh
@okjosh 2 года назад
Hi Sean, I notice in your link you mention that updated courses for iOS 16 will be out soon. For someone who just started learning, would you suggest waiting until those updates are live before investing the time to take your course? Or are there just minor changes from iOS15 -> 16 that the courses will be pretty much the same?
@dre5671
@dre5671 2 года назад
Oh man! This preview is enticing me to get the course! I'm trying to hold off until I finish a project, But wanted you to know that this preview was a great idea! Thanks for giving us this handy knowledge Sean! So glad you're back at it with the videos!
@seanallen
@seanallen 2 года назад
Thanks! Hope you enjoy this course. It was a lot of fun to make!
@naeem3dful
@naeem3dful Год назад
Thank you Sean Allen for this easy and clear and simple view for Widget
@elemento_arts
@elemento_arts Год назад
Great vid! although dates are tricky and probably overcomplicates things while learning Widgets. Simply Data, that's all we want for now 😅
@apbrandom
@apbrandom 8 месяцев назад
Great tutorial! Thank you very much, especially for copying and pasting it🔥
@seanallen
@seanallen 8 месяцев назад
Glad you liked it and happy to help :)
@FloWritesCode
@FloWritesCode 2 года назад
Great overview, Sean! I find your MonthConfig approach very interesting, personally I think I would have tried to solve that with an enum.
@robinandthedog
@robinandthedog Год назад
haha I got you typing capitals, just type vstack and it will complete to VStack, great tutorial by the way, I've build many widgets already, but still struggle to get a perfect adaptive design, the widgets differ so much in size over iPhone/iPad models, even using geometry reader...
@nykse
@nykse Год назад
I made a counter app where the user can track anything they want to quit, such as smoking. What I want is, when the user starts the tracking process, they can see the progress on the home screen with a home widget. I can calculate the date difference, and there is no problem with that. However, I want to calculate the date difference every hour and refresh the home widget every hour. How can I do that?
@ammarahmad9004
@ammarahmad9004 2 года назад
Your reaction about how -3 works on code made me laugh, but it's still a good video about WidgetKit, thanks.
@seanallen
@seanallen 2 года назад
Glad you enjoyed it, Ammar!
@nuriddinburkhonov5214
@nuriddinburkhonov5214 Год назад
Thank you, very educational!
@martinpihooja7536
@martinpihooja7536 Год назад
0:42:25 There are two possibilities to change the file name. First and fastest, slow double click the file name and change it. Second option, look at the right, Inspectors view -> Identity and Type -> Name. Great tutorial and nice explanations.
@PavanKumar-i8v4x
@PavanKumar-i8v4x 8 месяцев назад
@seanallen . Please make one video about the interactive widget
@sebasy10
@sebasy10 5 месяцев назад
If i have an api in my app folder.. how i can call the data? Is there any video to learn? Thank you, u are the best!
@mikeshafer
@mikeshafer 8 месяцев назад
I just tried to follow your example but right in the beginning with the gradient, it doesn't fill the entire widget but just a square. How do I get this to fill the whole widget in iOS 17.2? I just signed up for the course, perhaps it covers that part. I definitely want to learn how to get dynamic data from a JSON endpoint.
@seanallen
@seanallen 8 месяцев назад
Hey Mike, yes, this is covered in the course. iOS 17 introduced something called "contentMargins" that is causing that. We address this in the iOS 17 update section of each widget. (It's a pretty simple fix).
@tinypixel_
@tinypixel_ 2 месяца назад
Faced the same issue. In the MonthlyWidget section add `contentMarginsDisabled` at the end. That should fix it. .configurationDisplayName("My Widget") .description("This is an example widget.") .contentMarginsDisabled()
@garylow-sy7pc
@garylow-sy7pc Год назад
0:47:52 You went to September because -3 means to go back 3 months from December, as 0 represents December last year. Since 12 - 3 = 9, the calculation gave you a date in September last year
@seanallen
@seanallen Год назад
Good to know. Thanks for pointing that out!
@AlanJoseph-q7n
@AlanJoseph-q7n 3 месяца назад
Amazing! I was having a hard time getting the initial colors you paste. the ones that were blocks in 'Color(*)'. Is there an easy way to get the desired colors other than the Xcode color library? Thanks again!!
@gauthamvijayan
@gauthamvijayan 17 дней назад
Core concepts start at 12:20
@ЕгорБаранов-ы6ш
Great tutorial, thanks a lot!
@seanallen
@seanallen Год назад
Glad you liked it, Erop!
@kalinbalabanov1013
@kalinbalabanov1013 2 года назад
Really great stuff 🎉
@seanallen
@seanallen 2 года назад
Glad you enjoyed it, Kalin!
@_Astr_
@_Astr_ 2 года назад
I have Xcode 12.5. Do I need Xcode 13+ for this course?
@seanallen
@seanallen 2 года назад
I believe Xcode 12.5 will be enough. Widgets were introduced in Xcode 12.
@ArjunSingh-td5gw
@ArjunSingh-td5gw Год назад
The best video !!
@seanallen
@seanallen Год назад
Thanks Arjun!
@arnoczkyzoltan6158
@arnoczkyzoltan6158 Год назад
Thank You!
@jawwaadsabree5573
@jawwaadsabree5573 2 года назад
Are you working on a video for dynamic Island and live activities?
@seanallen
@seanallen 2 года назад
Yes. That will release when they are officially launched in a later update to iOS 16 (likely in October). They are still in beta at the moment.
@alphonsosensleyii7630
@alphonsosensleyii7630 Год назад
Thanks!
@seanallen
@seanallen Год назад
Thanks for the support, Alphonso! I appreciate it 😀
@ulludots
@ulludots Год назад
I love the video but I met a problem where your code Text(entry.date.formatted(.dateTime.weekday())) does not exist. I am using Xcode 12.4 so please help me
@ShredzZ
@ShredzZ 2 года назад
Hi, do you think iOS development is good path for full time freelancing? Lot of ppl saying best choice is web dev but I'm really enjoying swift. How is the job market?
@seanallen
@seanallen 2 года назад
There are way more web dev jobs in the world than iOS dev. But... there are still plenty of iOS dev jobs and if that's what you enjoy, that's what I'd do.
@ilouran
@ilouran Год назад
do you know how to prevent opening app from widget ? I just wanna use backgorund callback, pls tell me if you have any idea
@lumaa_dev
@lumaa_dev 2 года назад
I didn’t remember it was that easy
@seanallen
@seanallen 2 года назад
Keep in mind, that was the most basic example. They can get quite complex.
@gn0987123
@gn0987123 Год назад
How can i add custom button "action" on Widget ? 🧐
@glebdolskiy
@glebdolskiy Год назад
first tutorial which I saw a long intro 0_o
@paolooo15
@paolooo15 2 года назад
Do you have IOS courses for beginners ?
@seanallen
@seanallen 2 года назад
Yup, you can find it at seanallen.teachable.com. I have one called iOS Dev Launchpad and another called SwiftUI Fundamentals.
@paolooo15
@paolooo15 2 года назад
@@seanallen awesome I’m looking to start my journey for iOS dev ! Appreciate it !
@seanallen
@seanallen 2 года назад
No problem. Happy to answer any questions you have about the courses!
@rizwansayyed5043
@rizwansayyed5043 Год назад
Hey can please HELP MEE!!!!! I want to create a lock screen widget and i create it. But i just need one additional thing i want that when clicked on widget the widget should not open the app (Which it is opening). It should run certain that like making a call to the api. Can please any one help me how i can achieve this task i have searched all over the internet but didn't found any solution. PLEASE HELP MEE!!!!!
@tomlangendijk
@tomlangendijk 9 месяцев назад
Can you create a widget carrying data from an app or site that is not yours?
@seanallen
@seanallen 9 месяцев назад
Yes. If that app/site has an API you can make a network call to fetch the data and show it in your widget.
@muhammednadeem6339
@muhammednadeem6339 Год назад
Hi Sean, can we make the Widget translucent. I saw this implementated for whatspp medium size widgets
@seanallen
@seanallen Год назад
I've never done it, but I know it's possible. It has to do with pulling a screenshot of their wallpaper and matching the pixel area to be the background of the widget giving the illusion of transparency. I'm pretty sure that's how it's done, but like I said I've never done it.
@siempay
@siempay 2 года назад
You know its an INTRO when its 50 min long, thnks
@seanallen
@seanallen 2 года назад
And this is only the small first section of a MUCH more in depth course 😀
@brudamonas8208
@brudamonas8208 2 года назад
@@seanallen thanks for putting some of it for free
@seanallen
@seanallen 2 года назад
No problem 😀
@md.tipusultan9629
@md.tipusultan9629 Год назад
Please help! How to add gif on a widget?
@JakeMarsh
@JakeMarsh 2 года назад
Thanks!
@seanallen
@seanallen 2 года назад
I appreciate the support, Jake! Hope you enjoy 😀
Далее
New Way to Format Dates in Swift (5.5)
6:24
Просмотров 15 тыс.
WWDC23: Design dynamic Live Activities  | Apple
15:00
Просмотров 418 тыс.
Swift Closures Explained
14:23
Просмотров 65 тыс.
42 iPhone Widgets You'll Love
13:15
Просмотров 247 тыс.
Expert Advice to Learn iOS Dev & Swift FAST
1:04:52
Просмотров 39 тыс.
SwiftUI List with Custom Cell & Passing Data
36:27
Просмотров 117 тыс.
31 Xcode Tips & Tricks - 2023
17:45
Просмотров 41 тыс.
SwiftUI Drag and Drop with Transferable Custom Object
26:33
Write Better Code with Swift Algorithms
34:34
Просмотров 32 тыс.
How to Get User Location on a Map - Swift
26:11
Просмотров 64 тыс.