Anders Borum is an independent software developer intensely interested in using tablets and phones for programming. Since 2014 he has been making Working Copy, a Git client for iOS.
Do you want to code on your iPad? Wondering why iOS itself cannot run the development tools for iOS apps? Are your fingers itching to do programming while on the go? Anders Borum created Working Copy to address these challenges.
My reasons to use Bitrise are not typical: the value of build-servers for continuous integration increases with team size but I work alone and running tests locally works well for my small setup. However, I will show how Bitrise can also be used to do iOS development on an iOS device, which means that you can develop your app on your iPad.
I will guide you through an app I am working on.
Typing on a touchscreen
I am developing a small game to train typing on touchscreen keyboards, hoping to increase speed and decrease error rate. The game also tries to settle a decade-old argument between programmers and you have to take sides: tab or space.
Let's have a look:
The game isn’t complete yet and lots of things need work: I want to focus on the bottom of the startup screen. Also, there is no movement when waiting for the user to pick between the tab or the space key, and I would like “Intergalactic Type Safety” to animate into place and I have an idea for an old-school effect. I'll keep working on it. :)
iOS development without Xcode
The game is a native iOS application requiring Xcode to build. I have my iPad with me most of the time, but no regular computer and thus no Xcode. My iPad does have Swift Playgrounds, a programming environment that focuses on showing immediate results as you code. I prototype the typing animation inside Swift Playgrounds and the resulting code is easy to integrate in the Xcode project.
The playground shown in the video displays a view controller and makes two instances of my custom writer-effect labels. You can see how numbers, strings and colors are displayed to the right of the code expressions producing these values. This makes Swift Playgrounds a very nice tool for trying out new ideas.
It would make an excruciating video if I was to show how the writer-effect was programmed, especially since I hadn't used CADisplayLink for years and had to research the documentation. The video shows me making adjustments to the colors of the labels.
When transferring work from the Swift Playground to the Xcode project I only need the label class itself, which is why you see me copying out some of the file. If I was to continue working in Swift Playgrounds later on, I would keep AnimatedLabel in a file of its own.
Now I need a computer running Xcode to build the app. Fortunately, Bitrise provides this just by pushing to a Git remote. So I start a build and a few minutes later Bitrise delivers the result by email saying it failed.
The value of good log files
A few minutes later Bitrise delivers the result by email saying the build failed. 😒
The email contains a link to the status page including the build log. Opening this in Safari and invoking the share sheet, I can use Open in Working Copy to send the log back into the app. When looking at the log inside Working Copy it needs to be associated with the correct repository and any filenames mentioned in the log will link to the source code.
The Bitrise log mentions the filename and the line number with the error and so I can jump right in to fix it. Push a commit to trigger a new build on Bitrise.
Installing a successful build
The second time was the charm and after a successful build, Bitrise sent me a link to install the new build.
Bitrise sent me a status email like it had done for the last build, but as everything is working, the second email containing a link to install the app is more relevant. It feels weirdly satisfying to install the app on the device where it was developed. 😄
Try it yourself!
I am no expert in build servers or continuous integration. It is a huge credit to Bitrise that their workflow configuration is powerful yet simple enough that I can fully build and install my app using the service.
You can find the game on BitBucket if you want to test your iOS development or your typing skills. Working Copy is available on the iOS App Store.