Explorar o código

Add iOS app demo (#87)

Fangjun Kuang %!s(int64=2) %!d(string=hai) anos
pai
achega
a6a9ca1464
Modificáronse 21 ficheiros con 1356 adicións e 0 borrados
  1. 3 0
      ios-swift/SherpaNcnn/.gitignore
  2. 639 0
      ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.pbxproj
  3. 7 0
      ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  4. 8 0
      ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  5. BIN=BIN
      ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.xcworkspace/xcuserdata/fangjun.xcuserdatad/UserInterfaceState.xcuserstate
  6. 32 0
      ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/xcuserdata/fangjun.xcuserdatad/xcschemes/xcschememanagement.plist
  7. 36 0
      ios-swift/SherpaNcnn/SherpaNcnn/AppDelegate.swift
  8. 11 0
      ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/AccentColor.colorset/Contents.json
  9. 14 0
      ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/AppIcon.appiconset/Contents.json
  10. BIN=BIN
      ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/AppIcon.appiconset/k2-1024x1024.png
  11. 6 0
      ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/Contents.json
  12. 25 0
      ios-swift/SherpaNcnn/SherpaNcnn/Base.lproj/LaunchScreen.storyboard
  13. 60 0
      ios-swift/SherpaNcnn/SherpaNcnn/Base.lproj/Main.storyboard
  14. 27 0
      ios-swift/SherpaNcnn/SherpaNcnn/Info.plist
  15. 133 0
      ios-swift/SherpaNcnn/SherpaNcnn/Model.swift
  16. 52 0
      ios-swift/SherpaNcnn/SherpaNcnn/SceneDelegate.swift
  17. 194 0
      ios-swift/SherpaNcnn/SherpaNcnn/ViewController.swift
  18. BIN=BIN
      ios-swift/SherpaNcnn/SherpaNcnn/k2-1024x1024.png
  19. 36 0
      ios-swift/SherpaNcnn/SherpaNcnnTests/SherpaNcnnTests.swift
  20. 41 0
      ios-swift/SherpaNcnn/SherpaNcnnUITests/SherpaNcnnUITests.swift
  21. 32 0
      ios-swift/SherpaNcnn/SherpaNcnnUITests/SherpaNcnnUITestsLaunchTests.swift

+ 3 - 0
ios-swift/SherpaNcnn/.gitignore

@@ -0,0 +1,3 @@
+*.bin
+*.param
+tokens.txt

+ 639 - 0
ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.pbxproj

@@ -0,0 +1,639 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 56;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		C9D7D126298520A000F25DB7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D125298520A000F25DB7 /* AppDelegate.swift */; };
+		C9D7D128298520A000F25DB7 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D127298520A000F25DB7 /* SceneDelegate.swift */; };
+		C9D7D12A298520A000F25DB7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D129298520A000F25DB7 /* ViewController.swift */; };
+		C9D7D12D298520A000F25DB7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9D7D12B298520A000F25DB7 /* Main.storyboard */; };
+		C9D7D12F298520A100F25DB7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C9D7D12E298520A100F25DB7 /* Assets.xcassets */; };
+		C9D7D132298520A100F25DB7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C9D7D130298520A100F25DB7 /* LaunchScreen.storyboard */; };
+		C9D7D13D298520A100F25DB7 /* SherpaNcnnTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D13C298520A100F25DB7 /* SherpaNcnnTests.swift */; };
+		C9D7D147298520A100F25DB7 /* SherpaNcnnUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D146298520A100F25DB7 /* SherpaNcnnUITests.swift */; };
+		C9D7D149298520A100F25DB7 /* SherpaNcnnUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D148298520A100F25DB7 /* SherpaNcnnUITestsLaunchTests.swift */; };
+		C9D7D15729853D8C00F25DB7 /* SherpaNcnn.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D15529853D8C00F25DB7 /* SherpaNcnn.swift */; };
+		C9D7D15A29853E9A00F25DB7 /* sherpa-ncnn.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9D7D15929853E9A00F25DB7 /* sherpa-ncnn.framework */; };
+		C9D7D15C29853EB400F25DB7 /* openmp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9D7D15B29853EB300F25DB7 /* openmp.framework */; };
+		C9D7D15E298540D500F25DB7 /* Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9D7D15D298540D500F25DB7 /* Model.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+		C9D7D139298520A100F25DB7 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = C9D7D11A2985209F00F25DB7 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = C9D7D121298520A000F25DB7;
+			remoteInfo = SherpaNcnn;
+		};
+		C9D7D143298520A100F25DB7 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = C9D7D11A2985209F00F25DB7 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = C9D7D121298520A000F25DB7;
+			remoteInfo = SherpaNcnn;
+		};
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+		C9D7D122298520A000F25DB7 /* SherpaNcnn.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SherpaNcnn.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		C9D7D125298520A000F25DB7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
+		C9D7D127298520A000F25DB7 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
+		C9D7D129298520A000F25DB7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
+		C9D7D12C298520A000F25DB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
+		C9D7D12E298520A100F25DB7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
+		C9D7D131298520A100F25DB7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
+		C9D7D133298520A100F25DB7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		C9D7D138298520A100F25DB7 /* SherpaNcnnTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SherpaNcnnTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		C9D7D13C298520A100F25DB7 /* SherpaNcnnTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SherpaNcnnTests.swift; sourceTree = "<group>"; };
+		C9D7D142298520A100F25DB7 /* SherpaNcnnUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SherpaNcnnUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		C9D7D146298520A100F25DB7 /* SherpaNcnnUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SherpaNcnnUITests.swift; sourceTree = "<group>"; };
+		C9D7D148298520A100F25DB7 /* SherpaNcnnUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SherpaNcnnUITestsLaunchTests.swift; sourceTree = "<group>"; };
+		C9D7D15529853D8C00F25DB7 /* SherpaNcnn.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SherpaNcnn.swift; path = "../../../swift-api-examples/SherpaNcnn.swift"; sourceTree = "<group>"; };
+		C9D7D15629853D8C00F25DB7 /* SherpaNcnn-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "SherpaNcnn-Bridging-Header.h"; path = "../../../swift-api-examples/SherpaNcnn-Bridging-Header.h"; sourceTree = "<group>"; };
+		C9D7D15929853E9A00F25DB7 /* sherpa-ncnn.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "sherpa-ncnn.framework"; path = "../../build-ios/sherpa-ncnn.framework"; sourceTree = "<group>"; };
+		C9D7D15B29853EB300F25DB7 /* openmp.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = openmp.framework; path = "../../build-ios/openmp.framework"; sourceTree = "<group>"; };
+		C9D7D15D298540D500F25DB7 /* Model.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model.swift; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		C9D7D11F298520A000F25DB7 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C9D7D15C29853EB400F25DB7 /* openmp.framework in Frameworks */,
+				C9D7D15A29853E9A00F25DB7 /* sherpa-ncnn.framework in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		C9D7D135298520A100F25DB7 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		C9D7D13F298520A100F25DB7 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		C9D7D1192985209F00F25DB7 = {
+			isa = PBXGroup;
+			children = (
+				C9D7D124298520A000F25DB7 /* SherpaNcnn */,
+				C9D7D13B298520A100F25DB7 /* SherpaNcnnTests */,
+				C9D7D145298520A100F25DB7 /* SherpaNcnnUITests */,
+				C9D7D123298520A000F25DB7 /* Products */,
+				C9D7D15829853E9A00F25DB7 /* Frameworks */,
+			);
+			sourceTree = "<group>";
+		};
+		C9D7D123298520A000F25DB7 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				C9D7D122298520A000F25DB7 /* SherpaNcnn.app */,
+				C9D7D138298520A100F25DB7 /* SherpaNcnnTests.xctest */,
+				C9D7D142298520A100F25DB7 /* SherpaNcnnUITests.xctest */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		C9D7D124298520A000F25DB7 /* SherpaNcnn */ = {
+			isa = PBXGroup;
+			children = (
+				C9D7D15629853D8C00F25DB7 /* SherpaNcnn-Bridging-Header.h */,
+				C9D7D15529853D8C00F25DB7 /* SherpaNcnn.swift */,
+				C9D7D125298520A000F25DB7 /* AppDelegate.swift */,
+				C9D7D127298520A000F25DB7 /* SceneDelegate.swift */,
+				C9D7D129298520A000F25DB7 /* ViewController.swift */,
+				C9D7D12B298520A000F25DB7 /* Main.storyboard */,
+				C9D7D12E298520A100F25DB7 /* Assets.xcassets */,
+				C9D7D130298520A100F25DB7 /* LaunchScreen.storyboard */,
+				C9D7D133298520A100F25DB7 /* Info.plist */,
+				C9D7D15D298540D500F25DB7 /* Model.swift */,
+			);
+			path = SherpaNcnn;
+			sourceTree = "<group>";
+		};
+		C9D7D13B298520A100F25DB7 /* SherpaNcnnTests */ = {
+			isa = PBXGroup;
+			children = (
+				C9D7D13C298520A100F25DB7 /* SherpaNcnnTests.swift */,
+			);
+			path = SherpaNcnnTests;
+			sourceTree = "<group>";
+		};
+		C9D7D145298520A100F25DB7 /* SherpaNcnnUITests */ = {
+			isa = PBXGroup;
+			children = (
+				C9D7D146298520A100F25DB7 /* SherpaNcnnUITests.swift */,
+				C9D7D148298520A100F25DB7 /* SherpaNcnnUITestsLaunchTests.swift */,
+			);
+			path = SherpaNcnnUITests;
+			sourceTree = "<group>";
+		};
+		C9D7D15829853E9A00F25DB7 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				C9D7D15B29853EB300F25DB7 /* openmp.framework */,
+				C9D7D15929853E9A00F25DB7 /* sherpa-ncnn.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		C9D7D121298520A000F25DB7 /* SherpaNcnn */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = C9D7D14C298520A100F25DB7 /* Build configuration list for PBXNativeTarget "SherpaNcnn" */;
+			buildPhases = (
+				C9D7D11E298520A000F25DB7 /* Sources */,
+				C9D7D11F298520A000F25DB7 /* Frameworks */,
+				C9D7D120298520A000F25DB7 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = SherpaNcnn;
+			productName = SherpaNcnn;
+			productReference = C9D7D122298520A000F25DB7 /* SherpaNcnn.app */;
+			productType = "com.apple.product-type.application";
+		};
+		C9D7D137298520A100F25DB7 /* SherpaNcnnTests */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = C9D7D14F298520A100F25DB7 /* Build configuration list for PBXNativeTarget "SherpaNcnnTests" */;
+			buildPhases = (
+				C9D7D134298520A100F25DB7 /* Sources */,
+				C9D7D135298520A100F25DB7 /* Frameworks */,
+				C9D7D136298520A100F25DB7 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				C9D7D13A298520A100F25DB7 /* PBXTargetDependency */,
+			);
+			name = SherpaNcnnTests;
+			productName = SherpaNcnnTests;
+			productReference = C9D7D138298520A100F25DB7 /* SherpaNcnnTests.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
+		C9D7D141298520A100F25DB7 /* SherpaNcnnUITests */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = C9D7D152298520A100F25DB7 /* Build configuration list for PBXNativeTarget "SherpaNcnnUITests" */;
+			buildPhases = (
+				C9D7D13E298520A100F25DB7 /* Sources */,
+				C9D7D13F298520A100F25DB7 /* Frameworks */,
+				C9D7D140298520A100F25DB7 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				C9D7D144298520A100F25DB7 /* PBXTargetDependency */,
+			);
+			name = SherpaNcnnUITests;
+			productName = SherpaNcnnUITests;
+			productReference = C9D7D142298520A100F25DB7 /* SherpaNcnnUITests.xctest */;
+			productType = "com.apple.product-type.bundle.ui-testing";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		C9D7D11A2985209F00F25DB7 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				BuildIndependentTargetsInParallel = 1;
+				LastSwiftUpdateCheck = 1420;
+				LastUpgradeCheck = 1420;
+				TargetAttributes = {
+					C9D7D121298520A000F25DB7 = {
+						CreatedOnToolsVersion = 14.2;
+					};
+					C9D7D137298520A100F25DB7 = {
+						CreatedOnToolsVersion = 14.2;
+						TestTargetID = C9D7D121298520A000F25DB7;
+					};
+					C9D7D141298520A100F25DB7 = {
+						CreatedOnToolsVersion = 14.2;
+						TestTargetID = C9D7D121298520A000F25DB7;
+					};
+				};
+			};
+			buildConfigurationList = C9D7D11D2985209F00F25DB7 /* Build configuration list for PBXProject "SherpaNcnn" */;
+			compatibilityVersion = "Xcode 14.0";
+			developmentRegion = en;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+				Base,
+			);
+			mainGroup = C9D7D1192985209F00F25DB7;
+			productRefGroup = C9D7D123298520A000F25DB7 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				C9D7D121298520A000F25DB7 /* SherpaNcnn */,
+				C9D7D137298520A100F25DB7 /* SherpaNcnnTests */,
+				C9D7D141298520A100F25DB7 /* SherpaNcnnUITests */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		C9D7D120298520A000F25DB7 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C9D7D132298520A100F25DB7 /* LaunchScreen.storyboard in Resources */,
+				C9D7D12F298520A100F25DB7 /* Assets.xcassets in Resources */,
+				C9D7D12D298520A000F25DB7 /* Main.storyboard in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		C9D7D136298520A100F25DB7 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		C9D7D140298520A100F25DB7 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		C9D7D11E298520A000F25DB7 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C9D7D15E298540D500F25DB7 /* Model.swift in Sources */,
+				C9D7D12A298520A000F25DB7 /* ViewController.swift in Sources */,
+				C9D7D126298520A000F25DB7 /* AppDelegate.swift in Sources */,
+				C9D7D128298520A000F25DB7 /* SceneDelegate.swift in Sources */,
+				C9D7D15729853D8C00F25DB7 /* SherpaNcnn.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		C9D7D134298520A100F25DB7 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C9D7D13D298520A100F25DB7 /* SherpaNcnnTests.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		C9D7D13E298520A100F25DB7 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				C9D7D149298520A100F25DB7 /* SherpaNcnnUITestsLaunchTests.swift in Sources */,
+				C9D7D147298520A100F25DB7 /* SherpaNcnnUITests.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+		C9D7D13A298520A100F25DB7 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = C9D7D121298520A000F25DB7 /* SherpaNcnn */;
+			targetProxy = C9D7D139298520A100F25DB7 /* PBXContainerItemProxy */;
+		};
+		C9D7D144298520A100F25DB7 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = C9D7D121298520A000F25DB7 /* SherpaNcnn */;
+			targetProxy = C9D7D143298520A100F25DB7 /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+		C9D7D12B298520A000F25DB7 /* Main.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				C9D7D12C298520A000F25DB7 /* Base */,
+			);
+			name = Main.storyboard;
+			sourceTree = "<group>";
+		};
+		C9D7D130298520A100F25DB7 /* LaunchScreen.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				C9D7D131298520A100F25DB7 /* Base */,
+			);
+			name = LaunchScreen.storyboard;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		C9D7D14A298520A100F25DB7 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				ENABLE_TESTABILITY = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 16.2;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = iphoneos;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+			};
+			name = Debug;
+		};
+		C9D7D14B298520A100F25DB7 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 16.2;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				SDKROOT = iphoneos;
+				SWIFT_COMPILATION_MODE = wholemodule;
+				SWIFT_OPTIMIZATION_LEVEL = "-O";
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+		C9D7D14D298520A100F25DB7 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = N5ZH3Z63A6;
+				FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../../build-ios/";
+				GENERATE_INFOPLIST_FILE = YES;
+				HEADER_SEARCH_PATHS = "${PROJECT_DIR}/../../build-ios/sherpa-ncnn.framework/Headers/";
+				INFOPLIST_FILE = SherpaNcnn/Info.plist;
+				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
+				INFOPLIST_KEY_UIMainStoryboardFile = Main;
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
+				MARKETING_VERSION = 1.0;
+				OTHER_LDFLAGS = "-lc++";
+				PRODUCT_BUNDLE_IDENTIFIER = "com.k2-fsa.org.SherpaNcnn";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				SWIFT_OBJC_BRIDGING_HEADER = "${PROJECT_DIR}/../../swift-api-examples/SherpaNcnn-Bridging-Header.h";
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		C9D7D14E298520A100F25DB7 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				DEVELOPMENT_TEAM = N5ZH3Z63A6;
+				FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../../build-ios/";
+				GENERATE_INFOPLIST_FILE = YES;
+				HEADER_SEARCH_PATHS = "${PROJECT_DIR}/../../build-ios/sherpa-ncnn.framework/Headers/";
+				INFOPLIST_FILE = SherpaNcnn/Info.plist;
+				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
+				INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
+				INFOPLIST_KEY_UIMainStoryboardFile = Main;
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
+				LD_RUNPATH_SEARCH_PATHS = (
+					"$(inherited)",
+					"@executable_path/Frameworks",
+				);
+				MARKETING_VERSION = 1.0;
+				OTHER_LDFLAGS = "-lc++";
+				PRODUCT_BUNDLE_IDENTIFIER = "com.k2-fsa.org.SherpaNcnn";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = YES;
+				SWIFT_OBJC_BRIDGING_HEADER = "${PROJECT_DIR}/../../swift-api-examples/SherpaNcnn-Bridging-Header.h";
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Release;
+		};
+		C9D7D150298520A100F25DB7 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				BUNDLE_LOADER = "$(TEST_HOST)";
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				GENERATE_INFOPLIST_FILE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 16.2;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.k2-fsa.org.SherpaNcnnTests";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SherpaNcnn.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/SherpaNcnn";
+			};
+			name = Debug;
+		};
+		C9D7D151298520A100F25DB7 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				BUNDLE_LOADER = "$(TEST_HOST)";
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				GENERATE_INFOPLIST_FILE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 16.2;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.k2-fsa.org.SherpaNcnnTests";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SherpaNcnn.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/SherpaNcnn";
+			};
+			name = Release;
+		};
+		C9D7D153298520A100F25DB7 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				GENERATE_INFOPLIST_FILE = YES;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.k2-fsa.org.SherpaNcnnUITests";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_TARGET_NAME = SherpaNcnn;
+			};
+			name = Debug;
+		};
+		C9D7D154298520A100F25DB7 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+				CODE_SIGN_STYLE = Automatic;
+				CURRENT_PROJECT_VERSION = 1;
+				GENERATE_INFOPLIST_FILE = YES;
+				MARKETING_VERSION = 1.0;
+				PRODUCT_BUNDLE_IDENTIFIER = "com.k2-fsa.org.SherpaNcnnUITests";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_EMIT_LOC_STRINGS = NO;
+				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				TEST_TARGET_NAME = SherpaNcnn;
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		C9D7D11D2985209F00F25DB7 /* Build configuration list for PBXProject "SherpaNcnn" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C9D7D14A298520A100F25DB7 /* Debug */,
+				C9D7D14B298520A100F25DB7 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		C9D7D14C298520A100F25DB7 /* Build configuration list for PBXNativeTarget "SherpaNcnn" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C9D7D14D298520A100F25DB7 /* Debug */,
+				C9D7D14E298520A100F25DB7 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		C9D7D14F298520A100F25DB7 /* Build configuration list for PBXNativeTarget "SherpaNcnnTests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C9D7D150298520A100F25DB7 /* Debug */,
+				C9D7D151298520A100F25DB7 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		C9D7D152298520A100F25DB7 /* Build configuration list for PBXNativeTarget "SherpaNcnnUITests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				C9D7D153298520A100F25DB7 /* Debug */,
+				C9D7D154298520A100F25DB7 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = C9D7D11A2985209F00F25DB7 /* Project object */;
+}

