  Default data source handler for scheduled activities. This manager is intended to get `SBBScheduledActivity`
  objects from the Bridge server and can present the associated tasks.
  */
-open class SBAScheduledActivityManager: NSObject, ORKTaskViewControllerDelegate, SBAScheduledActivityDataSource {
-    
+open class SBABaseScheduledActivityManager: NSObject, ORKTaskViewControllerDelegate {
+
     /**
      The delegate is required for presenting tasks and refreshing the UI.
     */

            })
        }
    }
    
    open func numberOfSections() -> Int {
        return sections.count
    }
    
    open func numberOfRows(for section: Int) -> Int {
        return scheduledActivities(for: section).count
    }
    
    open func scheduledActivity(at indexPath: IndexPath) -> SBBScheduledActivity? {
        let schedules = scheduledActivities(for: (indexPath as NSIndexPath).section)
        guard (indexPath as NSIndexPath).row < schedules.count else {
            assertionFailure("Requested row greater than number of rows in section")
            return nil
        }
        return schedules[(indexPath as NSIndexPath).row]
    }
    
    open func shouldShowTask(for indexPath: IndexPath) -> Bool {
        guard let schedule = scheduledActivity(at: indexPath), shouldShowTask(for: schedule)
            else {
                return false
        }
        return true
    }
    
    open func didSelectRow(at indexPath: IndexPath) {
        
        // Only if the task was created should something be done.
        guard let schedule = scheduledActivity(at: indexPath) else { return }
        guard isAvailable(schedule: schedule) else {
            // Block performing a task that is scheduled for the future
            let message = messageForUnavailableSchedule(schedule)
            self.delegate?.showAlertWithOk(title: nil, message: message, actionHandler: nil)
            return
        }
        
        // If this is a valid schedule then create the task view controller
        guard let taskViewController = createTaskViewController(for: schedule)
            else {
                assertionFailure("Failed to create task view controller for \(schedule)")
                return
        }
        
        self.delegate?.presentViewController(taskViewController, animated: true, completion: nil)
    }
    
    open func title(for section: Int) -> String? {
        
        // Always return nil for the first section and if there are no rows in the section
        guard scheduledActivities(for: section).count > 0, let scheduledActivitySection = scheduledActivitySection(for: section)
            else {
                return nil
        }
        
        // Return default localized string for each section
        switch scheduledActivitySection {
        case .expiredYesterday:
            return Localization.localizedString("SBA_ACTIVITY_YESTERDAY")
        case .today:
            return Localization.localizedString("SBA_ACTIVITY_TODAY")
        case .keepGoing:
            return Localization.localizedString("SBA_ACTIVITY_KEEP_GOING")
        case .tomorrow:
            return Localization.localizedString("SBA_ACTIVITY_TOMORROW")
        case .comingUp:
            return Localization.localizedString("SBA_ACTIVITY_COMING_UP")
        case .none:
            return nil
        }
    }
    
    
    // MARK: Data handling
    

        
        // schedule notifications
        setupNotifications(for: scheduledActivities)
        
        // Filter the scheduled activities to only include those that *this* version of the app is designed
        // to be able to handle. Currently, that means only taskReference activities with an identifier that
        // maps to a known task.
        self.activities = scheduledActivities.filter({ (schedule) -> Bool in
            return bridgeInfo.taskReferenceForSchedule(schedule) != nil &&
                self.scheduleFilterPredicate.evaluate(with: schedule)
        })
        
        // reload table
