Latest 1.0.2
License MIT
Platforms ios 6.0, osx 10.8, requires ARC

Build Status

SwiftyAs is an Objective-C kinda way to do as? casting like in Swift.

The gist

In Swift, you can do:

let source: AnyObject = NSDictionary()

let array: source as? NSArray
// array = nil
let dict: source as? NSDictionary
// dict = source

With SwiftyAs you can do the same in Objective-C:

NSObject *source = [NSDictionary new];

NSArray* array =;
// array = nil
NSDictionary* dict =;
// dict = source

And that’s about it. You can do the same with a isKindOfClass: check, of course, because that’s what this just is. It’s only wrapped a little nicer.


SwiftyAs is published under the MIT License.

See LICENSE for the full license.

Latest podspec

    "name": "SwiftyAs",
    "platforms": {
        "ios": "6.0",
        "osx": "10.8"
    "version": "1.0.2",
    "summary": "**SwiftyAs** is an Objective-C kinda way to do `as?` casting like in Swift.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "social_media_url": "",
    "authors": {
        "Tom Adriaenssen": ""
    "source": {
        "git": "",
        "tag": "1.0.2"
    "source_files": "SwiftyAs/*.{h,m}",
    "requires_arc": true

Pin It on Pinterest

Share This