![donny wals](/img/default-banner.jpg)
- Видео 30
- Просмотров 33 941
donny wals
Добавлен 19 фев 2009
Programmatic Navigation in SwiftUI explained
In this video we take a look at how you can leverage SwiftUI's NavigationStack, NavigationPath and navigationDestination to build an app that can leverage programmatic navigation.
This video is a companion video for www.donnywals.com/programmatic-navigation-in-swiftui-with-navigationpath-and-navigationdestination/
Level up your Swift Concurrency skills with my concurrency course: donnyplus.com/p/practical-swift-concurrency-the-video-course
This video is a companion video for www.donnywals.com/programmatic-navigation-in-swiftui-with-navigationpath-and-navigationdestination/
Level up your Swift Concurrency skills with my concurrency course: donnyplus.com/p/practical-swift-concurrency-the-video-course
Просмотров: 1 909
Видео
How to decide between a Set and an Array in Swift?
Просмотров 27621 день назад
Learn how you can decide between a Set and an Array in Swift. We go over their semantics as well as their core performance characteristics. Level up your Swift Concurrency skills with my video course: donnyplus.com/p/practical-swift-concurrency-the-video-course This video is a companion for my blog post about the same topic: www.donnywals.com/how-to-decide-between-a-set-and-array-in-swift/
Let's build an app with iOS 18's new sidebar!
Просмотров 1,1 тыс.21 день назад
In this video I explore iOS 18's new sidebar and tab bar hybrid by building a tab bar that works well on both iPhones, iPads, and iPads in split-view mode too. I'm using Xcode 16's beta to explore this upcoming feature. We'll leverage size classes and SwiftUI's environment to support smaller screens as well as the iPad's larger screen.
Build a stretchy header with SwiftUI on iOS 18
Просмотров 1,3 тыс.21 день назад
Let's take a look at SwiftUI's new onScrollGeometryChange view modifier to create a stretchy header effect with little to no workarounds!
WWDC 2024 recap - Apple Intelligence and more
Просмотров 37121 день назад
Apple's WWDC 2024 event happened yesterday and the Keynote was packed with amazing features. In this video I share a developer's perspective on the Keynote and everything that was announced. From visionOS, iOS, iPadOS, macOS and watchOS all the way to Apple's new intelligence features that will release later this fall.
Swift’s “if” and “switch” expressions explained
Просмотров 23528 дней назад
In this video we dig into if and switch expressions in Swift. They make conditionally assigning properties in Swift much cleaner than before! This post is a companion for my blog post on the same topic: www.donnywals.com/swifts-if-and-switch-expressions-explained/ Improve your Swift Concurrency skills with my video course: donnyplus.com/p/practical-swift-concurrency-the-video-course
@preconcurrency usage in swift explained
Просмотров 454Месяц назад
In this video we'll look at how you can start migrating to strict concurrency checking and Swift 6 gradually. We'll go over importing modules that haven't been updated to strict concurrency as well as updating modules to use strict concurrency without having to ship breaking changes as a library author. Learn more about concurrency in Swift with my course: donnyplus.com/p/practical-swift-concur...
Defer in Swift explained
Просмотров 408Месяц назад
Learn everything you need to know about Swift's defer keyword in this short video. This video is a companion for this blog post: www.donnywals.com/what-is-defer-in-swift/
Deciding between a computed property and a function in Swift
Просмотров 5482 месяца назад
In this video we explore Swift's computed properties and I talk about the different things I consider when deciding which type of property I should use. This video is a companion video for: www.donnywals.com/deciding-between-a-computed-property-and-a-function-in-swift/ Level up your Swift Concurrency skills with my course: donnyplus.com/p/practical-swift-concurrency-the-video-course
Avoid App Store Rejection! Add a Privacy manifest to your app today
Просмотров 8212 месяца назад
Learn how you can add a privacy manifest file to your Xcode project to make sure that you comply with Apple's newly introduced Required Reason API Declaration requirements. Avoid Missing API Declaration (ITMS-91053) rejections and add your manifest today. In this video you'll learn how you can create a privacy manifest file in Xcode and how you can use www.privacymanifest.dev to generate your m...
How to use experimental Swift versions and features in Xcode?
Просмотров 2562 месяца назад
In this video we'll dig into how you can leverage experimental toolchains and feature flags to test new Swift versions before they're released. Watch me download a new toolchain, install it, enable it in Xcode, and then I actually add a feature flag to test our region based actor isolation. Level up your Swift concurrency skills with my course: donny-wals-s-school.teachable.com/p/practical-swif...
Actor Reentrancy in Swift explained
Просмотров 1,1 тыс.2 месяца назад
In this video we'll explore a complicated topic called actor reentrancy. You'll find out why adding async methods to your actors can yield unexpected and undesired results. You'll also learn about one possible way to solve a specific form of actor reentrancy that leverages caching unstructured Tasks. This video is a companion for my blog post on the same topic: www.donnywals.com/actor-reentranc...
Using Closures as Dependencies
Просмотров 1,1 тыс.3 месяца назад
In this video we'll explore an alternative way of injecting functionality into your objects. You'll see how you can use closures to inject only the functionality you really need rather than an entire object which makes scoping your dependencies much easier, as well as improving composability and testability of your code. This video is a companion video for the following blog post: www.donnywals...
Building an AsyncSequence with AsyncStream.makeStream
Просмотров 4503 месяца назад
In this video you'll learn how to use Swift 5.9's AsyncStream.makeStream method to build custom async sequences. You'll learn about its usage as well as its caveats. This video is a companion for this blog post: www.donnywals.com/building-an-asyncsequence-with-asyncstream-makestream/ Other blog posts worth reading: - Understanding Swift Concurrency's AsyncStream: www.donnywals.com/understanding...
Five tips and tricks for exploring a new codebase
Просмотров 3203 месяца назад
In this video we take a look at some of the most important tips and tricks that I have learned about exploring codebases in practice. Does it make sense to jump in without a plan? You'll learn everything you need to know in this video. Level up your Swift concurrency skills with my course: donny-wals-s-school.teachable.com/p/practical-swift-concurrency-the-video-course Or check out my books: do...
Working with dates and Codable in Swift
Просмотров 4193 месяца назад
Working with dates and Codable in Swift
Customizing how Codable objects map to JSON data
Просмотров 4783 месяца назад
Customizing how Codable objects map to JSON data
An introduction to JSON Parsing in Swift
Просмотров 6854 месяца назад
An introduction to JSON Parsing in Swift
Comparing @Observable to ObservableObjects in SwiftUI
Просмотров 1,2 тыс.4 месяца назад
Comparing @Observable to ObservableObjects in SwiftUI
Designing APIs with typed throws in Swift
Просмотров 7294 месяца назад
Designing APIs with typed throws in Swift
How to determine where code runs in Swift Concurrency
Просмотров 2,2 тыс.4 месяца назад
How to determine where code runs in Swift Concurrency
Writing code that makes mistakes harder
Просмотров 5975 месяцев назад
Writing code that makes mistakes harder
Conforming your SwiftData objects to Codable
Просмотров 1,7 тыс.10 месяцев назад
Conforming your SwiftData objects to Codable
Binding vs. Bindable in SwiftUI on iOS 17
Просмотров 9 тыс.Год назад
Binding vs. Bindable in SwiftUI on iOS 17
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.
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.
That did not work
When viewModel is @Observable, you dont need @State in the View. Great video btw
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.
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?
Each tab view should have it's own navigation stack
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
post more videos like this
how would it be if I was in iOS 14
A lot less convenient!
When you add an Exercise to path, how does it know that it has to show the Exercise view ?
Through the navigationDestination view modifier that I applied to one of the parent views
EXCELENT
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.
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?
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.
@@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)
Background music was distracting sorry.
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 RUclips 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
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.
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.
@@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.
I have drums in my computer room! HAHA
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
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
Kudos to the author. First time I hear simple and elaborated explanation about threads which will be used to run task or specific method.
Thank you!
3 UIs into one lol... flutter devs screaming rn
if I choose regular does it match all devices larger than iPad, TV or Vision Pro for example
Yes, those should all be regular too. Good to know is that macOS is always regular regardless of your window’s size
@@DonnyWalsdev oh interesting!
Might need to send this to one of the speakers at iOSKonf in Skopje about the scrollView problem :D. Great work as always Donny!
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.
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.
@@DonnyWalsdev I noticed that glitch happens with my app in 18 too, I raised feedback for it.
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....
jizz man...WWDC24 is not finished yet and fanboys already making videos...chill
Why wouldn’t I make a quick video about a view modifier I like?
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.
This is great. Thanks, Donnie.
Can you have a ‘var’ then able to change the value again?
Yes, you absolutely can
Thank you!
Thanx
Hopefully this is the nail in coffin for view models and everyone finally learns structs!
I doubt it. SwiftUI and @Observable very strongly rely on (view)models being defined as classes
@@DonnyWalsdev view models are view structs. @ observable is for model data
Really well explained thank you!
Thanks for watching!!
What about this? ruclips.net/video/_XZHzl3R1Fo/видео.html
What about it? Is there something specific from that video you think I should look at?
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 😊
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
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.
your videos are beyond my noobie level but really interesting!
Thanks! Are there any topics that you're currently learning about or interested in that I could cover?
@@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.
👍
Hello! When is your Swift Concurrency course released? It says it is still in progress. Thx
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.
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
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)
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
I've added it to my (long) list of potential topics!
your videos are so good man, top tier content! Keep it up :)
Thanks!!!
Nice generator. I have already added it to my new project so I do not forget it. Is it required for TestFlight?
Not required for TestFlight but I’d recommend just adding it anyway :)
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?
You should be adding them all. However, Apple will only reject you for not declaring required reason APIs.
Excelente video, muchas gracias por compartir información valiosa!!✌✌
¡Gracias! Me alegro que te guste el vídeo
🔥
Thanks @DonnyWalsdev! Great example and well explained.
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.
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
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.
Thanks!
Subtle and complex! Thank you.
This is amazing, thank you for the explanation 🙏🏻 Can we have a video on task cancellation please?
Noted!
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.
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
the title was enough to trigger my anxiety😅
Can we have a sample project link ?
Hey! So sorry, I don't have a (publicly available) sample project available for this.