+ 7 - 0
ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>

+ 8 - 0
ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IDEDidComputeMac32BitWarning</key>
+	<true/>
+</dict>
+</plist>

BIN=BIN
ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/project.xcworkspace/xcuserdata/fangjun.xcuserdatad/UserInterfaceState.xcuserstate


+ 32 - 0
ios-swift/SherpaNcnn/SherpaNcnn.xcodeproj/xcuserdata/fangjun.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>SchemeUserState</key>
+	<dict>
+		<key>SherpaNcnn.xcscheme_^#shared#^_</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>0</integer>
+		</dict>
+	</dict>
+	<key>SuppressBuildableAutocreation</key>
+	<dict>
+		<key>C9D7D121298520A000F25DB7</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+		<key>C9D7D137298520A100F25DB7</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+		<key>C9D7D141298520A100F25DB7</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+	</dict>
+</dict>
+</plist>

+ 36 - 0
ios-swift/SherpaNcnn/SherpaNcnn/AppDelegate.swift

@@ -0,0 +1,36 @@
+//
+//  AppDelegate.swift
+//  SherpaNcnn
+//
+//  Created by fangjun on 2023/1/28.
+//
+
+import UIKit
+
+@main
+class AppDelegate: UIResponder, UIApplicationDelegate {
+
+
+
+    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
+        // Override point for customization after application launch.
+        return true
+    }
+
+    // MARK: UISceneSession Lifecycle
+
+    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
+        // Called when a new scene session is being created.
+        // Use this method to select a configuration to create the new scene with.
+        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
+    }
+
+    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
+        // Called when the user discards a scene session.
+        // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
+        // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
+    }
+
+
+}
+

+ 11 - 0
ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/AccentColor.colorset/Contents.json

@@ -0,0 +1,11 @@
+{
+  "colors" : [
+    {
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 14 - 0
ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -0,0 +1,14 @@
+{
+  "images" : [
+    {
+      "filename" : "k2-1024x1024.png",
+      "idiom" : "universal",
+      "platform" : "ios",
+      "size" : "1024x1024"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN=BIN
ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/AppIcon.appiconset/k2-1024x1024.png


+ 6 - 0
ios-swift/SherpaNcnn/SherpaNcnn/Assets.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 25 - 0
ios-swift/SherpaNcnn/SherpaNcnn/Base.lproj/LaunchScreen.storyboard

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="EHf-IW-A2E">
+            <objects>
+                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="53" y="375"/>
+        </scene>
+    </scenes>
+</document>

+ 60 - 0
ios-swift/SherpaNcnn/SherpaNcnn/Base.lproj/Main.storyboard

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="tne-QT-ifu">
+            <objects>
+                <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="SherpaNcnn" customModuleProvider="target" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+                        <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7q8-Y3-WbJ">
+                                <rect key="frame" x="166" y="773" width="61.333333333333343" height="35"/>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain" title="Start"/>
+                                <connections>
+                                    <action selector="onRecordBtnClick:" destination="BYZ-38-t0r" eventType="touchUpInside" id="rS6-DT-XWm"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jfS-7J-m9C">
+                                <rect key="frame" x="8" y="67" width="377" height="20.333333333333329"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                        </subviews>
+                        <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                        <constraints>
+                            <constraint firstItem="jfS-7J-m9C" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="8" id="HX3-rI-U9E"/>
+                            <constraint firstItem="jfS-7J-m9C" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="8" id="NEv-PD-DHj"/>
+                            <constraint firstItem="7q8-Y3-WbJ" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="Nha-gf-R2b"/>
+                            <constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="jfS-7J-m9C" secondAttribute="trailing" constant="8" id="P2f-hG-O2e"/>
+                            <constraint firstAttribute="bottomMargin" secondItem="7q8-Y3-WbJ" secondAttribute="bottom" constant="10" id="Pgb-4G-ySa"/>
+                        </constraints>
+                    </view>
+                    <connections>
+                        <outlet property="recordBtn" destination="7q8-Y3-WbJ" id="mFd-cu-zjn"/>
+                        <outlet property="resultLabel" destination="jfS-7J-m9C" id="xQU-ID-m5Q"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="32.824427480916029" y="3.5211267605633805"/>
+        </scene>
+    </scenes>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 27 - 0
ios-swift/SherpaNcnn/SherpaNcnn/Info.plist

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>NSMicrophoneUsageDescription</key>
+	<string>Need microphone access for recording speech</string>
+	<key>UIApplicationSceneManifest</key>
+	<dict>
+		<key>UIApplicationSupportsMultipleScenes</key>
+		<false/>
+		<key>UISceneConfigurations</key>
+		<dict>
+			<key>UIWindowSceneSessionRoleApplication</key>
+			<array>
+				<dict>
+					<key>UISceneConfigurationName</key>
+					<string>Default Configuration</string>
+					<key>UISceneDelegateClassName</key>
+					<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
+					<key>UISceneStoryboardFile</key>
+					<string>Main</string>
+				</dict>
+			</array>
+		</dict>
+	</dict>
+</dict>
+</plist>

+ 133 - 0
ios-swift/SherpaNcnn/SherpaNcnn/Model.swift

@@ -0,0 +1,133 @@
+import Foundation
+
+func getResource(_ forResource: String, _ ofType: String) -> String {
+  let path = Bundle.main.path(forResource: forResource, ofType: ofType)
+  precondition(
+    path != nil,
+    "\(forResource).\(ofType) does not exist!\n" + "Remember to change \n"
+      + "  Build Phases -> Copy Bundle Resources\n" + "to add it!"
+  )
+  return path!
+}
+/// Please refer to
+/// https://k2-fsa.github.io/sherpa/ncnn/pretrained_models/index.html
+/// to download pre-trained models
+
+/// csukuangfj/sherpa-ncnn-conv-emformer-transducer-2022-12-06 (Chinese + English)
+func getMultilingualModelConfig2022_12_06() -> SherpaNcnnModelConfig {
+  let encoderParam = getResource("encoder_jit_trace-pnnx.ncnn", "param")
+  let encoderBin = getResource("encoder_jit_trace-pnnx.ncnn", "bin")
+  let decoderParam = getResource("decoder_jit_trace-pnnx.ncnn", "param")
+  let decoderBin = getResource("decoder_jit_trace-pnnx.ncnn", "bin")
+  let joinerParam = getResource("joiner_jit_trace-pnnx.ncnn", "param")
+  let joinerBin = getResource("joiner_jit_trace-pnnx.ncnn", "bin")
+  let tokens = getResource("tokens", "txt")
+
+  return sherpaNcnnModelConfig(
+    encoderParam: encoderParam,
+    encoderBin: encoderBin,
+    decoderParam: decoderParam,
+    decoderBin: decoderBin,
+    joinerParam: joinerParam,
+    joinerBin: joinerBin,
+    tokens: tokens,
+    numThreads: 4
+  )
+}
+
+/// csukuangfj/sherpa-ncnn-conv-emformer-transducer-2022-12-06 (Chinese + English)
+func getMultilingualModelConfig2022_12_06_Int8() -> SherpaNcnnModelConfig {
+  let encoderParam = getResource("encoder_jit_trace-pnnx.ncnn.int8", "param")
+  let encoderBin = getResource("encoder_jit_trace-pnnx.ncnn.int8", "bin")
+  let decoderParam = getResource("decoder_jit_trace-pnnx.ncnn", "param")
+  let decoderBin = getResource("decoder_jit_trace-pnnx.ncnn", "bin")
+  let joinerParam = getResource("joiner_jit_trace-pnnx.ncnn.int8", "param")
+  let joinerBin = getResource("joiner_jit_trace-pnnx.ncnn.int8", "bin")
+  let tokens = getResource("tokens", "txt")
+
+  return sherpaNcnnModelConfig(
+    encoderParam: encoderParam,
+    encoderBin: encoderBin,
+    decoderParam: decoderParam,
+    decoderBin: decoderBin,
+    joinerParam: joinerParam,
+    joinerBin: joinerBin,
+    tokens: tokens,
+    numThreads: 4
+  )
+}
+
+/// marcoyang/sherpa-ncnn-conv-emformer-transducer-small-2023-01-09 (English)
+func getConvEmformerSmallEnglishModelConfig2023_01_09() -> SherpaNcnnModelConfig {
+  let encoderParam = getResource("encoder_jit_trace-pnnx.ncnn", "param")
+  let encoderBin = getResource("encoder_jit_trace-pnnx.ncnn", "bin")
+  let decoderParam = getResource("decoder_jit_trace-pnnx.ncnn", "param")
+  let decoderBin = getResource("decoder_jit_trace-pnnx.ncnn", "bin")
+  let joinerParam = getResource("joiner_jit_trace-pnnx.ncnn", "param")
+  let joinerBin = getResource("joiner_jit_trace-pnnx.ncnn", "bin")
+  let tokens = getResource("tokens", "txt")
+
+  return sherpaNcnnModelConfig(
+    encoderParam: encoderParam,
+    encoderBin: encoderBin,
+    decoderParam: decoderParam,
+    decoderBin: decoderBin,
+    joinerParam: joinerParam,
+    joinerBin: joinerBin,
+    tokens: tokens,
+    numThreads: 4
+  )
+}
+
+/// marcoyang/sherpa-ncnn-conv-emformer-transducer-small-2023-01-09 (English)
+func getConvEmformerSmallEnglishModelConfig2023_01_09_Int8() -> SherpaNcnnModelConfig {
+  let encoderParam = getResource("encoder_jit_trace-pnnx.ncnn.int8", "param")
+  let encoderBin = getResource("encoder_jit_trace-pnnx.ncnn.int8", "bin")
+  let decoderParam = getResource("decoder_jit_trace-pnnx.ncnn", "param")
+  let decoderBin = getResource("decoder_jit_trace-pnnx.ncnn", "bin")
+  let joinerParam = getResource("joiner_jit_trace-pnnx.ncnn.int8", "param")
+  let joinerBin = getResource("joiner_jit_trace-pnnx.ncnn.int8", "bin")
+  let tokens = getResource("tokens", "txt")
+
+  return sherpaNcnnModelConfig(
+    encoderParam: encoderParam,
+    encoderBin: encoderBin,
+    decoderParam: decoderParam,
+    decoderBin: decoderBin,
+    joinerParam: joinerParam,
+    joinerBin: joinerBin,
+    tokens: tokens,
+    numThreads: 4
+  )
+}
+/// marcoyang/sherpa-ncnn-conv-emformer-transducer-small-2023-01-09 (English)
+func getLstmTransducerEnglish_2022_09_05() -> SherpaNcnnModelConfig {
+  let encoderParam = getResource(
+    "encoder_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn", "param")
+  let encoderBin = getResource(
+    "encoder_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn", "bin")
+  let decoderParam = getResource(
+    "decoder_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn", "param")
+  let decoderBin = getResource(
+    "decoder_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn", "bin")
+  let joinerParam = getResource(
+    "joiner_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn", "param")
+  let joinerBin = getResource(
+    "joiner_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn", "bin")
+  let tokens = getResource("tokens", "txt")
+
+  return sherpaNcnnModelConfig(
+    encoderParam: encoderParam,
+    encoderBin: encoderBin,
+    decoderParam: decoderParam,
+    decoderBin: decoderBin,
+    joinerParam: joinerParam,
+    joinerBin: joinerBin,
+    tokens: tokens,
+    numThreads: 4
+  )
+}
+
+/// Please refer to
+/// https://k2-fsa.github.io/sherpa/ncnn/pretrained_models/index.html
+/// to add more models if you need

+ 52 - 0
ios-swift/SherpaNcnn/SherpaNcnn/SceneDelegate.swift

@@ -0,0 +1,52 @@
+//
+//  SceneDelegate.swift
+//  SherpaNcnn
+//
+//  Created by fangjun on 2023/1/28.
+//
+
+import UIKit
+
+class SceneDelegate: UIResponder, UIWindowSceneDelegate {
+
+    var window: UIWindow?
+
+
+    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
+        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
+        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
+        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
+        guard let _ = (scene as? UIWindowScene) else { return }
+    }
+
+    func sceneDidDisconnect(_ scene: UIScene) {
+        // Called as the scene is being released by the system.
+        // This occurs shortly after the scene enters the background, or when its session is discarded.
+        // Release any resources associated with this scene that can be re-created the next time the scene connects.
+        // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
+    }
+
+    func sceneDidBecomeActive(_ scene: UIScene) {
+        // Called when the scene has moved from an inactive state to an active state.
+        // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
+    }
+
+    func sceneWillResignActive(_ scene: UIScene) {
+        // Called when the scene will move from an active state to an inactive state.
+        // This may occur due to temporary interruptions (ex. an incoming phone call).
+    }
+
+    func sceneWillEnterForeground(_ scene: UIScene) {
+        // Called as the scene transitions from the background to the foreground.
+        // Use this method to undo the changes made on entering the background.
+    }
+
+    func sceneDidEnterBackground(_ scene: UIScene) {
+        // Called as the scene transitions from the foreground to the background.
+        // Use this method to save data, release shared resources, and store enough scene-specific state information
+        // to restore the scene back to its current state.
+    }
+
+
+}
+

+ 194 - 0
ios-swift/SherpaNcnn/SherpaNcnn/ViewController.swift

@@ -0,0 +1,194 @@
+//
+//  ViewController.swift
+//  SherpaNcnn
+//
+//  Created by fangjun on 2023/1/28.
+//
+
+import AVFoundation
+import UIKit
+
+extension AudioBuffer {
+  func array() -> [Float] {
+    return Array(UnsafeBufferPointer(self))
+  }
+}
+
+extension AVAudioPCMBuffer {
+  func array() -> [Float] {
+    return self.audioBufferList.pointee.mBuffers.array()
+  }
+}
+
+class ViewController: UIViewController {
+  @IBOutlet weak var resultLabel: UILabel!
+  @IBOutlet weak var recordBtn: UIButton!
+
+  var audioEngine: AVAudioEngine? = nil
+  var recognizer: SherpaNcnnRecognizer! = nil
+
+  /// It saves the decoded results so far
+  var sentences: [String] = [] {
+    didSet {
+      updateLabel()
+    }
+  }
+  var lastSentence: String = ""
+  let maxSentence: Int = 20
+  var results: String {
+    if sentences.isEmpty && lastSentence.isEmpty {
+      return ""
+    }
+    if sentences.isEmpty {
+      return "0: \(lastSentence.lowercased())"
+    }
+
+    let start = max(sentences.count - maxSentence, 0)
+    if lastSentence.isEmpty {
+      return sentences.enumerated().map { (index, s) in "\(index): \(s.lowercased())" }[start...]
+        .joined(separator: "\n")
+    } else {
+      return sentences.enumerated().map { (index, s) in "\(index): \(s.lowercased())" }[start...]
+        .joined(separator: "\n") + "\n\(sentences.count): \(lastSentence.lowercased())"
+    }
+  }
+
+  func updateLabel() {
+    DispatchQueue.main.async {
+      self.resultLabel.text = self.results
+    }
+  }
+
+  override func viewDidLoad() {
+    super.viewDidLoad()
+    // Do any additional setup after loading the view.
+
+    resultLabel.text = "ASR with Next-gen Kaldi\n\nPress the Start button to run!"
+    recordBtn.setTitle("Start", for: .normal)
+    initRecognizer()
+    initRecorder()
+  }
+
+  @IBAction func onRecordBtnClick(_ sender: UIButton) {
+    if recordBtn.currentTitle == "Start" {
+      startRecorder()
+      recordBtn.setTitle("Stop", for: .normal)
+    } else {
+      stopRecorder()
+      recordBtn.setTitle("Start", for: .normal)
+    }
+  }
+
+  func initRecognizer() {
+    // Please select one model that is best suitable for you.
+    //
+    // You can also modify Model.swift to add new pre-trained models from
+    // https://k2-fsa.github.io/sherpa/ncnn/pretrained_models/index.html
+
+    var modelConfig = getMultilingualModelConfig2022_12_06()
+    // var modelConfig = getMultilingualModelConfig2022_12_06_Int8()
+    // var modelConfig = getConvEmformerSmallEnglishModelConfig2023_01_09()
+    // var modelConfig = getConvEmformerSmallEnglishModelConfig2023_01_09_Int8()
+    // var modelConfig = getLstmTransducerEnglish_2022_09_05()
+
+    var decoderConfig = sherpaNcnnDecoderConfig(
+      decodingMethod: "modified_beam_search",
+      numActivePaths: 4,
+      enableEndpoint: true,
+      rule1MinTrailingSilence: 1.2,
+      rule2MinTrailingSilence: 2.4,
+      rule3MinUtteranceLength: 200)
+
+    recognizer = SherpaNcnnRecognizer(
+      modelConfig: &modelConfig,
+      decoderConfig: &decoderConfig)
+  }
+
+  func initRecorder() {
+    print("init recorder")
+    audioEngine = AVAudioEngine()
+    let inputNode = self.audioEngine?.inputNode
+    let bus = 0
+    let inputFormat = inputNode?.outputFormat(forBus: bus)
+    let outputFormat = AVAudioFormat(
+      commonFormat: .pcmFormatFloat32,
+      sampleRate: 16000, channels: 1,
+      interleaved: false)!
+
+    let converter = AVAudioConverter(from: inputFormat!, to: outputFormat)!
+
+    inputNode!.installTap(
+      onBus: bus,
+      bufferSize: 1024,
+      format: inputFormat
+    ) {
+      (buffer: AVAudioPCMBuffer, when: AVAudioTime) in
+      var newBufferAvailable = true
+
+      let inputCallback: AVAudioConverterInputBlock = {
+        inNumPackets, outStatus in
+        if newBufferAvailable {
+          outStatus.pointee = .haveData
+          newBufferAvailable = false
+
+          return buffer
+        } else {
+          outStatus.pointee = .noDataNow
+          return nil
+        }
+      }
+
+      let convertedBuffer = AVAudioPCMBuffer(
+        pcmFormat: outputFormat,
+        frameCapacity:
+          AVAudioFrameCount(outputFormat.sampleRate)
+          * buffer.frameLength
+          / AVAudioFrameCount(buffer.format.sampleRate))!
+
+      var error: NSError?
+      let _ = converter.convert(
+        to: convertedBuffer,
+        error: &error, withInputFrom: inputCallback)
+
+      // TODO(fangjun): Handle status != haveData
+
+      let array = convertedBuffer.array()
+      if !array.isEmpty {
+        self.recognizer.acceptWaveform(samples: array)
+        self.recognizer.decode()
+        let isEndpoint = self.recognizer.isEndpoint()
+        let text = self.recognizer.getResult().text
+
+        if !text.isEmpty && self.lastSentence != text {
+          self.lastSentence = text
+          self.updateLabel()
+          print(text)
+        }
+
+        if isEndpoint && !text.isEmpty {
+          let tmp = self.lastSentence
+          self.lastSentence = ""
+          self.sentences.append(tmp)
+        }
+      }
+    }
+
+  }
+
+  func startRecorder() {
+    lastSentence = ""
+    sentences = []
+
+    do {
+      try self.audioEngine?.start()
+    } catch let error as NSError {
+      print("Got an error starting audioEngine: \(error.domain), \(error)")
+    }
+    print("started")
+  }
+
+  func stopRecorder() {
+    audioEngine?.stop()
+    print("stopped")
+  }
+}

BIN=BIN
ios-swift/SherpaNcnn/SherpaNcnn/k2-1024x1024.png


+ 36 - 0
ios-swift/SherpaNcnn/SherpaNcnnTests/SherpaNcnnTests.swift

@@ -0,0 +1,36 @@
+//
+//  SherpaNcnnTests.swift
+//  SherpaNcnnTests
+//
+//  Created by fangjun on 2023/1/28.
+//
+
+import XCTest
+@testable import SherpaNcnn
+
+final class SherpaNcnnTests: XCTestCase {
+
+    override func setUpWithError() throws {
+        // Put setup code here. This method is called before the invocation of each test method in the class.
+    }
+
+    override func tearDownWithError() throws {
+        // Put teardown code here. This method is called after the invocation of each test method in the class.
+    }
+
+    func testExample() throws {
+        // This is an example of a functional test case.
+        // Use XCTAssert and related functions to verify your tests produce the correct results.
+        // Any test you write for XCTest can be annotated as throws and async.
+        // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
+        // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
+    }
+
+    func testPerformanceExample() throws {
+        // This is an example of a performance test case.
+        self.measure {
+            // Put the code you want to measure the time of here.
+        }
+    }
+
+}

+ 41 - 0
ios-swift/SherpaNcnn/SherpaNcnnUITests/SherpaNcnnUITests.swift

@@ -0,0 +1,41 @@
+//
+//  SherpaNcnnUITests.swift
+//  SherpaNcnnUITests
+//
+//  Created by fangjun on 2023/1/28.
+//
+
+import XCTest
+
+final class SherpaNcnnUITests: XCTestCase {
+
+    override func setUpWithError() throws {
+        // Put setup code here. This method is called before the invocation of each test method in the class.
+
+        // In UI tests it is usually best to stop immediately when a failure occurs.
+        continueAfterFailure = false
+
+        // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
+    }
+
+    override func tearDownWithError() throws {
+        // Put teardown code here. This method is called after the invocation of each test method in the class.
+    }
+
+    func testExample() throws {
+        // UI tests must launch the application that they test.
+        let app = XCUIApplication()
+        app.launch()
+
+        // Use XCTAssert and related functions to verify your tests produce the correct results.
+    }
+
+    func testLaunchPerformance() throws {
+        if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
+            // This measures how long it takes to launch your application.
+            measure(metrics: [XCTApplicationLaunchMetric()]) {
+                XCUIApplication().launch()
+            }
+        }
+    }
+}

+ 32 - 0
ios-swift/SherpaNcnn/SherpaNcnnUITests/SherpaNcnnUITestsLaunchTests.swift

@@ -0,0 +1,32 @@
+//
+//  SherpaNcnnUITestsLaunchTests.swift
+//  SherpaNcnnUITests
+//
+//  Created by fangjun on 2023/1/28.
+//
+
+import XCTest
+
+final class SherpaNcnnUITestsLaunchTests: XCTestCase {
+
+    override class var runsForEachTargetApplicationUIConfiguration: Bool {
+        true
+    }
+
+    override func setUpWithError() throws {
+        continueAfterFailure = false
+    }
+
+    func testLaunch() throws {
+        let app = XCUIApplication()
+        app.launch()
+
+        // Insert steps here to perform after app launch but before taking a screenshot,
+        // such as logging into a test account or navigating somewhere in the app
+
+        let attachment = XCTAttachment(screenshot: app.screenshot())
+        attachment.name = "Launch Screen"
+        attachment.lifetime = .keepAlways
+        add(attachment)
+    }
+}