瀏覽代碼

integrated subsequence search pattern into newchatcontroller

Bastian van de Wetering 6 年之前
父節點
當前提交
b479bc54ed

+ 156 - 1
deltachat-ios.xcodeproj/project.pbxproj

@@ -7,6 +7,7 @@
 	objects = {
 	objects = {
 
 
 /* Begin PBXBuildFile section */
 /* Begin PBXBuildFile section */
+		6795F63A82E94FF7CD2CEC0F /* Pods_deltachat_iosTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F7009234DB9408201A6CDCB /* Pods_deltachat_iosTests.framework */; };
 		7032FF8F2149C1DB00B7EC83 /* BaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7032FF8E2149C1DB00B7EC83 /* BaseController.swift */; };
 		7032FF8F2149C1DB00B7EC83 /* BaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7032FF8E2149C1DB00B7EC83 /* BaseController.swift */; };
 		7070FB3D20FDD9FE000DC258 /* NewGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7070FB3C20FDD9FE000DC258 /* NewGroupViewController.swift */; };
 		7070FB3D20FDD9FE000DC258 /* NewGroupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7070FB3C20FDD9FE000DC258 /* NewGroupViewController.swift */; };
 		7070FB4020FF3421000DC258 /* dc_chat.c in Sources */ = {isa = PBXBuildFile; fileRef = 7070FB3E20FF3420000DC258 /* dc_chat.c */; };
 		7070FB4020FF3421000DC258 /* dc_chat.c in Sources */ = {isa = PBXBuildFile; fileRef = 7070FB3E20FF3420000DC258 /* dc_chat.c */; };
@@ -92,6 +93,7 @@
 		AE38B31822672DFC00EC37A1 /* ActionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE38B31722672DFC00EC37A1 /* ActionCell.swift */; };
 		AE38B31822672DFC00EC37A1 /* ActionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE38B31722672DFC00EC37A1 /* ActionCell.swift */; };
 		AE38B31A2267328200EC37A1 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE38B3192267328200EC37A1 /* Colors.swift */; };
 		AE38B31A2267328200EC37A1 /* Colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE38B3192267328200EC37A1 /* Colors.swift */; };
 		AE8519EA2272FDCA00ED86F0 /* DeviceContactsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8519E92272FDCA00ED86F0 /* DeviceContactsHandler.swift */; };
 		AE8519EA2272FDCA00ED86F0 /* DeviceContactsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8519E92272FDCA00ED86F0 /* DeviceContactsHandler.swift */; };
+		AE851A04227AECDE00ED86F0 /* deltachat_iosTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE851A03227AECDE00ED86F0 /* deltachat_iosTests.swift */; };
 		AEACE2DD1FB323CA00DCDD78 /* ChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEACE2DC1FB323CA00DCDD78 /* ChatViewController.swift */; };
 		AEACE2DD1FB323CA00DCDD78 /* ChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEACE2DC1FB323CA00DCDD78 /* ChatViewController.swift */; };
 		AEACE2DF1FB3246400DCDD78 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEACE2DE1FB3246400DCDD78 /* Message.swift */; };
 		AEACE2DF1FB3246400DCDD78 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEACE2DE1FB3246400DCDD78 /* Message.swift */; };
 		AEACE2E31FB32B5C00DCDD78 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEACE2E21FB32B5C00DCDD78 /* Constants.swift */; };
 		AEACE2E31FB32B5C00DCDD78 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEACE2E21FB32B5C00DCDD78 /* Constants.swift */; };
@@ -123,9 +125,18 @@
 			remoteGlobalIDString = C682E2C015B315EF00BE9DA7;
 			remoteGlobalIDString = C682E2C015B315EF00BE9DA7;
 			remoteInfo = "libetpan ios";
 			remoteInfo = "libetpan ios";
 		};
 		};
+		AE851A06227AECDF00ED86F0 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 7A9FB1381FB061E2001FEA36 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 7A9FB13F1FB061E2001FEA36;
+			remoteInfo = "deltachat-ios";
+		};
 /* End PBXContainerItemProxy section */
 /* End PBXContainerItemProxy section */
 
 
 /* Begin PBXFileReference section */
 /* Begin PBXFileReference section */
