Skip to content

Instantly share code, notes, and snippets.

@alexandersandberg
Last active March 23, 2024 18:13
Show Gist options
  • Save alexandersandberg/41411980f2e828852739bab20963f718 to your computer and use it in GitHub Desktop.
Save alexandersandberg/41411980f2e828852739bab20963f718 to your computer and use it in GitHub Desktop.
//
// ContentView.swift
// Playground
//
// Created by Alexander Sandberg on 23.03.24.
//
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationStack {
Text("Hello, World!")
.toolbar {
ToolbarItem(placement: .principal) {
HStack {
Spacer()
TextField("Search...", text: .constant(""))
.textFieldStyle(.roundedBorder)
.frame(maxWidth: 300)
Spacer()
}
}
}
}
}
}
#Preview {
ContentView()
}
@alexandersandberg
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment