Latest 1.0.1
Homepage https://github.com/jaredsinclair/JTSBGTask
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit
Authors

Tidily request background task time on iOS.

Usage

If you don’t need a custom expiration handler:

if let task = JTSBGTask.start() {
    // Do long-running stuff, then...
    task.end()
}

If you need a custom expiration handler:

let task = JTSBGTask()

let success = task.startWithExpirationHandler { /* clean up */ }
if success {
    // Do long-running stuff, then...
    task.end()
}

JTSBGTask will call [UIApplication endBackgroundTask:] for you at all the appropriate times. You are only responsible for calling end() if your work finishes before the expiration handler pops.

Latest podspec

{
    "name": "JTSBGTask",
    "version": "1.0.1",
    "summary": "Tidily request background task time on iOS.",
    "description": "Tidily request background task time on iOS. I'm adding additional words here to satisy CocoaPods' pedantry.",
    "homepage": "https://github.com/jaredsinclair/JTSBGTask",
    "license": "MIT",
    "authors": {
        "Jared Sinclair": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jaredsinclair/JTSBGTask.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "source_files": "JTSBGTask.swift"
}

Pin It on Pinterest

Share This