+		21EE28844E7A690D73BF5285 /* Pods-deltachat-iosTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-deltachat-iosTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-deltachat-iosTests/Pods-deltachat-iosTests.debug.xcconfig"; sourceTree = "<group>"; };
+		2F7009234DB9408201A6CDCB /* Pods_deltachat_iosTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_deltachat_iosTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		6241BE1534A653E79AD5D01D /* Pods_deltachat_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_deltachat_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		6241BE1534A653E79AD5D01D /* Pods_deltachat_ios.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_deltachat_ios.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		7032FF8E2149C1DB00B7EC83 /* BaseController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseController.swift; sourceTree = "<group>"; };
 		7032FF8E2149C1DB00B7EC83 /* BaseController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseController.swift; sourceTree = "<group>"; };
 		7070FB3C20FDD9FE000DC258 /* NewGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewGroupViewController.swift; sourceTree = "<group>"; };
 		7070FB3C20FDD9FE000DC258 /* NewGroupViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewGroupViewController.swift; sourceTree = "<group>"; };
@@ -269,6 +280,9 @@
 		AE38B31722672DFC00EC37A1 /* ActionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionCell.swift; sourceTree = "<group>"; };
 		AE38B31722672DFC00EC37A1 /* ActionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionCell.swift; sourceTree = "<group>"; };
 		AE38B3192267328200EC37A1 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = "<group>"; };
 		AE38B3192267328200EC37A1 /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = "<group>"; };
 		AE8519E92272FDCA00ED86F0 /* DeviceContactsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceContactsHandler.swift; sourceTree = "<group>"; };
 		AE8519E92272FDCA00ED86F0 /* DeviceContactsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceContactsHandler.swift; sourceTree = "<group>"; };
+		AE851A01227AECDE00ED86F0 /* deltachat-iosTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "deltachat-iosTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
+		AE851A03227AECDE00ED86F0 /* deltachat_iosTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = deltachat_iosTests.swift; sourceTree = "<group>"; };
+		AE851A05227AECDF00ED86F0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		AEA9CC2F22522DA20061D113 /* librpgp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = librpgp.h; sourceTree = "<group>"; };
 		AEA9CC2F22522DA20061D113 /* librpgp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = librpgp.h; sourceTree = "<group>"; };
 		AEACE2DC1FB323CA00DCDD78 /* ChatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatViewController.swift; sourceTree = "<group>"; };
 		AEACE2DC1FB323CA00DCDD78 /* ChatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatViewController.swift; sourceTree = "<group>"; };
 		AEACE2DE1FB3246400DCDD78 /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = "<group>"; };
 		AEACE2DE1FB3246400DCDD78 /* Message.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = "<group>"; };
@@ -277,6 +291,7 @@
 		AEE56D752253431E007DC082 /* AccountSetupController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSetupController.swift; sourceTree = "<group>"; };
 		AEE56D752253431E007DC082 /* AccountSetupController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSetupController.swift; sourceTree = "<group>"; };
 		AEE56D7C2253ADB4007DC082 /* HudHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HudHandler.swift; sourceTree = "<group>"; };
 		AEE56D7C2253ADB4007DC082 /* HudHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HudHandler.swift; sourceTree = "<group>"; };
 		AEE56D7F225504DB007DC082 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
 		AEE56D7F225504DB007DC082 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
+		FECB35E2B04CD5F5D02C157A /* Pods-deltachat-iosTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-deltachat-iosTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-deltachat-iosTests/Pods-deltachat-iosTests.release.xcconfig"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
 
 
 /* Begin PBXFrameworksBuildPhase section */
 /* Begin PBXFrameworksBuildPhase section */
@@ -293,6 +308,14 @@
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
+		AE8519FE227AECDE00ED86F0 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				6795F63A82E94FF7CD2CEC0F /* Pods_deltachat_iosTests.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXFrameworksBuildPhase section */
 /* End PBXFrameworksBuildPhase section */
 
 
 /* Begin PBXGroup section */
 /* Begin PBXGroup section */
@@ -418,6 +441,7 @@
 				78E45E2121D1768900D4B15E /* src */,
 				78E45E2121D1768900D4B15E /* src */,
 				7A451D9A1FB1F4BF00177250 /* libetpan.xcodeproj */,
 				7A451D9A1FB1F4BF00177250 /* libetpan.xcodeproj */,
 				7A9FB1421FB061E2001FEA36 /* deltachat-ios */,
 				7A9FB1421FB061E2001FEA36 /* deltachat-ios */,
