Skip to content
Tag

Mac

Articles and publications tagged Mac across the Atmosphere.

50articles17publications
MacKuba blog
MacKuba blog
Dec 30, 2021
New edition of the "Guide to NSButton styles"
Note (Oct 2023): The names of the buttons have been changed again in the SDK in macOS Sonoma - I will update the blog post again once I have Sonoma on one of my Macs :) Back in October 2014 I wrote a post about different styles of NSButtons. That was in the era of OS X Yosemite and Xcode 6. I started researching what each kind of button available in Interface Builder was for, because I couldn’t figure that out from Xcode and the built-in documentation - I dug a bit into the Human Interface Guidelines, some older documentation archives and into Apple apps themselves. I collected everything into a long post that went through all the button styles and described what I could find about each one. It seems that a lot of people also had the same problem, because the post turned out to be extremely popular. It’s around #3 in total page views on this blog, and 7 years and 7 major macOS versions later it still usually comes out #2 in monthly or yearly stats and still gets a couple hundred visits a month. Even with greatly improved documentation in Xcode and much expanded content in the modern HIG, there’s clearly demand for this kind of information collected in one place. However, the post was kind of asking to be updated for a long time now… The original screenshots were made in 1x quality, since I didn’t get a Mac with a Retina screen until the end of 2016. Big Sur was released in the summer of 2020, significantly changing the design of the OS, and making Catalina suddenly look outdated (to the point that I’ve seen some people already call the Yosemite-Catalina era design “classic macOS”!). Some new button variants were added, some older buttons were no longer used in system apps the way I presented them, and the button styles available in Xcode were no longer shown and described as shown on screenshots from Xcode 6. The Big Sur launch seemed like a great moment to give that post a refresh, and I started working on it at the end of last year, but then 2021 came and this year turned out to be kind of rough - surprisingly more so than 2020… as it was for a lot of people, I suppose. I only managed to get back to this project this month. I thought it would take maybe a week or two… it took around three in total 😬 That included setting up new Mavericks and Yosemite installations in VirtualBox to get updated Retina screenshots from there, building a number of versions of a sample app full of all kinds of buttons that I took a ton of screenshots of on several macOS versions, cutting every screenshot pixel-perfect to size a few times, merging different versions of the same information from a few different sources, including versions of HIG going as far back as 2006, looking through Apple apps searching for buttons, and view-debugging some of them with SIP turned off to check what controls were used there… whew 😅 I’m really happy with the result though. This is now by far the longest post on the blog, with around 11k words total (although around 1/3 of tha…
CocoaMac
MacKuba blog
MacKuba blog
Aug 17, 2020
SwiftUI betas - what changed before 1.0
In the last few weeks I’ve been trying to catch up on SwiftUI - watching WWDC videos, reading tutorials. Not the new stuff that was announced 2 months ago though - but the things that people have been using for the past year. Last June, like everyone else I immediately started playing with SwiftUI like a kid with a new box of Legos. In the first month I managed to build a sample Mac app for switching dark mode in apps. However, after that I got busy with some other things, and never really got back to SwiftUI until recently, so by the time the “version 2” was announced at the online-only WWDC, I’ve already forgotten most of it. So in order to not get this all mixed up, I decided to first remember everything about the existing version, before I look at the new stuff. Back then, when I was watching all the videos and doing the tutorial, I was taking a lot of notes about all the components, modifiers and APIs you can use, every single detail I noticed on a slide. However, I was surprised to see how many of those things I wrote down don’t work anymore. After the first version that most people have played with and that the videos are based on, there were apparently a lot of changes in subsequent betas (especially in betas 3 to 5). Classes and modifiers changing names, initializers taking different parameters, some things redesigned completely. And the problem is that all those old APIs are still there in the WWDC videos from last year. But WWDC videos are usually a very good source of knowledge, people come back to them years later looking for information that can’t be found in the docs, Apple even often references videos from previous years in new videos, because they naturally can’t repeat all information every year. This was bothering me enough that I decided to spend some time collecting all the major changes in the APIs that were presented in June 2019, but were changed later in one place. If you’re reading this in 2021 or 2022 (hopefully that damn pandemic is over!), watching the first SwiftUI videos and wondering why things don’t work when typed into Xcode - this is for you. Here’s a list of what was changed between the beta 1 from June 2019 and the final version from September (includes only things that were mentioned in videos or tutorials): NavigationButton Appeared in: “Building Lists and Navigation” tutorial, “Platforms State of the Union” ForEach(store.trails) { trail in NavigationButton(destination: TrailDetailView(trail)) { TrailCell(trail) } } Replaced with: NavigationLink ForEach(store.trails) { trail in NavigationLink(destination: TrailDetailView(trail)) { TrailCell(trail) } } PresentationButton / PresentationLink Appeared in: “Composing Complex Interfaces” tutorial, “Platforms State of the Union” .navigationBarItems(trailing: PresentationButton( Image(systemName: "person.crop.circle"), destination: ProfileScreen() ) ) Replaced with: PresentationLink, which was lat…
CocoaiPhone
MacKuba blog
MacKuba blog
Jun 22, 2020
Notes from WWDC
When I watch conference talks, I like to take notes - either on an iPhone or iPad when I’m in the conference room, or on the Mac when I’m watching online like in case of WWDC (I’ve never seen it in person). It makes it easier for me to remember the most important content from the presentation, and especially in case of WWDC notes I often come back to them to find some specific piece of information - WWDC talks are a very important part of documentation of how to use Apple’s APIs, sometimes (sadly) the only piece of documentation about the specific class or method that’s available. I have a fairly large archive of those notes (around 20 from each year on average), usually just stored as one long note in the Notes.app, and I’ve been thinking for a while that it could make sense to somehow share them with the world. I have no idea how useful they will be for others, since I write them primarily for myself, they’re much more condensed than blog posts and basically written as just a “diff” from what I knew before, but I guess I won’t know until I try. One problem I had with sharing the notes is that they’re written as completely plain text, something like this: If I wanted to convert each note to proper Markdown, it would be a lot of manual work, and I didn’t really feel like doing that. So one day I had an idea: I could write some kind of parser that renders those notes as they are written, with some minimal changes, into something that looks as if it was rendered from Markdown. It was a pretty fun challenge - involving some large number of regexps straight from hell, for detecting all the code fragments automatically - but in the end, the result is better than I expected: For now, I’ve added all my notes from last year’s WWDC - you can view them as one page with all contents or as an index of titles. I was planning to add some older ones too, but I ran out of time. I’m planning to add notes from the current WWDC as I watch the videos - you will be able to see them here :) RSS feeds I’ve also updated my RSS (Atom) feeds - there are now 3 separate feeds: main blog feed (with classic long posts): https://mackuba.eu/feed.xml notes feed: https://mackuba.eu/feed-notes.xml complete feed with both posts & notes: https://mackuba.eu/feed-all.xml Previously I’ve been using a FeedBurner proxy URL for the feed. If you’re reading this through your feed reader app, check what URL you’re subscribed to - if you’re subscribed to the FeedBurner one, please update it to the direct link from above (blog feed or complete) - the FeedBurner one probably won’t work forever (Google bought the service long time ago, and you know what happens to services that are bought by Google).
CocoaMac
MacKuba blog
MacKuba blog
May 26, 2020
I'm building an ad blocker
Since my update to the iOS version of Banner Hunter was rejected by app review, the app’s been in a kind of Schrödinger state, both dead and alive. It’s still selling those few copies a week, and I’m updating the blocklist, but I’m afraid to make any updates to the Mac app now… So since then I started looking for some other ideas for new apps I could build instead. One thing I started working on is a Chrome version of Banner Hunter. I wasn’t really planning to do it before, but since Apple pushed me now… I might as well give it a try. I have no idea if it’s possible to make any money on Google Store, since the vast majority of extensions are free, but we’ll see. The main part of the app is done, but I need to work on the non-technical parts like graphics and copy, and it will probably have to wait until late summer at least. I’ve got another idea though which has kind of come up by itself, which is… to build an ad blocker for Safari. (TLDR: here’s the landing page.) Researching the options I’ve been a long time user of Ghostery before, since it was closest to what I want from an ad blocker and it worked well. But since I upgraded to Catalina and Safari 13, I had to finally let go of the old Ghostery extension, and the new “Ghostery Lite” is just not as good as the old one. So I started looking for alternatives. Turns out, there aren’t really that many good, reputable, popular ad blockers on the Mac App Store - I think it’s easily a single-digit number. I’ve tried a few, but I wasn’t completely happy with any of them. That doesn’t mean they’re not objectively good - they should work fine for a lot of people, possibly most people - but it’s just not what I personally want. Here’s what I want from an ideal ad blocker: it should mercilessly block any unnecessary code loaded from external sources that slows down page load and sends tracking cookies who knows where - this conveniently blocks almost all ads, but it should also block any non-ad things that spy on me (like Google Analytics or Facebook tracking pixels) it should NOT try to globally block any resource and any div on any page that includes the word “ad”, “banner”, “popup” etc. - I believe this makes it way too easy to hit false positives and randomly break some innocent sites in the process (and it seems to be much easier to detect for anti-adblockers, which usually create a “bait” div that screams “this box is an ad, block me!”); but unfortunately most public ad lists seem to work this way it should not try to do so much that it becomes bloated in some way, or needs to be split across several separate content blockers, etc. it should allow some basic configuration like site whitelisting it should have a native look & feel Most of the apps I’ve tried were either doing way too much for me (e.g. 1Blocker - 8 content blockers and requires a subscription, Wipr - 3 blockers) or too little (Ka-Block - just ~500 rules, or Wipr’s no whitelisting by design), often also didn’t look right in t…
CocoaMac