@rileander

2 Followers
19 Following
13 Posts

Out of the box, SwiftUI’s TextField and other components don’t allow you to bind to an Optional model value.

In this post I explain how you can write an extension on Binding provide default values for optional values so that you can bind to them.

https://www.donnywals.com/providing-a-default-value-for-a-swiftui-binding/

Providing a default value for a SwiftUI Binding – Donny Wals

Learn how you can write an extension on Binding to provide default values to SwiftUI

Donny Wals

Group Learning Project: Testing
#SwiftUI #AppleDev #UnitTesting

During the most recent Swift Dev Chat session, Dustyn came up with the great idea to do a community group project to rework some of Apple’s WWDC sample projects to incorporate comprehensive unit tests.

We wrote about LazyVGrid. These are very helpful when you want to display a grid with a large number of items. Because they're lazy, the column widths are computed without consulting the subviews, which can have interesting effects. https://www.swiftuifieldguide.com/layout/lazyvgrid/
The SwiftUI Field Guide

A visual guide to help explore SwiftUI

The SwiftUI Field Guide

So apparently Apple approved a knock-off of GBA4iOS — the predecessor to @delta I made in high school — in the App Store. I did not give anyone permission to do this, yet it’s now sitting at the top of the charts (despite being filled with ads + tracking)

I’ve bit my tongue a bunch in the past month…but this really frustrates me. So glad App Review exists to protect consumers from scams and rip-offs like this 🙄

@swiftui @swift Exciting News! 🎉 Just dropped Part 6 of my "Let's Build WhatsApp clone Using SwiftUI and “firebase” playlist! 📺🛠️ Dive deeper into Swift development as we take our app to the next level. 🚀 Check it out now and let's code together! 🔗https://www.youtube.com/watch?v=fKG8gQgSCCA #SwiftUI #iOSDev
SwiftUI WhatsApp Clone - Firebase - Part 6 - Chat View

YouTube
it’s almost like competition can pressure Apple to change their rules after all! https://www.macrumors.com/2024/04/05/app-store-guidelines-emulators-music-app-links/
Apple Updates App Store Guidelines to Permit Game Emulators, Website Links in EU Music Apps

Apple today updated its App Store guidelines to comply with an anti-steering mandate levied by the European Commission. Music streaming apps like...

MacRumors

Feeling a need to balance out all the complaining I do about #Swift, #SwiftUI, #Xcode, etc…

Things like .healthDataAccessRequest for getting user permission to access health info are excellent features.

Add this modifier to a view and it will present a dialog asking for permission to access the users stored health info. One line of code saves so much work. Good stuff

https://developer.apple.com/documentation/healthkit/authorizing_access_to_health_data

#iOSDev

Authorizing access to health data | Apple Developer Documentation

Request permission to read and share data in your app.

Apple Developer Documentation
Another variant of the task view modifier allows us to observe equitable data and run the async task whenever the data changes. The task lifecycle is still bound to the view lifecycle, but SwiftUI also cancels the ongoing job whenever data changes and creates a new one for the latest data.
A brand new page about the safe area in SwiftUI and how to work with it. As an experiment, we also added a "larger" visual to the beginning of the page. Enjoy! https://www.swiftuifieldguide.com/layout/safe-area/
The SwiftUI Field Guide

A visual guide to help explore SwiftUI

The SwiftUI Field Guide