+				AE851A02227AECDE00ED86F0 /* deltachat-iosTests */,
 				7A9FB1411FB061E2001FEA36 /* Products */,
 				7A9FB1411FB061E2001FEA36 /* Products */,
 				7A9FB4F81FB084E6001FEA36 /* Frameworks */,
 				7A9FB4F81FB084E6001FEA36 /* Frameworks */,
 				7DB2DC4CCB84D323E5130F99 /* Pods */,
 				7DB2DC4CCB84D323E5130F99 /* Pods */,
@@ -430,6 +454,7 @@
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
 				7A9FB1401FB061E2001FEA36 /* deltachat-ios.app */,
 				7A9FB1401FB061E2001FEA36 /* deltachat-ios.app */,
+				AE851A01227AECDE00ED86F0 /* deltachat-iosTests.xctest */,
 			);
 			);
 			name = Products;
 			name = Products;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -501,6 +526,7 @@
 				78113B6F224400F300BCA958 /* libssl.a */,
 				78113B6F224400F300BCA958 /* libssl.a */,
 				7A79233F1FB0A14300BC2DE5 /* libiconv.tbd */,
 				7A79233F1FB0A14300BC2DE5 /* libiconv.tbd */,
 				6241BE1534A653E79AD5D01D /* Pods_deltachat_ios.framework */,
 				6241BE1534A653E79AD5D01D /* Pods_deltachat_ios.framework */,
+				2F7009234DB9408201A6CDCB /* Pods_deltachat_iosTests.framework */,
 			);
 			);
 			name = Frameworks;
 			name = Frameworks;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -567,10 +593,21 @@
 			children = (
 			children = (
 				8DE110C607A0E4485C43B5FA /* Pods-deltachat-ios.debug.xcconfig */,
 				8DE110C607A0E4485C43B5FA /* Pods-deltachat-ios.debug.xcconfig */,
 				A8615D4600859851E53CAA9C /* Pods-deltachat-ios.release.xcconfig */,
 				A8615D4600859851E53CAA9C /* Pods-deltachat-ios.release.xcconfig */,
+				21EE28844E7A690D73BF5285 /* Pods-deltachat-iosTests.debug.xcconfig */,
+				FECB35E2B04CD5F5D02C157A /* Pods-deltachat-iosTests.release.xcconfig */,
 			);
 			);
 			name = Pods;
 			name = Pods;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		AE851A02227AECDE00ED86F0 /* deltachat-iosTests */ = {
+			isa = PBXGroup;
+			children = (
+				AE851A03227AECDE00ED86F0 /* deltachat_iosTests.swift */,
+				AE851A05227AECDF00ED86F0 /* Info.plist */,
+			);
+			path = "deltachat-iosTests";
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 /* End PBXGroup section */
 
 
 /* Begin PBXNativeTarget section */
 /* Begin PBXNativeTarget section */
@@ -595,13 +632,32 @@
 			productReference = 7A9FB1401FB061E2001FEA36 /* deltachat-ios.app */;
 			productReference = 7A9FB1401FB061E2001FEA36 /* deltachat-ios.app */;
 			productType = "com.apple.product-type.application";
 			productType = "com.apple.product-type.application";
 		};
 		};
