masto.es es uno de los varios servidores independientes de Mastodon que puedes usar para participar en el fediverso.
Bienvenidos a masto.es, el mayor servidor de Mastodon para hispanohablantes de temática general. Registros limitados actualmente a invitaciones.

Administrado por:

Estadísticas del servidor:

1,9 K
usuarios activos

#swiftui

6 publicaciones6 participantes1 publicación hoy

I need help with #SwiftUI please!

I have a List. When you tap on a cell, it gains a row of buttons to interact with it (think TweetBot/Ivory). So the cell should grow in height to accommodate the buttons; the rest of the cell's content should stay in the same place; the buttons should appear somehow. One cell might be hiding the buttons while another is showing.

I can't get this to work with the cell content jumping slightly.

I really want to stick with List, not go to ScrollView. Any ideas?

After years of watching other people write about software development, I decided that I wanted to give it a try too…

So I started a new blog!

To kick things off I wrote a (slightly belated) SwiftUI Wish List, but what I’m really looking forward to sharing is a new app I’m working on, and some of the development (mis)adventures I’ve had.

Read the first post here and let me know what you think: adevlog.com/2025/07/a-swiftui-

A Devlog · A SwiftUI Wish ListFrom its start, SwiftUI has tried to provide sensible defaults for building common UIs, but it’s taken longer to approach the full breadth of customizations offered by UIKit and AppKit. It could also afford to: the ability to bridge to and from “the kits” was (and remains) a fantastic

I'm very behind, as usual, and am trying out Liquid Glass styling for the first time.

Even if I strip down my toolbar to only have the simplest elements I can't get it to compile if I'm using .sharedBackgroundVisibility.

I get the infamous "unable to type-check...". 🤔

Respondió en el hilo

@rjmccall hm, interesting. My initial reaction was „because then you have to repeat the whole view spec in the else case. But the whole point of it would be not to display it, so actually you don’t. This *is* is issue for things like `disabled`, where you want to display it but in a specific style, but not as much for hidden.

But then again: `hidden()` has a different meaning. `hidden` means „don’t display, but *do* take up space“ whereas with `if` it isn’t part of the view hierarchy at all, so it also won’t take up space.

So `if x { B() }` isn’t a replacement for `B().hidden(x)`.

But your question made me realize that in my case I actually *want* it, and `hidden` would be the wrong tool for the job. I think I would have realized it faster if I had been able to try out how hidden(false/true) behaves and that it doesn’t do what I want, but still, interesting.

#SwiftUI trains us to want to solve basically everything via modifiers both because it’s „the SwiftUI style“ but also because there are often reminders about how conditionally applying modifiers (not passing conditions *to* modifiers) is bad for performance and likely breaks your animations as the two branches of if-else have different view identities and thus cause a recreation of the subviews.

I think there are likely still valid use cases for a hidden modifier with a book parameter, but I can imagine that at least half the time when people want to reach for it (like me now) `if` would actually be the correct choice.

5 years after the release of #SwiftUI, why does it still not support a `hidden()` modifier with a bool parameter?

Looking at StackOverflow for it I only find people using .opacity() instead (which allows a param), but that seems obviously wrong, not least because it means the view will still be „visible“ in the accessibility hierarchy.

Turns out .glassEffect(.clear) renders in HDR when on a light background. Studio Display doesn’t have HDR and simulator/preview shows everything as intended but on device colors around a liquid glass element all look darker, just spent 20 minutes to “debug” this 🤦‍♂️ #SwiftUI #liquidglass

Respondió en el hilo

@jonduenas @nicoreese @weetwo

Mmm… I saw better. They use a menu, but in any case, It’s possible the key is that they use -> Label("etc", systemImage: "line.horizontal.3.decrease")

try with:

ToolbarItem(placement: .topBarTrailing) {
Toggle(isOn: $somethingToEnabled) {
Label("etc", systemImage: "line.horizontal.3.decrease")
.labelStyle(.iconOnly)
}
}

It looks more like a circle

BadgeIcon 1.1 is out! 🚀 This is a #SwiftUI library that makes it easy to create icons that resemble the ones in the iOS Settings app. This version adds a new emoji icon, support for the palette rendering mode, and brings the number of icons to 50.

github.com/danielsaidi/BadgeIc

A SwiftUI library that lets you create beautiful, scalable icons. - danielsaidi/BadgeIcon
GitHubGitHub - danielsaidi/BadgeIcon: A SwiftUI library that lets you create beautiful, scalable icons.A SwiftUI library that lets you create beautiful, scalable icons. - danielsaidi/BadgeIcon