Skip to content

Commit 8a52505

Browse files
committed
Switched to using TheCatAPI as the image store
1 parent e65123a commit 8a52505

27 files changed

+574
-902
lines changed

BackgroundTransfer-Example.xcodeproj/project.pbxproj

Lines changed: 76 additions & 140 deletions
Large diffs are not rendered by default.

BackgroundTransfer-Example.xcodeproj/xcshareddata/xcschemes/BackgroundTransfer-Example.xcscheme

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1520"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -27,18 +27,6 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "NO">
30-
<Testables>
31-
<TestableReference
32-
skipped = "NO">
33-
<BuildableReference
34-
BuildableIdentifier = "primary"
35-
BlueprintIdentifier = "3DA8112020946F5E007F6272"
36-
BuildableName = "BackgroundTransfer-ExampleTests.xctest"
37-
BlueprintName = "BackgroundTransfer-ExampleTests"
38-
ReferencedContainer = "container:BackgroundTransfer-Example.xcodeproj">
39-
</BuildableReference>
40-
</TestableReference>
41-
</Testables>
4230
<MacroExpansion>
4331
<BuildableReference
4432
BuildableIdentifier = "primary"
@@ -55,8 +43,18 @@
5543
isEnabled = "YES">
5644
</EnvironmentVariable>
5745
</EnvironmentVariables>
58-
<AdditionalOptions>
59-
</AdditionalOptions>
46+
<Testables>
47+
<TestableReference
48+
skipped = "NO">
49+
<BuildableReference
50+
BuildableIdentifier = "primary"
51+
BlueprintIdentifier = "3DA8112020946F5E007F6272"
52+
BuildableName = "BackgroundTransfer-ExampleTests.xctest"
53+
BlueprintName = "BackgroundTransfer-ExampleTests"
54+
ReferencedContainer = "container:BackgroundTransfer-Example.xcodeproj">
55+
</BuildableReference>
56+
</TestableReference>
57+
</Testables>
6058
</TestAction>
6159
<LaunchAction
6260
buildConfiguration = "Debug"
@@ -78,8 +76,6 @@
7876
ReferencedContainer = "container:BackgroundTransfer-Example.xcodeproj">
7977
</BuildableReference>
8078
</BuildableProductRunnable>
81-
<AdditionalOptions>
82-
</AdditionalOptions>
8379
</LaunchAction>
8480
<ProfileAction
8581
buildConfiguration = "Release"

BackgroundTransfer-Example/Application/AppDelegate.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
import UIKit
10+
import os
1011

1112
@UIApplicationMain
1213
class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -15,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1516

1617
// MARK: - Lifecycle
1718

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

@@ -27,11 +28,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2728
func applicationDidEnterBackground(_ application: UIApplication) {
2829
//Exit app to test restoring app from a terminated state. Comment out to test restoring app from a suspended state.
2930
DispatchQueue.main.asyncAfter(deadline: .now()) {
30-
print("App is about to quit")
31-
32-
if let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first {
33-
debugPrint("Gallery assets will be saved to: \(documentsPath)")
34-
}
31+
os_log(.info, "Simulating app termination by exit(0)")
32+
3533
exit(0)
3634
}
3735
}
@@ -51,6 +49,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5149
// MARK: - Background
5250

5351
func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
54-
BackgroundDownloader.shared.backgroundCompletionHandler = completionHandler
52+
BackgroundDownloadService.shared.backgroundCompletionHandler = completionHandler
5553
}
5654
}

BackgroundTransfer-Example/Application/Info.plist

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
2323
<key>UIBackgroundModes</key>
24-
<array/>
24+
<array>
25+
<string>fetch</string>
26+
<string>processing</string>
27+
</array>
2528
<key>UILaunchStoryboardName</key>
2629
<string>LaunchScreen</string>
2730
<key>UIMainStoryboardFile</key>

BackgroundTransfer-Example/Data/Downloader/BackgroundDownloader.swift

Lines changed: 0 additions & 86 deletions
This file was deleted.

BackgroundTransfer-Example/Data/Downloader/BackgroundDownloaderContext.swift

Lines changed: 0 additions & 56 deletions
This file was deleted.

BackgroundTransfer-Example/Data/Downloader/DownloadItem.swift

Lines changed: 0 additions & 30 deletions
This file was deleted.

BackgroundTransfer-Example/Data/Managers/GalleryAssetDataManager.swift

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)