Recently I've been spending time getting know the Swift language a bit better going beyond just applying my existing Object-C programming skills. I picked up a copy of Functional Programming in Swift, which has so far been an interesting read. The more I learn about Swift the more I can feel the push towards a functional programming style, or at least a mix of functional and object-oriented views on a system.
This week I thought I'd write about the steps I go through when setting up a simple Swift project for iOS. This is as much for my own benefit as yours, as writing all this down helps solidify the process in my mind as well as giving me a handy place to look up the bits I often forget.
Obviously setup varies from project to project but there's a minimum foundation that is good build on. These instructions describe setting up a dummy project called Animals that includes package manager integration and a unit test framework that augments XCTest. It uses the Swift language and iOS, but a lot of what's covered can apply to any Mac or iOS project created through XCode. Anyway, enough senseless rambling, lets get to it...
I've released an update to KILabel to Github that brings the code to an official 1.0 version. KILabel is a replacement for UILabel that allows links to be embedded in the displayed text. It highlights Twitter style usernames, hashtags and URLs and allows the developer to use blocks to respond to taps on them. The design attempts to copy the look and feel of Tweet labels in the official Twitter iOS app and should be useful to anyone wanting to present Tweets or other messages in a way that is familiar to users. I originally wrote about it on my old personal blog Embed links in a UILabel - MatthewStyles.com which has more background on how it works.
The code has remained reasonably static over the last 12 months but I wanted to clean things up a bit and update the example code to address some of the issues people have had. Here's a quick summary of the changes...
Hello and welcome to the new Compiled Creations website. This site has been in limbo since I originally registered the domain, so this overhaul is long overdue. It's very light on content at the moment but that's something I hope to rectify over the coming months.
So what's the plan going forward?