mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
02eb4b35e2
* Run swiftformat for whitespace. * Run swiftformat with some rules.
41 lines
1.2 KiB
Swift
41 lines
1.2 KiB
Swift
//
|
|
// BackgroundTaskServiceProtocol.swift
|
|
// ElementX
|
|
//
|
|
// Created by Ismail on 28.06.2022.
|
|
// Copyright © 2022 Element. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
protocol BackgroundTaskServiceProtocol {
|
|
|
|
func startBackgroundTask(withName name: String,
|
|
isReusable: Bool,
|
|
expirationHandler: (() -> Void)?) -> BackgroundTaskProtocol?
|
|
|
|
}
|
|
|
|
extension BackgroundTaskServiceProtocol {
|
|
|
|
func startBackgroundTask(withName name: String) -> BackgroundTaskProtocol? {
|
|
startBackgroundTask(withName: name,
|
|
expirationHandler: nil)
|
|
}
|
|
|
|
func startBackgroundTask(withName name: String,
|
|
isReusable: Bool) -> BackgroundTaskProtocol? {
|
|
startBackgroundTask(withName: name,
|
|
isReusable: isReusable,
|
|
expirationHandler: nil)
|
|
}
|
|
|
|
func startBackgroundTask(withName name: String,
|
|
expirationHandler: (() -> Void)?) -> BackgroundTaskProtocol? {
|
|
startBackgroundTask(withName: name,
|
|
isReusable: false,
|
|
expirationHandler: expirationHandler)
|
|
}
|
|
|
|
}
|