+		AE851A00227AECDE00ED86F0 /* deltachat-iosTests */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = AE851A08227AECDF00ED86F0 /* Build configuration list for PBXNativeTarget "deltachat-iosTests" */;
+			buildPhases = (
+				672D4B67EDB340ABE3316BC8 /* [CP] Check Pods Manifest.lock */,
+				AE8519FD227AECDE00ED86F0 /* Sources */,
+				AE8519FE227AECDE00ED86F0 /* Frameworks */,
+				AE8519FF227AECDE00ED86F0 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				AE851A07227AECDF00ED86F0 /* PBXTargetDependency */,
+			);
+			name = "deltachat-iosTests";
+			productName = "deltachat-iosTests";
+			productReference = AE851A01227AECDE00ED86F0 /* deltachat-iosTests.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
 /* End PBXNativeTarget section */
 /* End PBXNativeTarget section */
 
 
 /* Begin PBXProject section */
 /* Begin PBXProject section */
 		7A9FB1381FB061E2001FEA36 /* Project object */ = {
 		7A9FB1381FB061E2001FEA36 /* Project object */ = {
 			isa = PBXProject;
 			isa = PBXProject;
 			attributes = {
 			attributes = {
-				LastSwiftUpdateCheck = 0910;
+				LastSwiftUpdateCheck = 1020;
 				LastUpgradeCheck = 0930;
 				LastUpgradeCheck = 0930;
 				ORGANIZATIONNAME = "Jonas Reinsch";
 				ORGANIZATIONNAME = "Jonas Reinsch";
 				TargetAttributes = {
 				TargetAttributes = {
@@ -624,6 +680,11 @@
 							};
 							};
 						};
 						};
 					};
 					};
+					AE851A00227AECDE00ED86F0 = {
+						CreatedOnToolsVersion = 10.2.1;
+						ProvisioningStyle = Automatic;
+						TestTargetID = 7A9FB13F1FB061E2001FEA36;
+					};
 				};
 				};
 			};
 			};
 			buildConfigurationList = 7A9FB13B1FB061E2001FEA36 /* Build configuration list for PBXProject "deltachat-ios" */;
 			buildConfigurationList = 7A9FB13B1FB061E2001FEA36 /* Build configuration list for PBXProject "deltachat-ios" */;
@@ -646,6 +707,7 @@
 			projectRoot = "";
 			projectRoot = "";
 			targets = (
 			targets = (
 				7A9FB13F1FB061E2001FEA36 /* deltachat-ios */,
 				7A9FB13F1FB061E2001FEA36 /* deltachat-ios */,
+				AE851A00227AECDE00ED86F0 /* deltachat-iosTests */,
 			);
 			);
 		};
 		};
 /* End PBXProject section */
 /* End PBXProject section */
@@ -685,6 +747,13 @@
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
+		AE8519FF227AECDE00ED86F0 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXResourcesBuildPhase section */
 /* End PBXResourcesBuildPhase section */
 
 
 /* Begin PBXShellScriptBuildPhase section */
 /* Begin PBXShellScriptBuildPhase section */
@@ -738,6 +807,28 @@
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			showEnvVarsInLog = 0;
 			showEnvVarsInLog = 0;
 		};
 		};
+		672D4B67EDB340ABE3316BC8 /* [CP] Check Pods Manifest.lock */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+			);
+			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
+			);
+			name = "[CP] Check Pods Manifest.lock";
+			outputFileListPaths = (
+			);
+			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-deltachat-iosTests-checkManifestLockResult.txt",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+			showEnvVarsInLog = 0;
+		};
 		7837B63821E54CB400CDE126 /* ShellScript */ = {
 		7837B63821E54CB400CDE126 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
@@ -865,8 +956,24 @@
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
+		AE8519FD227AECDE00ED86F0 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				AE851A04227AECDE00ED86F0 /* deltachat_iosTests.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXSourcesBuildPhase section */
 /* End PBXSourcesBuildPhase section */
 
 
+/* Begin PBXTargetDependency section */
+		AE851A07227AECDF00ED86F0 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 7A9FB13F1FB061E2001FEA36 /* deltachat-ios */;
+			targetProxy = AE851A06227AECDF00ED86F0 /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
 /* Begin PBXVariantGroup section */
 /* Begin PBXVariantGroup section */
 		7A9FB14C1FB061E2001FEA36 /* LaunchScreen.storyboard */ = {
 		7A9FB14C1FB061E2001FEA36 /* LaunchScreen.storyboard */ = {
 			isa = PBXVariantGroup;
 			isa = PBXVariantGroup;
@@ -1147,6 +1254,45 @@
 			};
 			};
 			name = Release;
 			name = Release;
 		};
 		};
