Defer in Swift explained
3:15
Ай бұрын
Using Closures as Dependencies
15:18
What's new in Swift 5.10
5:09
4 ай бұрын
SwiftData live stream June 6th, 2023
1:17:33
WWDC Watch Party - Advanced Combine
24:35
Пікірлер
@gerardgomez5987
@gerardgomez5987 6 күн бұрын
Is there currently a way in iOS 18 to hide TabSection headers in the TabBar view while keeping them visible in the Sidebar view and, importantly, while still showing the tabs themselves in the TabBar.
@gerardgomez5987
@gerardgomez5987 5 күн бұрын
Never mind, I was able to use isTabBarShowingSections Environment Value. although I would much appreciate a tabSectionHeaderVisibility(.sidebar) modifier instead of using a if statement.
@gerardgomez5987
@gerardgomez5987 5 күн бұрын
That did not work
@ivanmatkovic
@ivanmatkovic 6 күн бұрын
When viewModel is @Observable, you dont need @State in the View. Great video btw
@DonnyWalsdev
@DonnyWalsdev 3 күн бұрын
You do if that view creates/owns the state. Otherwise every time a new struct instance is made a new instance of the Observable is made.
@marksiracusano9931
@marksiracusano9931 7 күн бұрын
How would you handle the path if you have a tabView with different navigations for each tab? I guess every tab would have a a NavigationStack with their own path, right? If so, what if you need new paths further down those flows? Like a child coordinator situation? Should you nest NavigationStacks?
@PtolemysEye
@PtolemysEye 5 күн бұрын
Each tab view should have it's own navigation stack
@DonnyWalsdev
@DonnyWalsdev 3 күн бұрын
You’d have a dedicated path for each tab. Not sure what you mean by needing new paths later on. You shouldn’t nest navigation stacks, flows later on should use the same path that the stack that contains them would use. Of course, sheets can have their own navigation stacks if needed; you just shouldn’t nest them
@hami1705
@hami1705 10 күн бұрын
post more videos like this
@indomitabletr1834
@indomitabletr1834 13 күн бұрын
how would it be if I was in iOS 14
@DonnyWalsdev
@DonnyWalsdev 9 күн бұрын
A lot less convenient!
@indp8752
@indp8752 13 күн бұрын
When you add an Exercise to path, how does it know that it has to show the Exercise view ?
@DonnyWalsdev
@DonnyWalsdev 9 күн бұрын
Through the navigationDestination view modifier that I applied to one of the parent views
@enriqueduran6548
@enriqueduran6548 16 күн бұрын
EXCELENT
@indiekiduk
@indiekiduk 17 күн бұрын
It’s strange that navigationDestination doesn’t go through the PreferenceKey’s reducer like navigationTitle does which is how it can be overridden without a warning. Maybe was implemented by a different dev at Apple.
@MarcosSuarezAyala
@MarcosSuarezAyala 17 күн бұрын
Thanks for the video, I have a question with the implementation of navigation with the NavigationStack. How do I control the navigation? In the case that I only want to navigate when I have received an OK response from the API, if the response has given me an error, I do not perform the navigation and show a pop up. How is this implemented with the NavigationStack?
@fitzventure
@fitzventure 16 күн бұрын
This is the one use case nobody covers in any tutorials. I know because I just struggled to figure it out. Say you have a view that displays on initial open of the app, it checks if the user is logged in and navigates to a login page if not. How do you handle that? I turns out , you use a single navigation destination modifier on the root nav stack and a case statement inside that destination checks the path (which you can use and enum for). Think of the navigation destination as a controller for navigation. This would make a great video because it's so common but there's nothing out there explaining it. Hope that helps.
@MarcosSuarezAyala
@MarcosSuarezAyala 16 күн бұрын
@@fitzventure Thanks. Now I'm using HomeRoute with enums and special func loadData, I don't like this approach but it's the only thing I can think of for now. @MainActor func loadData(for route: MoviesRouter) async throws { switch route { case .detail(let movie): do { try await Task.sleep(nanoseconds: 5_000_000_000) throw(NSError(domain: "error", code: 1)) // To test error moviesRouter.append(.detail(movie)) } catch { throw(error) } } } And call it in button inside the view Button("Go to a random Movie") { guard !viewModel.list.isEmpty, let randomMovie = viewModel.list.randomElement() else { return } showLoader.toggle() Task { do { try await homeRouter.loadData(for: .detail(randomMovie)) showLoader = false } catch { showLoader = false showError = true } } } .buttonStyle(.borderedProminent)
@benceylan273
@benceylan273 20 күн бұрын
Background music was distracting sorry.
@Zetesee
@Zetesee 20 күн бұрын
Hey Donny - I'm not sure if thats your name if not sorry for that. I hope this message finds you well! 🙂 I recently discovered your KZfaq channel while scrolling homepage and found your content to be amazing and incredibly helpful. I have a cooperation proposal for you and would love to discuss it further. It could improve your channel. Please let me know if you're interested! Email address will be great :D
@tsbob7847
@tsbob7847 23 күн бұрын
Thanks for the video. I’m new to iOS programming. ForEach wants an ordered collection so the set has to be sorted. A number of other SwiftUI things seem to be oriented around arrays. Is this the case in general for SwiftUI? Set Vs Array is insignificant in my small app but curious about SwiftUI Vs data efficiency. Does @Observable mean no longer sorting for every screen update, only if the set changes? Is there a good article on this? Thanks again.
@DonnyWalsdev
@DonnyWalsdev 23 күн бұрын
I’d say most UI related collection work should be done with array since you don’t want things jumping around in your UI due to Set being unsorted. I don’t know of an article covering the specifics here but @Observable would mean that your UI is stable until the next screen redraw and the Set is accessed again. I would recommend converting to an Array so you have guaranteed stable ordering.
@tsbob7847
@tsbob7847 22 күн бұрын
@@DonnyWalsdev Thanks for the response. Obvious from the UI perspective - head slap. Arrays planned for “normal usage” views of item subsets but no fundamental order to the underlying items themselves so I’m starting with a set and a “management/debug” view. Lots to learn. Very different perspective from real time microcontroller systems but I’m enjoying it. I appreciate the info people like yourself, Paul Hudson, Stewart Lynch and others make freely available. They are great learning tools and benefit so many.
@chezchezchezchez
@chezchezchezchez 24 күн бұрын
I have drums in my computer room! HAHA
@xzilja
@xzilja 24 күн бұрын
Hard to tell from the video, but did you by any chance notice a bit "out of sync" in scrolling and transitioning when using this modifier? I just did simple recreation with it and GeometryReader and it seems as if geometry reader is more accurate "reactive". Particularly when scrolling super slow
@DonnyWalsdev
@DonnyWalsdev 24 күн бұрын
I didn't notice any, but I also have to admit I didn't compare and do super slow scrolls so you might be right. Wonder about the overall performance difference though; GeometryReader in general is very slow. It'd be interesting to compare performance on increasingly large and complex views to see if one breaks down where the other doesn't
@user-jj2jf7hf5q
@user-jj2jf7hf5q 25 күн бұрын
Kudos to the author. First time I hear simple and elaborated explanation about threads which will be used to run task or specific method.
@DonnyWalsdev
@DonnyWalsdev 24 күн бұрын
Thank you!
@edhahaz
@edhahaz 26 күн бұрын
3 UIs into one lol... flutter devs screaming rn
@smotch7533
@smotch7533 28 күн бұрын
if I choose regular does it match all devices larger than iPad, TV or Vision Pro for example
@DonnyWalsdev
@DonnyWalsdev 28 күн бұрын
Yes, those should all be regular too. Good to know is that macOS is always regular regardless of your window’s size
@smotch7533
@smotch7533 27 күн бұрын
@@DonnyWalsdev oh interesting!
@TwinkyEnterainment
@TwinkyEnterainment 29 күн бұрын
Might need to send this to one of the speakers at iOSKonf in Skopje about the scrollView problem :D. Great work as always Donny!
@w0mblemania
@w0mblemania 29 күн бұрын
Donny, at the beginning of the video, the list of items is overlapping the header in a nasty way. This may be because you have set a fixed height for the rectangle (300 pts). So the image height is being adjusted dynamically, but the rectangle is not. Cheers.
@DonnyWalsdev
@DonnyWalsdev 29 күн бұрын
Do you mean there’s a glitch while I’m messing around with scrolling in the beginning? Not sure why that happened. Changing the rectangles height causes the entire scroll view to glitch unfortunately; otherwise the header image could have been in the scroll view and we wouldn’t have needed the ZStack at all.
@jrgibson
@jrgibson 19 күн бұрын
@@DonnyWalsdev I noticed that glitch happens with my app in 18 too, I raised feedback for it.
@tokero5199
@tokero5199 29 күн бұрын
Cool. Now we just have to way a few years to be able to use it because Apple does not want to backport UI like Android has AndroidX....
@iLoveAppl3947
@iLoveAppl3947 29 күн бұрын
jizz man...WWDC24 is not finished yet and fanboys already making videos...chill
@DonnyWalsdev
@DonnyWalsdev 29 күн бұрын
Why wouldn’t I make a quick video about a view modifier I like?
@slmille4
@slmille4 29 күн бұрын
I'm really curious whether App Intents will expand beyond just being voice activated shortcuts to making it possible to quickly surface relevant information out of 3rd party apps.
@chezchezchezchez
@chezchezchezchez Ай бұрын
This is great. Thanks, Donnie.
@nigelgee3576
@nigelgee3576 Ай бұрын
Can you have a ‘var’ then able to change the value again?
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
Yes, you absolutely can
@MarijaJuodyte
@MarijaJuodyte Ай бұрын
Thank you!
@ashleydube3710
@ashleydube3710 Ай бұрын
Thanx
@indiekiduk
@indiekiduk Ай бұрын
Hopefully this is the nail in coffin for view models and everyone finally learns structs!
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
I doubt it. SwiftUI and @Observable very strongly rely on (view)models being defined as classes
@indiekiduk
@indiekiduk Ай бұрын
@@DonnyWalsdev view models are view structs. @ observable is for model data
@BookmarkMountain
@BookmarkMountain Ай бұрын
Really well explained thank you!
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
Thanks for watching!!
@wjcnwjcn
@wjcnwjcn Ай бұрын
What about this? kzfaq.info/get/bejne/lb6Ke92dmLiVdqM.html
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
What about it? Is there something specific from that video you think I should look at?
@nicolaiharbo2201
@nicolaiharbo2201 Ай бұрын
I’ve been aware of the feature for a long time, but never found a reason to use it honestly. Always thought of it, as a bit useless. Is it something you use often, and if yes, for what? Like, very specific use cases would be appreciated 😊
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
I don't use it often. Mostly for stuff like in the example from the video where there might be multiple exit points for the function and I always need to unset/restore some state. It's useful for that, but not something I use very often
@markaurelius61
@markaurelius61 Ай бұрын
It would be to close a connection to a database, for example. Many of the things that would have been useful for though are handled by ARC.
@toddlask
@toddlask Ай бұрын
your videos are beyond my noobie level but really interesting!
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
Thanks! Are there any topics that you're currently learning about or interested in that I could cover?
@toddlask
@toddlask Ай бұрын
@@DonnyWalsdev hey thx for asking! im kinda interested in the life cycle and object structure of a running app. like the dom in the old internet explorer. im an older programmer and want to understand the modern new ways of swift. im very curious how the app sees the environment variables and settings, other views and classes... i hope this makes sense.
@victorriurean
@victorriurean Ай бұрын
👍
@alexandr8328
@alexandr8328 2 ай бұрын
Hello! When is your Swift Concurrency course released? It says it is still in progress. Thx
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
Hey! The course should be finished in the next week or two. Plan was to have it fully done this week but I'm currently at a conference so that seems a little too ambitious. Almost all sections are finished except for the final one on TaskGroup and async let.
@nigelgee3576
@nigelgee3576 2 ай бұрын
I know that you are using person name as an example code. But it should said that when dealing with with names that should use PersonNameComponentsFormatter as this will put the correct format for user locale
@srzurka
@srzurka 2 ай бұрын
Thanks for the video. I concur. I would only add that, computed properties feel Swifty to me so I start with a bias towards using them, then change to a function when there's one of the situations that you've identified. (needs arguments, it's not lightweight, potential side-effects, etc)
@user-qg8nc5bk4p
@user-qg8nc5bk4p 2 ай бұрын
Sound became better :) Could you please share your thoughts on usage of extensions, e.g. extending models with some methods, formatting methods etc. When an object that does something is better than extension of some model that handles the model certain way and returns the data I need, the only think that comes to my mind is inability to use DI in extension, so testability is limited for these functionality
@DonnyWalsdev
@DonnyWalsdev Ай бұрын
I've added it to my (long) list of potential topics!
@tiagoalexbastos
@tiagoalexbastos 2 ай бұрын
your videos are so good man, top tier content! Keep it up :)
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
Thanks!!!
@nigelgee3576
@nigelgee3576 2 ай бұрын
Nice generator. I have already added it to my new project so I do not forget it. Is it required for TestFlight?
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
Not required for TestFlight but I’d recommend just adding it anyway :)
@venuvenu2719
@venuvenu2719 2 ай бұрын
Awesome, Is the required reasons API, the only thing that needs to be added? What about privacy nutrition labels? Let's say, my app uses email id info and Username. What do I do here?
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
You should be adding them all. However, Apple will only reject you for not declaring required reason APIs.
@jairoalexanderlaurenteceli9966
@jairoalexanderlaurenteceli9966 2 ай бұрын
Excelente video, muchas gracias por compartir información valiosa!!✌✌
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
¡Gracias! Me alegro que te guste el vídeo
@victorriurean
@victorriurean 2 ай бұрын
🔥
@filmaniac1984
@filmaniac1984 2 ай бұрын
Thanks @DonnyWalsdev! Great example and well explained.
@roym27
@roym27 2 ай бұрын
I had to stop watching because of the background music - it’s not great when you’re narrating as I was unable to focus on what you were saying.
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
I'll probably do a re-record of this video at some point without the bg music. It's a shame that it's not possible to "update" a video without a full reupload
@srinivasanmunna
@srinivasanmunna 2 ай бұрын
This is a great one. I was actually expecting to see another dictionary variable that keeps track of running tasks. But the enum with associated type looks so much better.
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
Thanks!
@JumpingCow
@JumpingCow 2 ай бұрын
Subtle and complex! Thank you.
@0xifarouk
@0xifarouk 2 ай бұрын
This is amazing, thank you for the explanation 🙏🏻 Can we have a video on task cancellation please?
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
Noted!
@bobdel
@bobdel 2 ай бұрын
This video is very helpful. I am still confused by the body property. As I understand it, Body is annotated via a protocol to run on MainActor. Is this correct: a view such as the one in your example that does not have a @MainActor annotation, but the function is called from a task modifier inside the Body will run on the MainActor.
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
It's the opposite, unless the function definition itself has a @Mainactor annotation (or in other words, is isolated to the main actor) it doesn't matter where you call it from. The function itself decides where it runs and if it's not isolated to the main actor explicitly it will run in the background even if it was called from a main actor isolated spot
@muncho404
@muncho404 3 ай бұрын
the title was enough to trigger my anxiety😅
@jyotinkarpandey
@jyotinkarpandey 3 ай бұрын
Can we have a sample project link ?
@DonnyWalsdev
@DonnyWalsdev 2 ай бұрын
Hey! So sorry, I don't have a (publicly available) sample project available for this.
@victorriurean
@victorriurean 3 ай бұрын