Код: Выделить всё
var body: some View {
NavigationStack {
ScrollView {
VStack(alignment: .leading, spacing: 8) {
Text("Suggestions")
.font(.system(size: 16, weight: .semibold))
.foregroundColor(.white)
ForEach(1...20, id: \.self) { index in
Text("Item \\(index)")
.foregroundColor(.white)
}
}
.padding(.top, 16)
.padding(.horizontal, 16)
}
.searchable(
text: $searchText,
placement: .navigationBarDrawer,
prompt: "Search airlines & airports"
)
}
}
Код: Выделить всё
ToolbarItem(placement: .navigationBarTrailing) {
NavigationLink(destination: ExploreSearchView()) {
Image(systemName: "magnifyingglass")
.font(.system(size: 17, weight: .bold))
}
.padding(.horizontal, 4)
}
Ниже приведены изображения того, как мое выглядит с поиском вверху и поиском внизу, как в Apple Wallet. Спасибо!


Подробнее здесь: https://stackoverflow.com/questions/798 ... wallet-app
Мобильная версия