Swatches is on the App Store!

I've been messing around with SwiftUI, which means iOS 13, which means supporting Dark Mode. And increasingly I was finding that I was worrying about testing against dark mode, and picking out color choices became increasingly annoying. Ultimately I stopped working on the Today Timer rewrite to instead make myself a simple little developer utility that showed all of the colors and could toggle Dark Mode inside the app. And from there the app got a little out of control 😀

I ended up deciding that I wanted to experiment with the crossplatform capabilities of SwiftUI, so I added watchOS, tvOS, and macOS (via Catalyst) support to the app, and a few more features as I dug into it. Also I wanted to learn how to use Fastlane for making the bajillion icons and screenshots you need for a modern iOS app. Final result was Swatches, which I open sourced for non-commercial use and also made available for free in the iOS App Store. (The other platforms will be available soonish, as I work through getting the metadata cleaned up for the additional platforms. You can read more about Swatches or grab it from the iOS app store:

iOS 13, Unit Tests, and Mocking a SceneDelegate

I've been working through the exercises in the excellent iOS Unit Testing by Example book by Jon Reid, which I highly recommend. However, the book is in beta at the moment and there are some curveballs thrown by iOS 13 that aren't handled in the text yet. Specifically, when I hit the section about using a testing AppDelegate class I thought "This is very good. But what about the SceneDelegate?"

That kicked off quite the odyssey to be honest. If this is interesting to you I wrote up a Gist documenting what I found, and a partial solution to the issue.

WatchKit UI Colors

When I was developing the first version of the watch app for Today Timer I noticed something a bit odd. For a running or paused timer I was setting the background color of the table row for that timer. The docs say that that if you set the background color of a WKInterfaceGroup to nil the group uses the default background color of clear. Which I think is true, but the table sets the row background color to a what looks like a really dark gray. After some digging around I came up with a file named Guide_ButtonTable_Rows_Colors.psd that you can download from the Watch Human Interface Guidelines (look under Resources->Guides).

Turns out the WKInterfaceGroup provided for a table row is configured as a "platter" so it has this platter color, which is actually a pretty bright white at a very low alpha. (RGB 242, 244, 252 at 14% opacity.) Since I was overwriting the background color when I wanted to "clear" that change I needed to set back this custom color in order to make everything look right.

I've used a category on UIColor that provides the colors used in iOS7 style UI for a while, here's the original repository and here's my fork which makes the code compile with -Wno-semicolon-before-method-body and adds the default tint color. So I wanted something similar, but I didn't think the WatchKit colors belongs in iOS7Colors. I just pushed a UIColor Swift extension to GitHub. Although it's written in Swift you can drop it in an Objective-C project and use it. There's a sample app in the repository that shows the colors and how to use it.

If you're coding WatchKit hopefully you'll find this useful!

Hearthstone! For the Horde!

I should write a bit about Hearthstone. I signed up last year when it launched in open beta but sometime after the iPad version hit it sunk hooks in me but good. I suspect it was probably the videogame I spent the most time with in 2014 and while Destiny made a bid for competing in 2015 I can see where my Destiny time is already beginning to taper off a bit while I still play Hearthstone at least four or five nights a week. Yesterday I decided not to update my bounties in Destiny but I made sure to log in and kill at least one Hearthstone quest so I could get a new one today.

On the one hand, I'm not surprised at Hearthstone grabbing me: it pushes enough of the Magic: The Gathering buttons and the digital version isn't … look I'm trying to be nicer in my public persona in my middle age so let's just say when I quit playing Magic Online I was confident that it wasn't me it was them. It's been like a decade and they still don't have the mode (League) I liked the most back in MTGO. But a decent OS X client would probably get me playing again, I just don't think that will happen. So yeah, there are known hooks into my attention that have lain fallow lo these many years.

On the other hand, an online-only, adversarial game? Not my bag baby. Never has been. I have some friends who claim to play (eyes Bwana) but I don't have any friends who ever actually log into the thing. I was really surprised to realize that the crux of why I like Hearthstone was this simple fact: you can't chat with your opponent. There are six emotes you can say and they are basic things: Greetings, Well Played, Oops, Sorry and so forth. That's it. And if somebody is being rude/obnoxious/annoying with that limited palette you can squelch 'em in two taps. It's weird how liberating that is. And if somebody plays well, and accepts the outcome of the game with good grace you can friend them later and THEN have text chat. I've had a couple of times where I exchanged a bit of dialog post-match with my opponent and they have been really satisfactory interactions. I assume the racist, homophobic tweens who dominate Xbox Live don't make it through the "play an entire game without being an ass-hat" filter because I've never sent nor accepted a friend request in Hearthstone and then not liked whatever interaction has occurred afterward.

In the last year there have been two expansions to Hearthstone: the "adventure" that was Curse of Naxxramas in late July through August, and the first expansion of Goblins vs. Gnomes in December. Naxxramas in particular because it was interesting: a single-player expansion that rolled out a bit at a time. For five weeks they put a new "wing" of Naxxramas up and each wing had a few AI's with special decks and powers. As you beat the encounters you would unlock cards for your collection, usually a card that you had just played against. So as an "expansion" it was small: I think it was 30 cards spread over a five week window but as the cards were revealed and dropped in the metagame would change. Naxxramas was a really fun time to play the game. I don't have as much to say about GvG, which is more of a traditional expansion, something like 120 cards. I like it fine and I think it did a great job of shaking up the game.

So yeah, Hearthstone. If you play it drop me a line with your BattleNet ID and I'll add you to my friends list. The game itself is free and in fact you play quite a bit without buying anything meaningful. I've bought some cards but not a ton and I get most of my cards through playing the game and earning in-game gold. So if you think you are at all interested I'd say grab the client and give it a whirl!