Simulator drag and drop doesn’t exactly work correctly.
Apple Vision Pro
You can’t easily have the floating keyboard when you are inside of an immersive environment.
Swift Unwrap Live 2024 Notes
This is my notes from a full day workshop from Jan 27th, 2024 about Vision Pro. I took hand written notes during the entire thing and ended up with over 10 pages of hand written note along with some really nice ideas for UI going forward. The keyboard shortcut to […]
SwiftUI Tips
SwiftUI with Packages I’ve been refactoring a codebase into reusable systems today. When you have a View as part of a package, the following have to be public: the View, the Init, and body. SwiftUI Environments api is iOS 17 or newer, doesn’t work inside of ViewModels, only inside of […]
Vision Pro Development [Day 2]
This isn’t something that is specific to Vision Pro, but it is an xCode feature that is awesome, if you select some code and press { it will wrap the selected code with { and }. Should look into xCode shortcuts they are internal snippets. SwiftData seems very simple to […]
SwiftUI Tip
If you want to use label color while inside of SwiftUI use Color.init(cgColor: UIColor.secondaryLabel.cgColor) You can swap out the secondaryLabel for any of the other system colors, including background, label and many others.
SwiftUI Tip
If you are trying to put multiple buttons inside of a list item, make sure you put .buttonStyle(.plain) on the parent most component in the list item. This caused me a some confusion on why it was deleting the wrong element of the inner list.
iOS List Pending Notifications
You may want to show a list of the upcoming application notifications, you can do this by using the following code.
iOS Notifications While App is Open
You first need a class that acts as the delegate for the userNotificationCenter. Then you need to create an instance of this on your @main, and then tell the notification center what the delegate is.