How to Build a Widget in Swift with WidgetKit

  Рет қаралды 67,070

Sean Allen

Sean Allen

Күн бұрын

Пікірлер: 64
@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?
@gauthamvijayan
@gauthamvijayan 2 ай бұрын
Core concepts start at 12:20
@Elvis-is-king-l3s
@Elvis-is-king-l3s Ай бұрын
Clear and consice explanation. Should definitely have watched this before coding my first line!
@naeem3dful
@naeem3dful Жыл бұрын
Thank you Sean Allen for this easy and clear and simple view for Widget
@apbrandom
@apbrandom 10 ай бұрын
Great tutorial! Thank you very much, especially for copying and pasting it🔥
@seanallen
@seanallen 10 ай бұрын
Glad you liked it and happy to help :)
@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!
@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.
@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?
@JakeMarsh
@JakeMarsh 2 жыл бұрын
Thanks!
@seanallen
@seanallen 2 жыл бұрын
I appreciate the support, Jake! Hope you enjoy 😀
@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.
@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 😅
@nuriddinburkhonov5214
@nuriddinburkhonov5214 Жыл бұрын
Thank you, very educational!
@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!
@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...
@PavanKumar-i8v4x
@PavanKumar-i8v4x 10 ай бұрын
@seanallen . Please make one video about the interactive widget
@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!
@mikeshafer
@mikeshafer 10 ай бұрын
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 10 ай бұрын
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_ 4 ай бұрын
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()
@sebasy10
@sebasy10 7 ай бұрын
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!
@ЕгорБаранов-ы6ш
@ЕгорБаранов-ы6ш 2 жыл бұрын
Great tutorial, thanks a lot!
@seanallen
@seanallen 2 жыл бұрын
Glad you liked it, Erop!
@AlanJoseph-q7n
@AlanJoseph-q7n 5 ай бұрын
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!!
@_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.
@kalinbalabanov1013
@kalinbalabanov1013 2 жыл бұрын
Really great stuff 🎉
@seanallen
@seanallen 2 жыл бұрын
Glad you enjoyed it, Kalin!
@ArjunSingh-td5gw
@ArjunSingh-td5gw Жыл бұрын
The best video !!
@seanallen
@seanallen Жыл бұрын
Thanks Arjun!
@gn0987123
@gn0987123 Жыл бұрын
How can i add custom button "action" on Widget ? 🧐
@ilouran
@ilouran 2 жыл бұрын
do you know how to prevent opening app from widget ? I just wanna use backgorund callback, pls tell me if you have any idea
@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
@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.
@tomlangendijk
@tomlangendijk 11 ай бұрын
Can you create a widget carrying data from an app or site that is not yours?
@seanallen
@seanallen 11 ай бұрын
Yes. If that app/site has an API you can make a network call to fetch the data and show it in your widget.
@arnoczkyzoltan6158
@arnoczkyzoltan6158 Жыл бұрын
Thank You!
@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!
@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.
@md.tipusultan9629
@md.tipusultan9629 2 жыл бұрын
Please help! How to add gif on a widget?
@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.
@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.
@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!!!!!
@glebdolskiy
@glebdolskiy Жыл бұрын
first tutorial which I saw a long intro 0_o
@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 😀
@alphonsosensleyii7630
@alphonsosensleyii7630 Жыл бұрын
Thanks!
@seanallen
@seanallen Жыл бұрын
Thanks for the support, Alphonso! I appreciate it 😀
@mroz
@mroz Ай бұрын
Thanks!
New Way to Format Dates in Swift (5.5)
6:24
Sean Allen
Рет қаралды 15 М.
Swift Closures Explained
14:23
Sean Allen
Рет қаралды 68 М.
Farmer narrowly escapes tiger attack
00:20
CTV News
Рет қаралды 13 МЛН
小路飞和小丑也太帅了#家庭#搞笑 #funny #小丑 #cosplay
00:13
家庭搞笑日记
Рет қаралды 14 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 18 МЛН
SwiftUI Bar Chart with Customizations | Swift Charts
21:26
Sean Allen
Рет қаралды 27 М.
Expert Advice to Learn iOS Dev & Swift FAST
1:04:52
Sean Allen
Рет қаралды 40 М.
Configurable Widgets with AppIntents
10:50
Flo writes Code
Рет қаралды 8 М.
How to Create an Onboarding Screen in SwiftUI
20:36
A Swiftly Tilting Planet
Рет қаралды 1,3 М.
Write Better Code with Swift Algorithms
34:34
Paul Hudson
Рет қаралды 32 М.
I Made an iOS App in MINUTES with This AI Tool!
13:20
Creator Magic
Рет қаралды 358 М.
The Secret Science of Perfect Spacing
9:40
Chainlift
Рет қаралды 464 М.
Hacking a Game From 2000 To Run On Windows 11
16:22
Nathan Baggs
Рет қаралды 72 М.
SwiftUI Card View - Group Box & Customizations
10:21
Sean Allen
Рет қаралды 18 М.
Making iPhone16 pink📱
0:34
Juno Craft 주노 크래프트
Рет қаралды 31 МЛН
СДЕЛАЙ ТАК . Пульт будет работать вечно
9:39
Мужские интересы 79
Рет қаралды 432 М.
😱Кастомный Айфон 16 R🤯
0:39
Не шарю!
Рет қаралды 770 М.