0

I have been trying to find a way to hide other applications programmaticly in my AppDelegate. I tried:

func hide() {
NSLog("hide")
NSApplication.hideOtherApplications(self)
}

The error seems to be in the "self". I am pretty sure it is a really simple error but I keep on having issues trying to work it out.

But this does not seem to work. I am new to OS X programming. Although I already worked a bit (just a little bit) with swift.

Devapploper
  • 6,062
  • 3
  • 20
  • 41

1 Answers1

1

I guess you are looking for this:

NSWorkspace.sharedWorkspace().hideOtherApplications()

NSApplication.sharedApplication().hideOtherApplications(self)

NSApplication.sharedApplication().unhideAllApplications(self)

There is no unhideAllApplications for NSWorkspace. Please check the reference from Apple website.

brianLikeApple
  • 4,262
  • 1
  • 27
  • 46