Swift OSX NSOpenPanel not changing selection -
i calling nsopenpanel
user can select file, after first selection done panel doesn't allow me change file when click mouse on file. changes when use keyboard arrows doesn't when click mouse.
@ibaction func selecionarimagembuttonclicked(_ sender: nsbutton) { let panel = nsopenpanel() panel.allowsmultipleselection = false panel.canchoosedirectories = false panel.canchoosefiles = true panel.cancreatedirectories = false //panel.allowedfiletypes = ["jpg","png","pct","bmp", "tiff"] panel.allowedfiletypes = nsimage.imagetypes() panel.beginsheetmodal(for: view.window!) { (result) in if result == nsfilehandlingpanelokbutton { self.logofornecedorimageview.image = nsimage(byreferencing: panel.url!) self.logofornecedorselecionada = true } } }
Comments
Post a Comment