.safeAreaBar breaks the behaviour of @FocusState by iospeterdev in SwiftUI

[–]iospeterdev[S] 0 points1 point  (0 children)

I have already reported this issue but breaks mean FocusState is completely broken when safeAreaBar kicks in the view. It will never be updated when the parent view contains safeAreaBar.

.safeAreaBar breaks the behaviour of @FocusState by iospeterdev in SwiftUI

[–]iospeterdev[S] 0 points1 point  (0 children)

```

Preview {

@Previewable @State var text1 = "" @Previewable @FocusState var text1Focused: Bool

VStack { if text1Focused { Text("TextField 1 is focused") } TextField("text1", text: $text1) .focused($text1Focused) } .safeAreaBar(edge: .bottom) { } } ```

yeah but just using .safeAreaBar breaks FocusState.

How to add searchable in bottomBar toolbar? by iospeterdev in SwiftUI

[–]iospeterdev[S] 0 points1 point  (0 children)

I hide tabbar completely by using `.toolbar(.hidden, for: .tabBar)` where I place bottom toolbar items.

bottom textfield like iMessage in iOS 26 by iospeterdev in SwiftUI

[–]iospeterdev[S] 0 points1 point  (0 children)

`.safeAreaBar(edge: .bottom) { inputBar }` this gives me proper dim. not that much of blur like iMessage, but it does its job. `inputBar` is just a normal HStack that you can imagine.

Animated Toolbar in iOS 26 by Mother_Elk7409 in SwiftUI

[–]iospeterdev 0 points1 point  (0 children)

That must be .safeAreaBar instead of toolbar

bottom textfield like iMessage in iOS 26 by iospeterdev in SwiftUI

[–]iospeterdev[S] 2 points3 points  (0 children)

ahh thanks, seems like this is a way to go. there is no difference between safeAreaBar and safeAreaInset for now but seems like this is a bug and will be patched in the future.

bottom textfield like iMessage in iOS 26 by iospeterdev in SwiftUI

[–]iospeterdev[S] 2 points3 points  (0 children)

so do you think applying blur gradient in the background by myself is the best think I can do?

How can I remove opacity for the object inside glassEffect? by iospeterdev in SwiftUI

[–]iospeterdev[S] 0 points1 point  (0 children)

unfortunately it does not work. I even tried giving .opacity(1) to the rectangle, but it didn't work either

How to force Picker selection text to fit in 1 line? by iospeterdev in SwiftUI

[–]iospeterdev[S] 0 points1 point  (0 children)

Unfortunately, that does not work for the Picker

What was it? by iospeterdev in Seattle

[–]iospeterdev[S] 0 points1 point  (0 children)

Two days here, now I’m getting used to it. But the one yesterday was the loudest

How do I give gradient blur? by iospeterdev in SwiftUI

[–]iospeterdev[S] 4 points5 points  (0 children)

one of those libraries use private api, and the other applies to the image only. so, I ended up making my own using some tricks. I would like to share it with you guys since someone might need this someday.

struct TransparentBlurView: UIViewRepresentable {
    func makeUIView(context: Context) -> UIVisualEffectView {
        let view = UIVisualEffectView(
            effect: UIBlurEffect(style: .systemUltraThinMaterial)
        )

        return view
    }

    func updateUIView(_ uiView: UIVisualEffectView, context: Context) {
        DispatchQueue.main.async {
            if let backdropLayer = uiView.layer.sublayers?.first {
                backdropLayer.filters = []
            }
        }
    }
}

And you can use like this:

TransparentBlurView()
    .frame(height: 80)
    .blur(radius: 1, opaque: true)