Skip to content

ReDetection/SwiftyObjC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftyObjC

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.

About

Type Inference for Objective-C and iflet sugar, finally as a cocoapod.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors