HomeiOS Developmentarrays - How can I obtain the identical search behaviour as in...

arrays – How can I obtain the identical search behaviour as in iOS 26 Pockets app?


So in iOS 26, the search area modified a bit the place it may be on the backside. Whereas different apps have the search within the nav bar, pockets has it within the toolbar, so when it is pressed it adjustments to a special view with the Search area on the backside.

var physique: some View {
        NavigationStack {
            ScrollView {
                VStack(alignment: .main, spacing: 8) {
                    Textual content("Ideas")
                        .font(.system(measurement: 16, weight: .semibold))
                        .foregroundColor(.white)
                    ForEach(1...20, id: .self) { index in
                        Textual content("Merchandise (index)")
                            .foregroundColor(.white)
                    }
                }
                .padding(.high, 16)
                .padding(.horizontal, 16)
            }
            .searchable(
                textual content: $searchText,
                placement: .navigationBarDrawer,
                immediate: "Search airways & airports"
            )
        }
    }

So that is the present code I’ve for it. .navigationBarDrawer nonetheless locations it on the high.

ToolbarItem(placement: .navigationBarTrailing) {
                    NavigationLink(vacation spot: ExploreSearchView()) {
                        Picture(systemName: "magnifyingglass")
                            .font(.system(measurement: 17, weight: .daring))
                    }
                    .padding(.horizontal, 4)
                }

And that is my toolbar merchandise which might open this. I would like it to additionally fade in like within the pockets app as an alternative of slide in and when the consumer dismisses the search, then fade out the strategies display screen.

Beneath are the photographs of how mine seems to be with the search on the high vs the search on the backside like in Apple Pockets. Thanks!

Image of how my UI looks with searchbar at the top

Image of Apple Wallet UI with search bar at the bottom

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments