Sam Soffes

Cancel Borderless Window

Posted on

I just spent the last hour trying to figure out why cancelOperation wasn’t getting called in an NSWindowController subclass. At first I tried performKeyEquivalent in the window controller or in a custom NSWindow subclass. That didn’t work. I then resorted to keyDown in the window subclass and that wasn’t getting called.

After a long while, I figured out that my window wasn’t becoming key even after I called makeKeyAndOrderFront. It turns out windows with borderless in the styleMask cannot become key by default. You can solve this with a tiny amount of code in a window subclass:

So ya. Frustrating. This is actually documented, but it took me a really long time to realize the window wasn’t becoming key and then why.

Continue reading →

Share Confirmation

Posted on

Recently, I added some visual confirmation what something was shared with the system share sheet on iOS. For things like copy or save to camera roll, there isn't visual confirmation that it worked from the system.

At first I considered making my own share actions for this and disabling the system ones but that seemed like a lot of work for adding a simple “it worked” to the screen. Then I had this idea:

Pretty simple! This uses SVProgressHUD to show some visual feedback that it worked. This was really easy to add. I think this is a really welcome addition. You could obviously do this for any other type that you want. I didn’t want to do it for every type since some types (like share to Twitter) are really obvious when they work or are canceled.

Continue reading →

Mic Setup

Posted on

I recently made a video mentioning my new mic setup and got a few questions about it. Instead of making a video that just mentions tons of links, I thought I'd write it up.

I use a Heil PR40 mic. I've used it for a few years now. It's a pretty great mic for making podcasts and screencasts. The boom arm for my desk is a Heil PL-2T. This is a great arm. I've seen it used with several other mics too. My mic is attached to the arm with a Heil PRSM-B Shockmount. I also have a Heil Windscreen on it to cut down on breath noise.

The arm mounts into my desk with a Heil DT-1 Flush Mount. I have a Mogami Gold Studio 6' XLR cable cable in the arm connected to the mic. I found 6' is just about the perfect length. There's a little extra to work with but not too much. I know the Mogami cables are pretty pricey. From what I've read, it's the only cables you can audibly hear a difference in quality. They're fine cables. Probably doesn't matter that much though.

Continue reading →

Automated Bundle Version

Posted on

Lately I've been using a script to set my apps’ bundle version.

Add a new Run Script build phase. Change the shell to:

Put the following in the source area (right under the shell field):

Continue reading →