Year 2 Issue 9

Before we begin I’d like to plug TIL. TIL is a podcast experiment that I just started. If you are enjoying receiving weekly news via The iOS Times then you might be interested in a daily podcast, never longer that 3 minutes, in which I share little coding tips, lesson learned and useful tools. Head over to briefs.fm/til to find out more. If you are reading this on your phone hit the links below to open the respective podcast app:

Kitura

IBM released this HTTP server written in Swift and compatible with Linux that you can run on their Bluemix platform. It is very exciting to see a company like IBM putting a lot of effort into supporting cross platform Swift and making new kind of usages for the language possible.

In the project’s README you’ll find detailed instructions on how to use and setup Kitura. I was particularly impressed by the variety of options, including Docker, Vagrant and SPM

Swifton

And speaking of cross platform Swift, here’s a web framework inspired by Ruby on Rails. Swifton by the Necolt team provides the a model, view, controller, router architecture that will feel very familiar and easy to use both to iOS and RoR developers.

Validated

This little brilliant framework allows you to leverage Swift’s type system to build “somewhat dependent types”, as the author calls them, types that provide a failable intializer performing validation on them.

struct User { ... }

struct LoggedInValidator: Validator {

  static func validate(value: User) -> Bool {
    return value.loggedIn
  }
}

typealias LoggedInUser = Validated<User, LoggedInValidator>

The LoggedInUser has a failable initializer that takes a User. If the passed in User fulfils the logged-in requirement you will have a LoggedInUser, otherwise nil. The underlying value (the full User value) is stored in the value property of LoggedInUser.

I really like the approach this library take to validation, how it uses the type system, and separates the concerns.

Take a look at the project’s README for more information on what you can achieve with Validated.

QuickActions

This framework enables you to defined iOS Home Screen Quick Actions, the shortcuts that appear when you press the app icon on iPhone 6s and 6s+, in code rather than via the app’s Info.plist.

Hue

Can you guess what a library called Hue is all about? 😁

This powerful color library provides you all the feature you need to define and manipulate colors with ease: colors from hex code, alpha manipulation, gradients, computed properties like isDarkerThan, and much more.

fluent

Fluent is a Swift ORM implementing the Active Record which will come in handy when you’ll start working on all your Swift web apps, maybe using Kitura and Swifton projects that we mentioned above, or maybe Vapor the web framework that the library authors have developed and that we linked in issue 2.04

Fluent requires Swift 2.2, and at the moment only supports SQLite, but drivers for MySQL and MongoDB are on their way.

SocketIOChat

This sample app showcase how to use the Socke.IO client for iOS to build a chat application in Swift. You can learn all about it in the tutorial.

WESlider

A light weight UISlider subclass with chapter management.

WESlider Demo

RealReachability

This library aims to provide a way to get the real reachability status of the network, quoting from the project’s README:

Apple doc tells us something about SCNetworkReachability API: “Note that reachability does not guarantee that the data packet will actually be received by the host.”

We introduce ping module for us to check the real network status, together with SCNetworkReachability API. And we use FSM (finite state machine) to control all of the network status to confirm that only status change will be sent to application.

I think it is worth trying it out to see how it’s accuracy compares with the Apple’s framework and other open source alternatives.

RealmIncrementalStore

A Realm-powered Core Data persistent store. It sounds crazy but is a remarkable idea. Quoting the README:

[Core Data] is a very stable ORM framework and it works on top of any persistent store.

Here’s the kicker: Core Data is stuck with SQLite until a better lightweight DB comes along, and Realm’s database engine is phenomenal but its Cocoa framework is still lacking some features.

NSIncrementalStore interface lets us use the best of both worlds. RealmIncrementalStore is an NSIncrementalStore subclass that dynamically creates Realm schema using your Core Data models.

As the author declares this project is still in the proof of concept stage, and I would be personally concerned of the performances of this approach and the extra abstraction layer that it introduces, but I find that the idea and implementation deserve credit.

Other Interesting Projects