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
Tag Archives: Swift SDK
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:
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!
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.
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>
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: