💻 #swiftlang #iosdev #swiftui
⚔️ Flailing #fencing foilist, at times
☕️ #coffee nerd alert
👌 粵語/日本語
🫶 Excellent. - C.M. Burns
| Personal Web | https://boscoho.com |
| GitHub | https://github.com/boscojwho |
| Personal Web | https://boscoho.com |
| GitHub | https://github.com/boscojwho |
Anyone using SwiftUI’s LazyVGrid + .alert modifier on macOS hit this bug(?):
- Apply .alert modifier on items inside ForEach
- When alert is presented, the alert gets the wrong data value.
- This happens even when using the .alert(…presenting:) API
Workaround is to move alert outside of grid’s content builder, and save the data value to be presented in an [@]State var…
(See link for demo app with possible bug)
https://github.com/boscojwho/LazyGridBugExample
Demo bug where alert on LazyVGrid item doesn't capture the correct data value using various APIs, and shows workaround. - boscojwho/LazyGridBugExample
Made a little GUI app called “PipPy, a Python Pip package browser on macOS =)
- You can view system Pip packages and project (venv) Pip packages.
- Also includes a nice “Newest Packages/Latest Updates” feed from PyPI to stay up-to-date!
https://github.com/boscojwho/PipPy
Why? This project started because I found it hard to visualize all the Pip/venv installations in Python projects 😂
Hacked together a simple climate data visualizer to confirm/deny my impression that the first half of this summer in Vancouver was less hot than recent years…turns out 2nd half of May 2024 was one of the coolest years in Vancouver Harbour in the past 30 years, weird!
Check out https://github.com/boscojwho/ClimateData to see your local Canadian weather station, if you’re technically inclined =)
This might be useful if you’re using Reflex framework to write web apps, and need to easily self-host for whatever reason
https://www.boscoho.ca/coding/blog/2024-07-09-reflex-self-host-vercel.md
Interesting #SwiftUI example that demonstrates how to make an async func wait on a response to some UI. Because UI is state driven, it stores a continuation in a State that the async func can wait on.
https://developer.apple.com/documentation/SwiftUI/NewDocumentButton
Is there a way to disable the bounce on a sheet with detents presentation? None of the modifiers seem to do the trick. In UIKit, isModalInPresentation and disabling the view's gesture makes the sheet entirely static. This view is presented in a hosting controller so I'd have access to UIKit if that helps. A workaround seems to be to set a high-priority drag gesture onto the view but that makes my custom control not work any more.
New in iOS 18, etc.: `Text.textVariant(.sizeDependent)` view modifier, read about it here - http://urls.boscoho.ca/0ObIYH
Stumbled upon this cute new SwiftUI API (not sure which session this was discussed in), makes displaying formatted text in various view sizes much easier =)