Stephen Radford
  • Blog
  • Email
Sign in Subscribe

Code

A collection of 2 posts
Swift

Swift "AnyClass" Type

TL;DR you're looking for MyClass.self When working with ConnectSDK, I came across something I hadn't before in Swift: the AnyClass type. ConnectSDK [http://connectsdk.com] is an Objective-C based library so I'd imagine this is a rarity when working with native Swift
05 Sep 2015 1 min read
Development

Creating a sharedInstance in Swift

Or, "How the fuck to I make a singleton?" One of the patterns that seems to be very common in Cocoa is the sharedInstance pattern. You can see it in a few of the native classes to UIKit and Cocoa. For example: * In UIApplication you havesharedApplication which returns
03 Aug 2015 1 min read
Page 1 of 1
Stephen Radford © 2025
  • Twitter
Powered by Ghost