summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2020-07-15 17:22:45 +0200
committerAndrej Mihajlov <and@mullvad.net>2020-07-15 18:12:28 +0200
commita3f0653a7129316ccb9847ff6c6f6a334592e807 (patch)
tree62a59248d85a73772e3504b584a7ef9858978694
parenteff6ba72e3a7a56500a0f2b1111d4e9e6c109160 (diff)
downloadmullvadvpn-a3f0653a7129316ccb9847ff6c6f6a334592e807.tar.xz
mullvadvpn-a3f0653a7129316ccb9847ff6c6f6a334592e807.zip
Add NSDiffableDataSource & UITableViewDiffableDataSource backports
-rw-r--r--ios/MullvadVPN.xcodeproj/project.pbxproj34
-rw-r--r--ios/MullvadVPN/SelectLocationController.swift5
2 files changed, 34 insertions, 5 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj
index 92961b6592..01c0f46d7f 100644
--- a/ios/MullvadVPN.xcodeproj/project.pbxproj
+++ b/ios/MullvadVPN.xcodeproj/project.pbxproj
@@ -172,6 +172,7 @@
58F3C09A249B9852003E76BE /* x25519.c in Sources */ = {isa = PBXBuildFile; fileRef = 58F3C098249B978C003E76BE /* x25519.c */; };
58F3C09C249B99DD003E76BE /* Curve25519.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F3C09B249B99DD003E76BE /* Curve25519.swift */; };
58F3C09D249B99DD003E76BE /* Curve25519.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F3C09B249B99DD003E76BE /* Curve25519.swift */; };
+ 58F3C0A0249BBF1E003E76BE /* DiffableDataSources in Frameworks */ = {isa = PBXBuildFile; productRef = 58F3C09F249BBF1E003E76BE /* DiffableDataSources */; };
58F3C0A2249CA1E0003E76BE /* HeaderBarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 58F3C0A1249CA1E0003E76BE /* HeaderBarView.xib */; };
58F3C0A4249CB069003E76BE /* HeaderBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F3C0A3249CB069003E76BE /* HeaderBarView.swift */; };
58F3C0A624A50157003E76BE /* relays.json in Resources */ = {isa = PBXBuildFile; fileRef = 58F3C0A524A50155003E76BE /* relays.json */; };
@@ -386,6 +387,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 58F3C0A0249BBF1E003E76BE /* DiffableDataSources in Frameworks */,
586BD68422B7BBE400BB7F9F /* NetworkExtension.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -455,12 +457,13 @@
58CE5E57224146200008646E = {
isa = PBXGroup;
children = (
+ 58F3C0A824A50C0E003E76BE /* Assets */,
58ECD29023F178FD004298B6 /* Configurations */,
+ 0E15C74FDCF763609B367486 /* Frameworks */,
58CE5E62224146200008646E /* MullvadVPN */,
- 58CE5E7A224146470008646E /* PacketTunnel */,
- 58B0A2A1238EE67E00BC001D /* MullvadVPNTests */,
58D0C79423F1CE7000FE9BA7 /* MullvadVPNScreenshots */,
- 0E15C74FDCF763609B367486 /* Frameworks */,
+ 58B0A2A1238EE67E00BC001D /* MullvadVPNTests */,
+ 58CE5E7A224146470008646E /* PacketTunnel */,
58CE5E61224146200008646E /* Products */,
);
sourceTree = "<group>";
@@ -675,6 +678,9 @@
58CE5E80224146470008646E /* PBXTargetDependency */,
);
name = MullvadVPN;
+ packageProductDependencies = (
+ 58F3C09F249BBF1E003E76BE /* DiffableDataSources */,
+ );
productName = MullvadVPN;
productReference = 58CE5E60224146200008646E /* MullvadVPN.app */;
productType = "com.apple.product-type.application";
@@ -768,6 +774,9 @@
Base,
);
mainGroup = 58CE5E57224146200008646E;
+ packageReferences = (
+ 58F3C09E249BBF1E003E76BE /* XCRemoteSwiftPackageReference "DiffableDataSources" */,
+ );
productRefGroup = 58CE5E61224146200008646E /* Products */;
projectDirPath = "";
projectRoot = "";
@@ -1502,6 +1511,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
+
+/* Begin XCRemoteSwiftPackageReference section */
+ 58F3C09E249BBF1E003E76BE /* XCRemoteSwiftPackageReference "DiffableDataSources" */ = {
+ isa = XCRemoteSwiftPackageReference;
+ repositoryURL = "https://github.com/ra1028/DiffableDataSources.git";
+ requirement = {
+ kind = exactVersion;
+ version = 0.4.0;
+ };
+ };
+/* End XCRemoteSwiftPackageReference section */
+
+/* Begin XCSwiftPackageProductDependency section */
+ 58F3C09F249BBF1E003E76BE /* DiffableDataSources */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 58F3C09E249BBF1E003E76BE /* XCRemoteSwiftPackageReference "DiffableDataSources" */;
+ productName = DiffableDataSources;
+ };
+/* End XCSwiftPackageProductDependency section */
};
rootObject = 58CE5E58224146200008646E /* Project object */;
}
diff --git a/ios/MullvadVPN/SelectLocationController.swift b/ios/MullvadVPN/SelectLocationController.swift
index 3fb22600a1..cbb06ac1a0 100644
--- a/ios/MullvadVPN/SelectLocationController.swift
+++ b/ios/MullvadVPN/SelectLocationController.swift
@@ -7,6 +7,7 @@
//
import Combine
+import DiffableDataSources
import UIKit
import os
@@ -311,10 +312,10 @@ private enum DataSourceSection {
}
/// Data source type
-private typealias DataSource = UITableViewDiffableDataSource<DataSourceSection, DataSourceItem>
+private typealias DataSource = TableViewDiffableDataSource<DataSourceSection, DataSourceItem>
/// Data source snapshot type
-private typealias DataSourceSnapshot = NSDiffableDataSourceSnapshot<DataSourceSection, DataSourceItem>
+private typealias DataSourceSnapshot = DiffableDataSourceSnapshot<DataSourceSection, DataSourceItem>
/// A wrapper type for RelayList to be able to represent it as a flat list
private enum DataSourceItem: Hashable {