Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 76 additions & 140 deletions BackgroundTransfer-Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1520"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -27,18 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3DA8112020946F5E007F6272"
BuildableName = "BackgroundTransfer-ExampleTests.xctest"
BlueprintName = "BackgroundTransfer-ExampleTests"
ReferencedContainer = "container:BackgroundTransfer-Example.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -55,8 +43,18 @@
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3DA8112020946F5E007F6272"
BuildableName = "BackgroundTransfer-ExampleTests.xctest"
BlueprintName = "BackgroundTransfer-ExampleTests"
ReferencedContainer = "container:BackgroundTransfer-Example.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -78,8 +76,6 @@
ReferencedContainer = "container:BackgroundTransfer-Example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
12 changes: 5 additions & 7 deletions BackgroundTransfer-Example/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import os

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand All @@ -15,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: - Lifecycle

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
return true
}

Expand All @@ -27,11 +28,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationDidEnterBackground(_ application: UIApplication) {
//Exit app to test restoring app from a terminated state. Comment out to test restoring app from a suspended state.
DispatchQueue.main.asyncAfter(deadline: .now()) {
print("App is about to quit")

if let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first {
debugPrint("Gallery assets will be saved to: \(documentsPath)")
}
os_log(.info, "Simulating app termination by exit(0)")

exit(0)
}
}
Expand All @@ -51,6 +49,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// MARK: - Background

func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
BackgroundDownloader.shared.backgroundCompletionHandler = completionHandler
BackgroundDownloadService.shared.backgroundCompletionHandler = completionHandler
}
}
5 changes: 4 additions & 1 deletion BackgroundTransfer-Example/Application/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array/>
<array>
<string>fetch</string>
<string>processing</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand Down

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions BackgroundTransfer-Example/Data/Downloader/DownloadItem.swift

This file was deleted.

This file was deleted.

Loading