SwiftUI's List loads row views lazily, creating content only for rows near the visible region. For this to work, SwiftUI needs to be able to determine the number of views a ForEach element resolves to without evaluating the closure.
Two common patterns prevent this:
- Using an `if` statement inside ForEach changes the number of views per element, so SwiftUI has to evaluate every closure upfront to get the count.
- Wrapping rows in AnyView hides the type information SwiftUI needs to determine the view count, with the same result.
In both cases, SwiftUI ends up evaluating the ForEach closure for every element in the collection before any rows are displayed.
You can learn more about maximizing the performance of dynamic lists in SwiftUI and common pitfalls from the sample chapter of my book "The SwiftUI Way". You can read it for free here: https://t.co/E6lV9ZRex2
In an RFC or evolution proposal, "Alternatives Considered" is where you prove you were searching for the best solution, not just justifying the first one you liked.
Every design is a trade-off, and you really need to explore different approaches, argue against yourself, and understand why you're choosing one path over another.
More and more LLMs are becoming great sparring partners for this.
I don't care what computer you have, you should be running local models
It will save you a money on OpenClaw and keep your data private
Even if you're on the cheapest Mac Mini you can be doing this
Here's a complete guide:
1. Download LMStudio
2. Go to your OpenClaw and say what kind of hardware you have (computer and memory and storage)
3. Ask what's the biggest local model you can run on there
4. Ask 'based on what you know about me, what workflows could this open model replace?'
5. Have OpenClaw walk you through downloading the model in LM Studio and setting up the API
6. Ask OpenClaw to start using the new API
Boom you're good to go.
You just saved money by using local models, have an AI model that is COMPLETELY private and secure on your own device, did something advanced that 99% of people have never done, and have entered the future.
There are some amazing local models out there too right now. Nemotron 3 and Qwen 3.5 are fantastic and can be ran on smaller devices
Own your intelligence.
Look at these 2 UIs.
One of them will 100% outperform the other for one reason:
The Doherty Threshold.
Here's how this psychological principle works & how to use it in your products:
Learn all about parameterized tests
https://t.co/SrtJItyTYZ
✨ Run a single test with multiple arguments
🧹 Clean up boilerplate code
⛔ Quickly indicate a test failure
#swiftlang#iosdev
One of the lesser-known but useful features in Swift is the concept of named loops. In nested loops, it's often unclear which loop the break or continue statement is affecting. Named loops remove this ambiguity, making our code more readable and maintainable.
2001... a year that set the course for my life
It was then that I had an unexpected "encounter "with Bill Gates
Isn't it strange how the universe has a knack for surprises?
I stumbled into my local library one day, needing to use the bathroom
As I was leaving, my eyes were drawn to a bookshelf.
A book called 'The Road Ahead' by Bill Gates
Not a big reader at the time, but this one...this one pulled me in
I found myself absorbed in it for hours on end
It was as if Gates had thrown open the doors to the future, presenting a world of smartphones, internet payments, and social networks - concepts that felt almost science-fiction-like, yet intriguingly plausible
Billions of people, interconnected through digital networks of communities and commerce, was a vision hard to ignore
I was a kid from a declining economy in Montreal, Canada's version of Detroit
Money was tight for so many of the people I knew
But I wanted more, and through Gates, I figured out how
Through Bill, I discovered Warren Buffet and his jaw-dropping confession:
"I read 600-1000 pages per day."
Like a lightning bolt, it struck me - the path to world-class expertise, to foreseeing the future, was no secret
It was reading
That's when I committed to the 4% rule - dedicating an hour each day to reading
A small daily investment with the potential to yield massive, compounding returns over time.
The habit wasn't easy to form, but the resolve was unshakeable
This reading journey instilled in me a conviction that anyone, regardless of their starting point, could become an expert, a visionary, if they are willing to invest the time to read, to learn
And my 4% time investment? It's paid dividends beyond what I could have ever imagined. Thanks Buffett and Gates.
People often ask me: how do you get ahead in today's world?
I think it's as simple as these 4 rules:
1. Develop a reading habit (4%)
2. Develop a writing habit (4%)
3. Develop a idea building habit (4%)
4. Develop a fitness habit (4%)
It all starts with reading
"Reading an hour a day is only 4% of your day. But that 4% will put you at the top of your field within 10 years. Find the time."
I agree.
No more print in deinit to detect a retain cycle. Useful Xcode breakpoint that plays a sound when view controllers are properly deallocated.
https://t.co/IeFKjE0qrm
#iosdev
Wanna catch up on the WWDC announcements?
Here are 3 videos that could help you!
🥇 My Highlights of WWDC23 as an iOS Developer https://t.co/OTzJ8FLr9H
🥈 Exploring SwiftData https://t.co/KK3QJiJWA8
🥉 Discovering Swift Macros https://t.co/KIKhSo2NVV
The PhotosPicker view is a simple SwiftUI button handling the photo-picking experience for us for free. It is straightforward to use and provides a nice API.
https://t.co/kYmolqEAao