Latest 1.0.0
Homepage https://github.com/ReDetection/SwiftyObjC
License MIT
Platforms ios 8.0
Authors
let a = @"hello"; //a is `NSString *const` now
a = @"world"; //produces error

var b = 5; //b is `const int` now
b = 10; //fine

iflet(c, [self getNullableString]) {
    // c is not nil here
}
// c is not available here

ifletwhere(c, [self getNullableString], c.length > 5) {
    // can have additional constraints
}

Requirements

Xcode 8

Installation

SwiftyObjC is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SwiftyObjC'

guard/guard let

They are possible but not implemented because it has two significant flaws:

  • I can’t ensure else block has return/throw at compile time. Without this I find it too dangerous
  • I can’t ensure one wrote else keyword, so again dangerous.

However, I’m looking forward to implement these, so if you found a way how to trick compiler, feel file a note or PR.

License

SwiftyObjC is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SwiftyObjC",
    "version": "1.0.0",
    "summary": "Get your Objective-C more swifty with type inference and if-let syntax",
    "homepage": "https://github.com/ReDetection/SwiftyObjC",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ReDetection": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ReDetection/SwiftyObjC.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SwiftyObjC/**/*"
}

Pin It on Pinterest

Share This