How my open source project got trending on GitHub

I have been working on a mildly popular Xcode plugin Peckham since late 2013 when Xcode plugins were at the height of popularity induced by yet another Xcode plugin Alcatraz, which served as a distribution and discovery channel. Things went quite well, we were updating the DVTPlugInCompatibilityUUIDs on almost every Xcode release, because that’s how Apple supposedly filtered out the crashes that came from plugins vs actual Xcode crashes. Fun fun fun!

Hell hell hell!
When Xcode 8 beta came out, we couldn’t make the plugins fire up. All hell broke loose in this Alcatraz issue discussion. There’s a way to fix it but it’s bad because it involves removing code signing from your Xcode which exposes you to attacks like XcodeGhost.

Apple, being a good samaritan, exposed a great new API for making Xcode Source Editor Extensions — XcodeKit. How great is it? Well it’s 3 classes and 2 protocols great. Now, I’m a big fan of small public API-s but this doesn’t expose even a glint of functionality that we were able to access by hacking Xcode itself. What do you do when you see some functionality missing? You file a Radar!

Or you fudge it! 
Meet Import. I was looking for a way to implement the functionality we have provided in Peckham, which was to add #import statements from anywhere in the code. I was chatting to Clement, a collaborator on Peckham, how to do it and all of the ideas we’ve had seemed like herculean efforts to provide a simple functionality. I almost gave up.

Then one day I was coding in Swift and started writing an import statement inside a function, and lo and behold Xcode’s autocomplete fired up and gave me this:

Xcode autocompleting inside a method

Heureka!
So now all I needed to do was to write an Xcode Source Editor Extension that moves that autocompleted beautifulness to the right place in the source file. Easy peasy because that tiny API I mentioned before is really simple to work with. So I had that done pretty quick, but now I was worried about how easy it was to actually run this thing on my Xcode and other people’s Xcodes? I wanted to make it look good as well, so I spent the next few hours making an app icon 😬. Also, what seemed to work best was that the container app would inject the keyboard shortcut CMD+CTRL+P (tribute to Peckham) directly to a plist, and make it work automagically in Xcode. Back to coding…

About 12 hours later… 
I had a container app

Import container macOS app

with an amazing icon

an amazing icon

and a working extension

Import extension hard at work in Xcode

so I wanted to publish this on GitHub. Also, I wanted people to actually know about it and use it. I was familiar with maniacdev.com, cocoacontrols.com and ProductHunt, and applied for them, but I wanted something more, so I googled for something like “how do you market your open source app”, which turned out to be pretty useless... Then I turned to newsletters, so I went to awesome-ios and checked how to apply my amazing new project to one of them. I really had no clue how this was going to work unless I sent tweets and hoped that someone sees them. Luckily enough iOS-Goodies newsletter is now open source, so I went and made a pull request. Next thing you know it was merged, so I was pretty sure it was going to come out in the next issue which it did.

Profit! 
I actually didn’t do anything else but then magic started happening; Jake Marsh published it on littlebitesofcocoa.com, NatashaTheRobot published it in her newsletter, and then finally it was published on Dave Verwer’s iOSDevWeekly. In short time, the repo was trending on GitHub in Swift and stars and issues kept coming in.

Cum grano salis
While I know this was probably a streak of good luck, because making and marketing anything is really hard, I hope this helps you get some exposure in the open source community. If you’ve created something great that everyone should know about, don’t be afraid to go that extra mile and get the word out using any channel that you can possibly imagine, because sometimes it pays off.

Show your support

Clapping shows how much you appreciated Marko Hlebar’s story.