Scott James Remnant

I can dance if I want to

Read this first

Xcode: two Apps with a shared private Framework, in a WorkSpace

I’ve been working on a reasonably large iOS project that has ended up consisting of multiple, related, iOS apps for which I’ve wanted to share a large amount of code through the use of shared, private, frameworks. This seems like it should be simple, but instead I’ve run into all kinds of issues.

When building, you might end up with a warning about a missing directory:

ld: warning: directory not found for option '-F…/build/Debug-iphoneos'

When trying to start the app in the iOS Simulator, without Xcode attached, it might crash with the error image not found:

Dyld Error Message:
  Library not loaded: @rpath/….framework/…
  Referenced from: …/Library/Developer/CoreSimulator/Devices/…
  Reason: image not found

If you try and run the app on a iOS device at all, whether with Xcode attached or not, you might also end up with an image not found error:

dyld: Library not loaded:

Continue reading →

Watch Shot

Sharing screenshots from the WATCH with your friends just doesn’t quite work out…

Screen Shot 2015-05-15 at 1.16.54 PM.png

Thanks to the dark background, and lack of margin between the UI and the edge of the screenshot, they end up looking kinda weird.

So I wrote Watch Shot, which makes images that are much more elegant for sharing.

Screen Shot 2015-05-15 at 1.17.05 PM.png

You can even select the specific Apple Watch model that you want to share your screenshot on.


Continue reading →

Custom iOS segues, transitions, and animations the right way

Let’s take a simple scenario: you have two UIViewControllers within a UINavigationController and you want the transition between them, in both directions, to be a fade-in effect rather than the usual slide-in/out effect.

There’s a lot of bad examples out there of how to do this. If you see anything suggesting you should call UIView.animateWithDuration inside a custom UIStoryboardSegue class, stop right there, and be glad you read this post.

Unfortunately even Apple’s documentation implies that you should do this, but it just hasn’t been updated to the more powerful approach introduced in iOS 7.

I’m going to show you the right way. It takes a few minutes longer to get your head around it, but once you do, you’ll have a lot more power for your custom transitions. You can follow along using the Xcode Master-Detail Application template.

Screen Shot 2015-05-13 at 11.28.09 AM.png

 Segues vs Transitions

I’m going to divide the...

Continue reading →

RIP Sir pterry

I used to boast that I was the proud owner of a complete collection of unsigned Terry Pratchett hardcover first editions.

This was a particularly pleasing concept to me because Terry was such a prolific author, who reached out to his fans more than he needed, that it was always easy to get your books signed. In fact, he’d often allow you to bring any other books of his you might own to a book signing for a new book, and he’d find time to sign those too.

Keeping them unsigned was actually harder work than having him sign them.

Harder than you might think.

He would actually break into your house in the middle of the night, and sign books while you’re slept. That’s how my copy of Soul Music ended up signed, and why I cannot boast anymore.

Of course the rational part of me knows that the reality of the situation is that my original copy went mysteriously missing during my move to the...

Continue reading →

The changing face of Top Gear


“Yes! We’re older, we’re fatter, we’re greyer. But we’re back!”

“A few years ago we staged a race across London. We used a car, public transport, bicycle, and a speed boat down the river Thames. And it was one of our more genuinely interesting tests.”

“We decided we would re-run the race.”

It’s true, they did. In Episode 5 of Series 10, in fact. More than a few years, as it turns out. Way back in 2007, and over half of the run of the series ago.

Thanks to the wonders of digital recordings, this gives us something of a unique opportunity to compare the setup for the two races, and really highlight how this show has changed in the last eight years.

To do that, we need to rewind time…


Now you’re not going to get any Daily Mail crap here. I still think that Top Gear is a great show. I just think that it used to be a greater show, and this particular challenge really reveals to me...

Continue reading →

Restored some older posts

You can always use the Internet Archive to access older content, but there were a few key posts that people kept coming to my blog for.

Since they were useful documentation in their own right, and one of the things I like to do with this blog is missing documentation pieces, it seemed appropriate to restore and reformat them.

The restored articles are:

  • Hiding arguments from ps
  • The Proc Connector and Socket Filters
  • Tracing on Linux

These all still appeared in the top 10 landing pages on the blog, even though the content has been missing for some time.

I decided not to resurrect any of the popular Upstart-related posts, even though they were intended as documentation, since one can now consider it deprecated and unmaintained.

Continue reading →

Swift: Storing key pairs in the keyring

In my last blog post I described how to generate public/private key pairs in Swift and use them to encrypt and decrypt text. But that’s not entirely useful in its own unless you have a place to store the pairs, such as the iOS keychain.

Eagle-eyed readers may have also noticed that I skipped one important detail when discussing generating keys:

var publicKeyPtr, privateKeyPtr: Unmanaged<SecKey>?
result = SecKeyGeneratePair(parameters, &publicKeyPtr, &privateKeyPtr)

I never specified the parameters dictionary anywhere.

Unfortunately this involves wading into the murkier parts of the compatibility between Swift, Foundation and Core Foundation: the compatibility between the different array and dictionary types, and the different type strictness required for protocol conformance.

Consider the basic dictionary that we would pass for a 2048-bit RSA key:

// ⚠︎ Type 'CFStringRef' does not

Continue reading →

Swift: Generating keys, and Encrypting and Decrypting text

Swift is still a very new programming language and as such there hasn’t been time yet for a large body of lore about the correct way to do things to be built up on the Internet. Apple have done a good job on the initial documentation, but the deep technical understanding of things, like the built-in protocols the language uses, hasn’t been built yet.

For a project I needed to be able to generate a public/private key pair, and then use those to encrypt and decrypt plain text. This requires a set of C APIs defined in Certificate, Key, and Trust Services Reference.

When I looked for examples on how to use these in Swift, I found some pretty terrible code out there. To me that’s always a warning sign; if code looks difficult and unwieldy to use, you’re probably doing it wrong. Of course, being a new language, it could be that Apple is doing it wrong, but in general the Swift language and...

Continue reading →

The Slacker List

It’s been six weeks since Apple launched the iPhone 6 and iPhone 6 Plus, and over four months since WWDC when Apple revealed the changes to the AutoLayout APIs to enable apps to adapt to the larger screen sizes of the upcoming phones.

You’d think that this would be plenty of time for app developers to grab the new Xcode, test their app with the larger sizes, fix any resulting problems, and release an update.

I wonder how much of this delay is fear of the slow adoption of iOS 8, with 53% of devices running an older version as of October 5th, there could be fear from developers that supporting the newer AutoLayout APIs would put a significant portion of their userbase at risk.

Perhaps that’s why Apple are forcing all newly submitted apps to be built with the iOS 8 SDK.

The rest of this post constitutes the list of apps installed on my iPhone that are still running in scaled mode.


Continue reading →

Happy 10th Birthday, Ubuntu

20th October 2004, ten years ago today, Ubuntu 4.10 (Warty Warthog) was released. While the user community celebrates the decade anniversary today, for me and those of us who worked on it, it was the result of almost eight months of work.


My story, in common with the majority of the original group, really begins with the Debian Project. I had taken a year off full-time work and had been concentrating on involving myself more with the Linux community in general, and Debian in particular.

By early 2004, the then Debian Project Leader, Martin Michlmayr had asked me to step in and take over the maintenance of Dpkg, the central package management software of the operating system. I was invited to attend the Open Source World Conference in Málaga, Spain and meet with other developers there, in particular Colin Watson and Tollef Fog Heen, to figure out the details of how we’d go about that.


Continue reading →