Created
July 1, 2021 19:17
-
-
Save DreamingInBinary/c9517adf51aaf23268b731e0dadfcb31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SidebarSearchView.swift | |
// | |
// Created by Jordan Morgan on 6/30/21. | |
// | |
import SwiftUI | |
struct SidebarSearchView: NSViewRepresentable { | |
typealias NSViewType = NSSearchField | |
func makeNSView(context: Context) -> NSSearchField { | |
let searchField = NSSearchField(string: "") | |
searchField.bezelStyle = NSTextField.BezelStyle.roundedBezel | |
searchField.controlSize = NSControl.ControlSize.large | |
searchField.translatesAutoresizingMaskIntoConstraints = false | |
searchField.setContentHuggingPriority(.defaultHigh, for: .vertical) | |
searchField.setContentHuggingPriority(.defaultHigh, for: .horizontal) | |
return searchField | |
} | |
func updateNSView(_ nsView: NSSearchField, context: Context) { | |
} | |
} | |
struct SidebarSearchView_Previews: PreviewProvider { | |
static var previews: some View { | |
SidebarSearchView() | |
.padding() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment