I'm working on a personal project in swift (for macOS app) and I want to make a NSbutton (Touch Bar button) and hide it.
Is there a possible way to do this?
Asked
Active
Viewed 103 times
-3

AsafH
- 89
- 2
- 9
-
check [this](https://stackoverflow.com/questions/40759909/update-nstouchbar-on-the-fly-to-add-remove-items-programmatically) hope it helps – Dhaval Raval Jan 02 '20 at 10:07
1 Answers
0
I found the answer!
Just write:
<button_name>.isHidden = true
or if you want to disable and not hide:
<button_name>.isEnabled = false
In my case I had button that called "submitButton" so I wrote:
submitButton.isHidden = true
and when I wanted it to appear I wrote:
submitButton.isHidden = false

AsafH
- 89
- 2
- 9