Questions tagged [.searchable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
1 answer
409 views

Changing the color of .searchable() elements

I am using the .searchable() modifier on a NavigationStack. I want to change the color of the cancel button as it does not match with my app colors. How can I do this? This is what I already tried ...
lagoupo's user avatar
  • 77
4 votes
1 answer
968 views

Is there a way to hide the search bar in SwiftUI

I have a view with the searchable modifier. It is always displaying a searchBar and works fine. I find the searchBar is taking up too much space at the top of the view on an iPhone and since it is ...
alionthego's user avatar
  • 9,179
4 votes
0 answers
301 views

Searchable: Suggested Tokens not Disappearing on Submit

Using the searchable view modifier with tokens allows me to present the user with search suggestions. When the search field is activated, the list of suggested tokens is presented on top of the list ...
Cheezzhead's user avatar
3 votes
2 answers
1k views

.searchable() - make the search box stick to the top without moving when focused

I am trying to make the search box in .searchable stick to the top without moving when there is no navigationBarTitle. Basically, when the box gets focused, there is an animation that moves the box ...
lagoupo's user avatar
  • 77
3 votes
1 answer
225 views

Search Bar is briefly visible when navigating with NavigationStack (SwiftUI)

I have a .searchable modifier on a list where I navigate to with new NavigationStack. However when the view loads the search box is briefly visible which looks weird. Am I using the navigation stack ...
Can Celik's user avatar
  • 2,067
2 votes
5 answers
887 views

Show .searchable search bar only when pulling down

So I have an SwiftUI view, that displays data in a List. You can search and filter through the objects. So far so easy, but this searchbar (initializised with .searchable()) is always visible. Only ...
Black Fox's user avatar
1 vote
1 answer
76 views

.searchable redrawing view

I'm getting tripped up an an issue with .searchable. I want to use the environment object isSearching to hide a view, and in order to do that, according to apple docs, https://developer.apple.com/...
byrnec25's user avatar
0 votes
1 answer
47 views

Adding (vertical padding or padding top) space above .searchable() method

I want to add a space above the .searchable() method and have a gap of 20, that is padding(.top, 20). I don't want to use any customized search box. Can anyone please let me know if a gap can be ...
Usha's user avatar
  • 3
0 votes
1 answer
28 views

SwiftUI navigating to child view with searchable retracted causes out-of-bounds view, app unresponsive

I have a SwiftUI NavigationStack which goes 3 levels deep. In the level 2, I have a .searchable modifier. When pushing to level 3 while the search bar is retracted up (awaiting user to type) the level ...
Petr Smejkal's user avatar
0 votes
0 answers
56 views

How to make this list in SwiftUI scrollable

Edit: The scrolling works outside of the text. Now I am making my first project. I can´t seem to fix this code. It won't scroll. import SwiftUI struct SøkView: View { @State private var searchText ...
Rubne's user avatar
  • 1
0 votes
0 answers
135 views

Unexpected warning: Someone is removing an active search controller while its search bar is visible

I have a largish app with a deep navigation stack. I display a list of items and filter with .searchable. When an item is selected using a search I get the following messages: List failed to visit ...
Ian's user avatar
  • 23