Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 515 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 515 Bytes

PathControl

SwiftUI wrapper for NSPathControl.

PopUpPathControl(url: $url) { menuItems in
    PathMenuItem.fileChooser(title: "Select project…")
    
    if menuItems.contains(where: { $0.title == "Users" }) {
        Divider()
        PathMenuItem(title: "Viewing contents of Users directory", action: {
            print("Clicked")
        })
    }
    
    PathSubmenu(title: "Submenu") {
        PathMenuItem(title: "Submenu item", action: {})
    }
    
    Divider()
    
    menuItems
}