Latest 2.0.2
Homepage https://github.com/oleander/SwiftTryCatch
License MIT
Platforms osx 10.9
Authors ,

SwiftTryCatch

Adds try/catch support for Swift.

Simple wrapper built around Objective-C @try/@catch/@finally.

Usage

Install via Cocoapods

pod 'SwiftTryCatch'

Create bridging header (not necessary if using use_frameworks! flag in PodFile)

  • When prompted with "Would you like to configure an Obj-C bridging header?", press "Yes".
  • Go to bridging header and add:

    #import "SwiftTryCatch.h"

Use

SwiftTryCatch.tryRun({
         // try something
     }, catchRun: { (error) in
         println("(error.description)")
     }, finallyRun: {
         // close resources
})

Latest podspec

{
    "name": "SwiftTryCatch2",
    "version": "2.0.2",
    "summary": "Adds try-catch support for Swift",
    "description": "Adds try-catch support for Swift via CocoaPods",
    "homepage": "https://github.com/oleander/SwiftTryCatch",
    "license": "MIT",
    "authors": {
        "William Falcon": "[email protected]",
        "Linus Oleander": "[email protected]"
    },
    "source": {
        "git": "https://github.com/oleander/SwiftTryCatch.git",
        "tag": "2.0.2"
    },
    "source_files": "SwiftTryCatch.{h,m}",
    "platforms": {
        "osx": "10.9"
    }
}

Pin It on Pinterest

Share This