There’s no standard shortcut to fold the current subtree of an org-mode outline. When I work in org-mode outlines, I usually am 3 or more levels deep into a so-called “subtree” and want to get back to the root item, fold it to hide the details, then drill down into another item. I use that when I am working on an app and want to have a look at a planned milestone nested deep down at a different point in the outline.
There is a free ebook out there that teaches you the basics of Combine, Apple’s reactive framework introduced at WWDC 2019. It is pretty long already, given the time author Joseph Heck (@heckj) had to learn about Combine and then write about it. From what I saw, I think it’s a good introduction to reactive programming in general.
I don’t know what’s going on this week, but I have written a lot for the blog. I also carved out an hour and a half today to update the structured overview of articles on this website. I always wanted to make it a good entry point but didn’t update it during the transition to another blog platform, then back again, and now it’s 2 years later already. Phew!
Today I noticed that I never followed up on my FastSpring webinar of 2017 called “Beyond the Mac App Store -
A Practical Guide to Go From Code to Cash” with the slides! Sorry, folks! I’ll also upload the checklist we served attendees. You can find the slides on slideshare.net, because I have an account there and don’t know what else to do with PDFs: https://www.slideshare.net/DivineDominion/beyond-the-mac-app-store-a-practical-guide-to-go-from-code-to-cash
People in Slack asked me why I didn’t use another mechanism to get notified when NSWindows are shown. Here’s what I was suggested and what I found: NSWindow.didChangeScreenNotification:
Does not fire for all windows showing for the first time, and if it fires, if firest only once. Closing and re-showing the window will not trigger the notification again.
I updated my app the WordCounter for Mac to v1.5.0 today. This update includes a couple of modernizations behind the scenes, but most importantly fixes problems that were related to the app being a Dock-less menu bar app. You couldn’t manage any of its windows well. Now you can, because when any additional window is shown, a Dock icon is added on the fly.
When I pointed out that Sparkle finds its XPC services on its own, I mentioned you can see how it does this by searching for “SPUXPCServiceExists”. If you take a look at the use of this function, you’ll see something like this in the Objective-C (!) source files:
How do you observe for changes to the list of visible/known/active NSWindow instances in your app? There’s NSWindow.willCloseNotification, but there’s no equivalent like a willShowNotification or didShowNotification (except for NSPopover). I don’t know why, but I do find it strange.
In the previous post, I talked about how to download the “modern” Sparkle updater branch called ui-separation-and-xpc that allows you to update sandboxed apps and migrate your code to use the new types. This time, we’re going to use the actual XPC services that do the grunt work.
The Sparkle XPC fork is even better than I would’ve imagined! As I mentioned in the previous post about Sparkle’s XPC branch, you can switch to the new framework version and the new types without having to change much else. The new API is very similar to the old one. If you switch to the work-in-progress ui-separation-and-xpc branch, then you can continue to use CocoaPods or Carthage if all you want is the new API.
This is the first post in a series: The standard solution to provide app updates outside the Mac App Store is to use the amazing Sparkle framework. The releases of Sparkle don’t support sandboxed applications well, though, so the core maintainer Kornel Lesiński (@kornelski) is working on a more secure fork of Sparkle next to the existing one. He’s maintaining the regular Sparkle, and the fork. The fork features various XPC services to deal with Gatekeeper security configurations and Sandbox entitlements in a proper way. (I have to phrase it in such a vague way because I have no clue about the details, yet. Explanations are very welcome in the comments!)
The default Interface Builder approach of using a “Shared User Defaults Controller” object breaks down if your app preferences are not stored in the standard place. Both my apps The Archive and the Word Counter for Mac are comprised of multiple executable applications. For The Archive, it’s the main app and the Quick Entry popup window. They share some settings, like which theme and font size is used. To share these settings, I rely on NSUserDefault (or just UserDefaults in Swift now). I cannot use the UserDefaults.standard, though, because that is tied to the currently running app’s bundle ID. In the case of the main app, it’s the ID of the main app; but for the Quick Entry helper – or any helper app –, it’s the helper’s bundle ID. This way, the defaults dictionaries are not shared.
Brent Simmons wrote about imposing sanctions by making apps unavailable in certain countries (in his case: Saudi Arabia) in November 2018. I never thought about the mere possibility of doing so. It’s an intriguing thought: even when politics don’t result in whatever you want, you can always be picky about who you do custom with. It’s a power we have, a power every producer and craftsperson has. Turn down a business for moral reasons.
If you’re a student and apply for GitHub Education, you get a lot of cool stuff for free. Part of this cool stuff apparently is “aws educate” access, I was told: GitHub Student Developer Pack members receive up to $110 in bonus AWS credits for a total of $75-$150
In anticipation of macOS10.15 Catalina, I have changed my shell from bash to zsh. macOS10.15 will use zsh as the new default, and I was pretty sure that things will break immediately unless I prepare – so I did prepare, and I found the transition very simple. My old bash prompt didn’t work out of the box, so getting a decent prompt with some color and git repository information, I managed to set up sindresorhus/pure to offer asynchronous (!) info like the pwd’s git metadata.
This weekend, I released an update to the note-taking app I’m working on for a while called The Archive. This update is pretty big for people not getting updates from the opt-in “Cutting Edge” update channel, because all of a sudden the app allows you to navigate back in time. The navigation stack (what you’d call browser history available from the navigation buttons in your browser) behaves like this:
Found embetty, and now I am reconsidering to embed marked-up Tweets and YouTube videos again. Embetty displays Tweets as proper cards, but without Twitters visitor-tracking code. Instead of screenshots, they have a demo page.