Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.
Swift apple-siliconcustom-formathomebrewiosipaipadipadosiphonemetalnative-portnintendo-switchnxnativeromfsswitch-games
iOS shell: app icon from an Icon Composer document
v0lumehibde46da84359
diff --git a/frontend-ios/AppIcon.icon/Assets/bar.svg b/frontend-ios/AppIcon.icon/Assets/bar.svgnew file mode 100644index 00000000..22f65858--- /dev/null+++ b/frontend-ios/AppIcon.icon/Assets/bar.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">+ <path fill="#FFF0D6" fill-rule="nonzero" d="M612.57 696.58L612.57 696.58C612.57 687.66 605.33 680.43 596.41 680.43L427.59 680.43C418.67 680.43 411.43 687.66 411.43 696.58L411.43 696.58C411.43 705.51 418.67 712.74 427.59 712.74L596.41 712.74C605.33 712.74 612.57 705.51 612.57 696.58Z"/>+</svg>diff --git a/frontend-ios/AppIcon.icon/Assets/glow-soft.svg b/frontend-ios/AppIcon.icon/Assets/glow-soft.svgnew file mode 100644index 00000000..b41c0352--- /dev/null+++ b/frontend-ios/AppIcon.icon/Assets/glow-soft.svg@@ -0,0 +1,9 @@+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">+ <defs><radialGradient id="g" cx="512" cy="440" r="470" gradientUnits="userSpaceOnUse">+ <stop offset="0" stop-color="#FFA54A" stop-opacity="0.95"/>+ <stop offset="0.35" stop-color="#B8561A" stop-opacity="0.7"/>+ <stop offset="0.75" stop-color="#4A1C06" stop-opacity="0.25"/>+ <stop offset="1" stop-color="#1A0A02" stop-opacity="0"/>+ </radialGradient></defs>+ <rect width="1024" height="1024" fill="url(#g)"/>+</svg>diff --git a/frontend-ios/AppIcon.icon/Assets/nx.svg b/frontend-ios/AppIcon.icon/Assets/nx.svgnew file mode 100644index 00000000..68635b09--- /dev/null+++ b/frontend-ios/AppIcon.icon/Assets/nx.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">+ <path fill="#FFF0D6" fill-rule="nonzero" d="M216.21 608.35L216.21 302.62L299.49 302.62L299.49 352.96L301.20 352.96Q313.04 326.58 336.42 311.46Q359.81 296.35 394.46 296.35Q444.80 296.35 472.32 326.79Q499.84 357.24 499.84 411.00L499.84 608.35L416.56 608.35L416.56 428.25Q416.56 398.31 402.52 381.84Q388.47 365.37 360.38 365.37Q341.84 365.37 328.15 373.85Q314.46 382.33 306.98 397.45Q299.49 412.56 299.49 432.67L299.49 608.35ZM511.75 608.35L607.58 456.06L512.47 302.62L606.30 302.62L661.20 406.01L662.91 406.01L717.24 302.62L807.79 302.62L712.25 453.92L807.07 608.35L716.52 608.35L658.49 502.40L656.78 502.40L599.31 608.35Z"/>+</svg>diff --git a/frontend-ios/AppIcon.icon/icon.json b/frontend-ios/AppIcon.icon/icon.jsonnew file mode 100644index 00000000..9f8b6b09--- /dev/null+++ b/frontend-ios/AppIcon.icon/icon.json@@ -0,0 +1,175 @@+{+ "features" : [+ "refractivity"+ ],+ "fill-specializations" : [+ {+ "value" : {+ "linear-gradient" : [+ "srgb:0.11500,0.11500,0.11500,1.00000",+ "srgb:0.03000,0.03000,0.03000,1.00000"+ ]+ }+ },+ {+ "appearance" : "dark",+ "value" : {+ "linear-gradient" : [+ "srgb:0.07000,0.07000,0.07000,1.00000",+ "srgb:0.00000,0.00000,0.00000,1.00000"+ ]+ }+ }+ ],+ "groups" : [+ {+ "layers" : [+ {+ "fill-specializations" : [+ {+ "value" : {+ "linear-gradient" : [+ "srgb:1.00000,0.94000,0.84000,0.85000",+ "srgb:1.00000,0.80000,0.56000,0.80000"+ ]+ }+ },+ {+ "appearance" : "tinted",+ "value" : {+ "solid" : "extended-gray:1.00000,1.00000"+ }+ }+ ],+ "glass" : true,+ "image-name" : "nx.svg",+ "name" : "nx"+ }+ ],+ "lighting" : "individual",+ "name" : "nx",+ "position" : {+ "scale" : 1,+ "translation-in-points" : [+ 0,+ -8+ ]+ },+ "refractivity" : {+ "depth" : 0.6,+ "enabled" : true,+ "strength" : 0.6+ },+ "shadow" : {+ "kind" : "neutral",+ "opacity" : 0.6+ },+ "specular" : true,+ "translucency" : {+ "enabled" : true,+ "value" : 0.5+ }+ },+ {+ "layers" : [+ {+ "fill-specializations" : [+ {+ "value" : {+ "solid" : "srgb:1.00000,0.94000,0.84000,0.90000"+ }+ },+ {+ "appearance" : "tinted",+ "value" : {+ "solid" : "extended-gray:1.00000,0.80000"+ }+ }+ ],+ "glass" : true,+ "hidden" : false,+ "image-name" : "bar.svg",+ "name" : "bar"+ }+ ],+ "lighting" : "individual",+ "name" : "bar",+ "position" : {+ "scale" : 1,+ "translation-in-points" : [+ 0,+ 14+ ]+ },+ "refractivity" : {+ "depth" : 0.6,+ "enabled" : true,+ "strength" : 0.6+ },+ "shadow" : {+ "kind" : "neutral",+ "opacity" : 0.6+ },+ "specular" : true,+ "translucency" : {+ "enabled" : true,+ "value" : 0.4+ }+ },+ {+ "layers" : [+ {+ "glass" : false,+ "hidden" : false,+ "image-name" : "glow-soft.svg",+ "name" : "glow",+ "opacity-specializations" : [+ {+ "value" : 1+ },+ {+ "appearance" : "dark",+ "value" : 0.75+ },+ {+ "appearance" : "tinted",+ "value" : 0+ }+ ]+ }+ ],+ "lighting" : "combined",+ "name" : "glow",+ "shadow" : {+ "kind" : "none",+ "opacity" : 0+ },+ "specular" : false,+ "translucency" : {+ "enabled" : false,+ "value" : 0+ }+ },+ {+ "layers" : [++ ],+ "lighting" : "combined",+ "name" : "glow",+ "shadow" : {+ "kind" : "none",+ "opacity" : 0+ },+ "specular" : false,+ "translucency" : {+ "enabled" : false,+ "value" : 0+ }+ }+ ],+ "supported-platforms" : {+ "squares" : [+ "iOS"+ ]+ }+}\ No newline at end of filediff --git a/frontend-ios/Demo/ShellDemo.xcodeproj/project.pbxproj b/frontend-ios/Demo/ShellDemo.xcodeproj/project.pbxprojindex e9144966..0565314e 100644--- a/frontend-ios/Demo/ShellDemo.xcodeproj/project.pbxproj+++ b/frontend-ios/Demo/ShellDemo.xcodeproj/project.pbxproj@@ -7,6 +7,7 @@objects = {/* Begin PBXBuildFile section */+ 0A794660C32B92327759DA96 /* AppIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = 80B29691CA12A696245D564A /* AppIcon.icon */; };2861C1407044359116FE0A66 /* ShellCaptureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8694319745E3759D50772855 /* ShellCaptureTests.swift */; };2BF462D88A6CE3993C4AEB9A /* ShellHostUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3902CFEF269CA462AFE8048 /* ShellHostUITests.swift */; };2EEF6A8F9A7D58C09181EAB5 /* RealArt.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF911DEE5C19B0D069418726 /* RealArt.swift */; };@@ -37,6 +38,7 @@39DB78D11BCF59879A3712F5 /* SampleArt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleArt.swift; sourceTree = "<group>"; };3FAC070A229B08BED4005826 /* Games */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Games; path = ../Tests/ShellHostTests/Fixtures/Games; sourceTree = SOURCE_ROOT; };59E0A7AE45425C5BA9689FE4 /* ShellDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShellDemoApp.swift; sourceTree = "<group>"; };+ 80B29691CA12A696245D564A /* AppIcon.icon */ = {isa = PBXFileReference; lastKnownFileType = wrapper.icon; path = AppIcon.icon; sourceTree = "<group>"; };8694319745E3759D50772855 /* ShellCaptureTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShellCaptureTests.swift; sourceTree = "<group>"; };916109EC3198FC9C0E9D655B /* ShellDemoUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShellDemoUITests.swift; sourceTree = "<group>"; };B1D199F3FD9C677BD245559E /* ShellDemoApp.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = ShellDemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; };@@ -86,6 +88,15 @@path = ../Sources/ShellDemo;sourceTree = "<group>";};+ 85D1F85CF9A0EBBD520F89DC /* frontend-ios */ = {+ isa = PBXGroup;+ children = (+ 80B29691CA12A696245D564A /* AppIcon.icon */,+ );+ name = "frontend-ios";+ path = ..;+ sourceTree = "<group>";+ };B149173B288581EEEA22408A /* UITests */ = {isa = PBXGroup;children = (@@ -119,6 +130,7 @@isa = PBXGroup;children = (3FAC070A229B08BED4005826 /* Games */,+ 85D1F85CF9A0EBBD520F89DC /* frontend-ios */,2152F5714F5AA74B9FBBB0F0 /* Packages */,5928E24F76B598AD8FD0D1AB /* ShellDemo */,B149173B288581EEEA22408A /* UITests */,@@ -211,6 +223,7 @@isa = PBXResourcesBuildPhase;buildActionMask = 2147483647;files = (+ 0A794660C32B92327759DA96 /* AppIcon.icon in Resources */,C12D9CC70DEF69CCB48F44E7 /* Games in Resources */,F15D381F62331B5172AD6D22 /* Localizable.xcstrings in Resources */,);@@ -257,6 +270,7 @@isa = XCBuildConfiguration;buildSettings = {ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;CLANG_ANALYZER_NONNULL = YES;CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";@@ -371,6 +385,7 @@isa = XCBuildConfiguration;buildSettings = {ALWAYS_SEARCH_USER_PATHS = NO;+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;CLANG_ANALYZER_NONNULL = YES;CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";diff --git a/frontend-ios/Demo/project.yml b/frontend-ios/Demo/project.ymlindex 263f3d94..4f9742e2 100644--- a/frontend-ios/Demo/project.yml+++ b/frontend-ios/Demo/project.yml@@ -18,6 +18,7 @@ settings:INFOPLIST_KEY_UISupportedInterfaceOrientations: 'UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortraitUpsideDown'INFOPLIST_KEY_UIUserInterfaceStyle: DarkINFOPLIST_KEY_CFBundleDisplayName: Shell Demo+ ASSETCATALOG_COMPILER_APPICON_NAME: AppIconSWIFT_EMIT_LOC_STRINGS: YEStargets:ShellDemoApp:@@ -29,6 +30,7 @@ targets:- path: ../Tests/ShellHostTests/Fixtures/Gamestype: folderbuildPhase: resources+ - path: ../AppIcon.icon # the app icon, shared with the shell app (dm/ios/project-shell.yml)dependencies:- package: ShellUIproduct: ShellUIdiff --git a/frontend-ios/README.md b/frontend-ios/README.mdindex f41fab72..825683a4 100644--- a/frontend-ios/README.md+++ b/frontend-ios/README.md@@ -19,6 +19,8 @@ xcodebuild -project frontend-ios/Demo/ShellDemo.xcodeproj -scheme ShellDemo \`ShellDemo` is also an executable package target for previews on the Mac. The Xcode app target is `ShellDemoApp`.+The app icon of the demo app and of the shell app (`dm/ios/project-shell.yml`) is `frontend-ios/AppIcon.icon`. It is edited in Icon Composer.+## IntegrateAll boundary types are in `Sources/ShellUI/ShellInputs.swift` and `ShellArtwork.swift`: