Tag Archives: Swift SDK

More About main.swift and the Cocoa Application Startup Sequence


via More About main.swift and the Cocoa Application Startup Sequence | let, var, go!.

A while back I wrote this post about creating your own main.swift file for launching a Cocoa application. I’ve since realized that the code I provided contains a bug that can cause all kinds of problems. This update provides the fix and relates some additional information about the Cocoa application startup process

Every Swift Value Type Should Be Equatable


via Every Swift Value Type Should Be Equatable – Andrew Bancroft.

As I listened to the WWDC15 talk on Building Better Apps with Value Types in SwiftI was struck by a sentence that I had never dawned on me before:

Using a Nested Type in Swift


via Using a Nested Type in Swift — Coding Explorer Blog.

In my previous post Classes In Swift — An Introduction, I mentioned that I should probably use an enumeration to denote what the status of my Message was (whether it was sent, received, or read).  Now, I could write a full MessageStatus enumeration with its own file that could be imported into any project, and that would work.  But really, this status is only supposed to talk about my custom class here, about my “Message” class.  Why go through all of the hassle to make this some generic MessageStatus enumeration that could be used on messages completely unrelated to my Message class?

This is exactly where we would want to use a nested type!

Swift: Common Auto Layout scenarios for UIStackView


via Swift: Common Auto Layout scenarios for UIStackView.

If you are using content with an intrinsic size (e.g. a collection of UIImageViews), then you are likely to want to allow a UIStackView to freely expand around the content. In order to do this I think there are only really a limited set of common scenarios, which can be very simply divided into two.

Firebase and RxSwift Extension Methods


via Firebase and RxSwift Extension Methods | waltza.

If you’re a Firebase aficionado and a fan of highly composable, asynchronous, event based iOS apps, then you’ve come to the right place.

Firebase’s iOS APIs are block/closure based. It’s nice and simple but once you application becomes highly reactive, stabbing closures with nested if/else statements and logical handles will come to haunt you. That’s why I subscribe to the Reactive Extensions libraries whenever I can!

Like’s reactify your Firebase event listeners into proper RxSwift Observable<FDataSnapShot>

The ABC of Making a UIAlertViewController Popover in Swift (Xcode 7 beta 2; iOS 9)


via The ABC of Making a UIAlertViewController Popover in Swift (Xcode 7 beta 2; iOS 9).

Last time we looked at making a UIImagePickerController popover, and this time we do something very similar but slightly different. We start by creating a UIAlertController instance:

What’s New In Swift 2.0


via What’s New In Swift 2.0.

What’s New

There are 3 major features in Swift 2.0 that are new:

  1. Protocol Improvements
  2. Error Handling
  3. Control Flow