+		AE851A09227AECDF00ED86F0 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = 21EE28844E7A690D73BF5285 /* Pods-deltachat-iosTests.debug.xcconfig */;
+			buildSettings = {
+				BUNDLE_LOADER = "$(TEST_HOST)";
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CODE_SIGN_STYLE = Automatic;
+				INFOPLIST_FILE = "deltachat-iosTests/Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 12.2;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "nayooti.deltachat-iosTests";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/deltachat-ios.app/deltachat-ios";
+			};
+			name = Debug;
+		};
+		AE851A0A227AECDF00ED86F0 /* Release */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = FECB35E2B04CD5F5D02C157A /* Pods-deltachat-iosTests.release.xcconfig */;
+			buildSettings = {
+				BUNDLE_LOADER = "$(TEST_HOST)";
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CODE_SIGN_STYLE = Automatic;
+				INFOPLIST_FILE = "deltachat-iosTests/Info.plist";
+				IPHONEOS_DEPLOYMENT_TARGET = 12.2;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "nayooti.deltachat-iosTests";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/deltachat-ios.app/deltachat-ios";
+			};
+			name = Release;
+		};
 /* End XCBuildConfiguration section */
 /* End XCBuildConfiguration section */
 
 
 /* Begin XCConfigurationList section */
 /* Begin XCConfigurationList section */
@@ -1168,6 +1314,15 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 			defaultConfigurationName = Release;
 		};
 		};
+		AE851A08227AECDF00ED86F0 /* Build configuration list for PBXNativeTarget "deltachat-iosTests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				AE851A09227AECDF00ED86F0 /* Debug */,
+				AE851A0A227AECDF00ED86F0 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
 /* End XCConfigurationList section */
 /* End XCConfigurationList section */
 	};
 	};
 	rootObject = 7A9FB1381FB061E2001FEA36 /* Project object */;
 	rootObject = 7A9FB1381FB061E2001FEA36 /* Project object */;

+ 10 - 0
deltachat-ios.xcodeproj/xcshareddata/xcschemes/deltachat-ios.xcscheme

@@ -28,6 +28,16 @@
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       shouldUseLaunchSchemeArgsEnv = "YES">
       shouldUseLaunchSchemeArgsEnv = "YES">
       <Testables>
       <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AE851A00227AECDE00ED86F0"
+               BuildableName = "deltachat-iosTests.xctest"
+               BlueprintName = "deltachat-iosTests"
+               ReferencedContainer = "container:deltachat-ios.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
       </Testables>
       </Testables>
       <MacroExpansion>
       <MacroExpansion>
          <BuildableReference
          <BuildableReference

+ 57 - 13
deltachat-ios/NewChatViewController.swift

@@ -36,8 +36,14 @@ class NewChatViewController: UITableViewController {
 		return contactIds.map({MRContact(id: $0)})
 		return contactIds.map({MRContact(id: $0)})
 	}
 	}
 
 
+	// used when seachbar is active
 	var filteredContacts: [MRContact] = []
 	var filteredContacts: [MRContact] = []
 
 
+	// searchBar active?
+	func isFiltering() -> Bool {
+		return searchController.isActive && !searchBarIsEmpty()
+	}
+
   weak var chatDisplayer: ChatDisplayer?
   weak var chatDisplayer: ChatDisplayer?
 
 
   var syncObserver: Any?
   var syncObserver: Any?
@@ -140,12 +146,12 @@ class NewChatViewController: UITableViewController {
 			return 3
 			return 3
 		} else if section == 1 {
 		} else if section == 1 {
 			if deviceContactAccessGranted {
 			if deviceContactAccessGranted {
-				return contactIds.count
+				return isFiltering() ? filteredContacts.count : contacts.count
 			} else {
 			} else {
 				return 1
 				return 1
 			}
 			}
 		} else {
 		} else {
-				return contactIds.count
+			return isFiltering() ? filteredContacts.count : contacts.count
 		}
 		}
   }
   }
 
 
@@ -204,8 +210,8 @@ class NewChatViewController: UITableViewController {
 				} else {
 				} else {
 					cell = ContactCell(style: .default, reuseIdentifier: "contactCell")
 					cell = ContactCell(style: .default, reuseIdentifier: "contactCell")
 				}
 				}
-				let contactId = contactIds[row]
-				updateContactCell(cell: cell, contactId: contactId)
+				let contact: MRContact = isFiltering() ? filteredContacts[row] : contacts[row]
+				updateContactCell(cell: cell, contact: contact)
 				return cell
 				return cell
 			} else {
 			} else {
 				let cell: ActionCell
 				let cell: ActionCell
@@ -225,8 +231,9 @@ class NewChatViewController: UITableViewController {
 			} else {
 			} else {
 				cell = ContactCell(style: .default, reuseIdentifier: "contactCell")
 				cell = ContactCell(style: .default, reuseIdentifier: "contactCell")
 			}
 			}
