Latest 2.0.0
License Apache License, Version 2.0
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit

Selene: Background Task Scheduler

Selene is an iOS library which schedules the execution of tasks on a background fetch.

Build Status



Add to your Podfile:
pod Selene


You can also add this repo as a submodule and copy everything in the Selene folder into your project.


1) Add the fetch background mode in your app’s Info.plist file.

2) Create a task

A task must conform to SLNTaskProtocol. For example:

@interface SampleTask: NSObject<SLNTaskProtocol>

@implementation SampleTask

+ (NSString *)identifier {
  return NSStringFromClass(self);

+ (NSOperation *)operationWithCompletion:(SLNTaskCompletion_t)completion {
  NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
    // Do some work ....
  return operation;

+ (CGFloat)averageResponseTime {
  return 5.0;

+ (SLNTaskPriority)priority {
  return SLNTaskPriorityLow;


3) Add the task class to the scheduler

NSArray *tasks = @[[SomeTask class]];
// Run the scheduler every 5 minutes
[SLNScheduler setMinimumBackgroundFetchInterval:60 * 5];
// Add the tasks
[SLNScheduler scheduleTasks:tasks];

In the application delegate:

- (void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
  [SLNScheduler startWithCompletion:completionHandler];

Interested? Here’s the blog post

Latest podspec

    "name": "Selene",
    "version": "2.0.0",
    "summary": "Selene is a library for scheduling background tasks.",
    "description": "Selene calculates a task's goodness to determine whether the task should be executed.",
    "homepage": "",
    "license": {
        "type": "Apache License, Version 2.0",
        "file": "LICENSE"
    "authors": {
        "Kirollos Risk": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "7.0"
    "source": {
        "git": "",
        "tag": "2.0.0"
    "source_files": "Selene/*.{h,m}",
    "frameworks": [
    "requires_arc": true

Pin It on Pinterest

Share This