Trifork Blog

Axon Framework, DDD, Microservices

Category ‘Swift’

Server side applications in Apple’s Swift

May 2nd, 2016 by
(http://blog.trifork.com/2016/05/02/server-side-applications-in-apples-swift/)

In 2014, Apple announced the release of Swift, a new programming language for all their platforms. Their programming language of choice on iOS and OSX has always been Objective-c, a language which is a bit dated (it predates C++) and as it has had new features (and syntaxes) bolted onto it every few years, it carries quite a bit of baggage. It seems I wasn’t the only one with this opinion, as the release of swift was greeted with great enthusiasm, and has been adopted very rapidly.

Swift combines all the features that are fashionable in a general purpose language today, without the feeling that they were bolted on after the fact. While building an iOS client for our customer Gerimedica in swift, I found myself wishing I could use this language on the server side as well as in the client. At WWDC 2015, Apple announced the intention to open source the language, and release a Linux version, so it looked like it could become a reality. Since december 2015, the sources have been available on github, and builds for OSX and Ubuntu are made available roughly twice per month.

PerfectLib

A number of groups and companies saw an opportunity to be among the first with something that was obviously going to be big. One of the first was PerfectSoft, a startup that aims to be the one big framework for all your server side development in swift. They started building their framework as soon as the open source release of swift was announced, and have been advertising their product everywhere. Because they started development before anyone outside Cupertino had a good idea what the release would look like, it only worked on OSX at first, and it didn’t use the Swift Package Manager, the intended default build and dependency management tool for swift. At the time, the framework compiled to one big binary, that you had to include in your build manually. They have a beautiful website and good documentation, but it just wasn’t working when I tried it. I intend to try this framework out again at a later date.

IBM

The biggest player (other than Apple) to openly jump on the swift bandwagon is IBM. As soon as the open source release of Swift was announced, IBM announced the Swift Sandbox, their Swift based version of google’s golang playground. It is a web based repl that can be shared online by sharing a URL. Cool, but not extremely useful, as unlike go, swift already comes with a repl. The real significance of this is not the swift sandbox itself, but the message that IBM is interested in this technology and intends to be involved. IBM isn’t the kind of company to back technologies just because they like them, so they either see an opportunity, or a potential strategic interest. At the moment, IBM’s swift related activities seem to be associated with their PaaS solution BlueMix, so they are likely working on the Swift / IBM version of google’s app engine for go. IBM offers its own web framework for swift: kitura. Kitura turns out to be less than trivial to install and for now somewhat bare bones, but as this is IBM, it is worth dedicating another blog post to it at a later date. Also check out their overview of the most popular, most active and most essential open source projects on github for swift.

Read the rest of this entry »

WWDC 2015: Auto Layout improvements

June 22nd, 2015 by
(http://blog.trifork.com/2015/06/22/wwdc-2015-auto-layout-improvements/)

mysteries-of-auto-layout
Last weekend I arrived home safe and sound, already missing San Francisco. I had a wonderful time there and I have lots to talk about, but there was one topic in particular I think was not highlighted enough. That’s why I want to discuss it here. It was discussed in the following talks during WWDC:

Mysteries of Auto Layout – part 1
Mysteries of Auto Layout – part 2

I am a big fan of auto layout since it was introduced in iOS 6 and especially by using it directly in code, not by using Storyboard. But when using it in code it can get really verbose. I wrote some classes around that to make the resulting code much more compact. I wasn’t happy with my solution. So I was planning to go to a Lab during WWDC, to ask an actual Apple auto-layout engineer for his opinion about this matter. But it turned out I didn’t have to! Apple solved most of the problems I was having with Auto Layout with new API’s in iOS 9! In this blog I want to highlight those new API’s which make it easier to work with Auto Layout both in code and in Storyboard!
Read the rest of this entry »