-			let contactId = contactIds[row]
-			updateContactCell(cell: cell, contactId: contactId)
+
+			let contact: MRContact = isFiltering() ? filteredContacts[row] : contacts[row]
+			updateContactCell(cell: cell, contact: contact)
 			return cell
 			return cell
 		}
 		}
 		// will actually never get here but compiler not happy
 		// will actually never get here but compiler not happy
@@ -280,7 +287,6 @@ class NewChatViewController: UITableViewController {
 		}
 		}
   }
   }
 
 
-
   override func tableView(_: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {
   override func tableView(_: UITableView, accessoryButtonTappedForRowWith indexPath: IndexPath) {
     let row = indexPath.row
     let row = indexPath.row
     if row > 2 {
     if row > 2 {
@@ -293,8 +299,7 @@ class NewChatViewController: UITableViewController {
     }
     }
   }
   }
 
 
-	private func updateContactCell(cell: ContactCell, contactId: Int) {
-		let contact = MRContact(id: contactId)
+	private func updateContactCell(cell: ContactCell, contact: MRContact) {
 		cell.nameLabel.text = contact.name
 		cell.nameLabel.text = contact.name
 		cell.emailLabel.text = contact.email
 		cell.emailLabel.text = contact.email
 		cell.initialsLabel.text = Utils.getInitials(inputName: contact.name)
 		cell.initialsLabel.text = Utils.getInitials(inputName: contact.name)
@@ -309,12 +314,12 @@ class NewChatViewController: UITableViewController {
 	private func filterContentForSearchText(_ searchText: String, scope: String = "All") {
 	private func filterContentForSearchText(_ searchText: String, scope: String = "All") {
 
 
 		filteredContacts = contacts.filter({ (contact: MRContact) -> Bool in
 		filteredContacts = contacts.filter({ (contact: MRContact) -> Bool in
-			let matches = contact.name.lowercased().contains(searchText.lowercased()) || contact.email.lowercased().contains(searchText.lowercased())
-			return matches
+			// TODO: this should also find gapped patterns
+			let indexes = contact.contains(searchText: searchText)
+			return !indexes.isEmpty
 		})
 		})
 		tableView.reloadData()
 		tableView.reloadData()
 
 
-
 	}
 	}
 
 
 }
 }
@@ -372,8 +377,12 @@ extension NewChatViewController: DeviceContactsDelegate {
 }
 }
 
 
 extension NewChatViewController: UISearchResultsUpdating {
 extension NewChatViewController: UISearchResultsUpdating {
+
 	func updateSearchResults(for searchController: UISearchController) {
 	func updateSearchResults(for searchController: UISearchController) {
-		// TODO
+		if let searchText = searchController.searchBar.text {
+			filterContentForSearchText(searchText)
+		}
+
 	}
 	}
 }
 }
 
 
@@ -381,3 +390,38 @@ protocol DeviceContactsDelegate {
   func accessGranted()
   func accessGranted()
   func accessDenied()
   func accessDenied()
 }
 }
+
+extension MRContact {
+	func contains(searchText text: String) -> [ContactSubSequence] {
+
+		var nameIndexes = [Int]()
+		var emailIndexes = [Int]()
+
+		let contactString = name + email
+		let subsequenceIndexes = contactString.contains(subSequence: text)
+
+		if !subsequenceIndexes.isEmpty {
+			for index in subsequenceIndexes {
+				if index < name.count {
+					nameIndexes.append(index)
+				} else {
+					let emailIndex = index - name.count
+					emailIndexes.append(emailIndex)
+				}
+			}
+			return [ContactSubSequence(contactDetail: .NAME, indexes: nameIndexes), ContactSubSequence(contactDetail: .EMAIL, indexes: emailIndexes)]
+		} else {
+			return []
+		}
+	}
+}
+
+struct ContactSubSequence {
+	let contactDetail: ContactDetail
+	let indexes:[Int]
+}
+
+enum ContactDetail {
+	case NAME
+	case EMAIL
+}