From f82b131ea80b1e682a5b4a258911180090ebebdb Mon Sep 17 00:00:00 2001 From: Nicholas Entin Date: Fri, 26 Jan 2024 22:42:34 -0800 Subject: [PATCH] Enable visionOS support --- .../ProjectData/main.json | 11 + .../WorkspaceData/SceneMetadataList.json | 209 ++++++++++++++++ .../WorkspaceData/Settings.rcprojectdata | 17 ++ .../Packages/RealityKitContent/Package.swift | 25 ++ Example/Packages/RealityKitContent/README.md | 3 + .../Materials/GridMaterial.usda | 216 +++++++++++++++++ .../RealityKitContent.rkassets/Scene.usda | 59 +++++ .../RealityKitContent/RealityKitContent.swift | 4 + .../ParalayoutDemo.xcodeproj/project.pbxproj | 229 ++++++++++++++++++ .../Content.imageset/Contents.json | 12 + .../Back.solidimagestacklayer/Contents.json | 6 + .../AppIcon.solidimagestack/Contents.json | 17 ++ .../Content.imageset/Contents.json | 12 + .../Front.solidimagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 12 + .../Middle.solidimagestacklayer/Contents.json | 6 + .../Assets.xcassets/Contents.json | 6 + .../ParalayoutVisionDemo/ContentView.swift | 27 +++ Example/ParalayoutVisionDemo/Info.plist | 15 ++ .../ParalayoutVisionDemoApp.swift | 17 ++ .../Preview Assets.xcassets/Contents.json | 6 + .../UIKitContentView.swift | 56 +++++ Example/Podfile | 7 + Example/Podfile.lock | 4 +- Paralayout.podspec | 1 + Paralayout/PixelRounding.swift | 4 + 26 files changed, 985 insertions(+), 2 deletions(-) create mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json create mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json create mode 100644 Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata create mode 100644 Example/Packages/RealityKitContent/Package.swift create mode 100644 Example/Packages/RealityKitContent/README.md create mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda create mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda create mode 100644 Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Contents.json create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json create mode 100644 Example/ParalayoutVisionDemo/Assets.xcassets/Contents.json create mode 100644 Example/ParalayoutVisionDemo/ContentView.swift create mode 100644 Example/ParalayoutVisionDemo/Info.plist create mode 100644 Example/ParalayoutVisionDemo/ParalayoutVisionDemoApp.swift create mode 100644 Example/ParalayoutVisionDemo/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 Example/ParalayoutVisionDemo/UIKitContentView.swift diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json b/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json new file mode 100644 index 0000000..4a8c74b --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.realitycomposerpro/ProjectData/main.json @@ -0,0 +1,11 @@ +{ + "pathsToIds" : { + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/GridMaterial.usda" : "440DE5B4-E4E4-459B-AABF-9ACE96319272", + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/procedural_sphere_grid.usda" : "34C460AE-CA1B-4348-BD05-621ACBDFFE97", + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Scene.usda" : "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "\/RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Untitled Scene.usda" : "03E02005-EFA6-48D6-8A76-05B2822A74E9", + "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/GridMaterial.usda" : "FBD8436F-6B8B-4B82-99B5-995D538B4704", + "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/procedural_sphere_grid.usda" : "1CBF3893-ABFD-408C-8B91-045BFD257808", + "RealityKitContent\/Sources\/RealityKitContent\/RealityKitContent.rkassets\/Scene.usda" : "26DBAE76-5DD8-47B6-A085-1B4ADA111097" + } +} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json new file mode 100644 index 0000000..1d84a75 --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/SceneMetadataList.json @@ -0,0 +1,209 @@ +{ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C" : { + "cameraTransform" : [ + 0.9807314, + -1.9820146e-10, + -0.195361, + 0, + -0.10051192, + 0.85749435, + -0.5045798, + 0, + 0.16752096, + 0.51449335, + 0.84097165, + 0, + 0.09084191, + 0.05849296, + 0.13903293, + 1 + ], + "objectMetadataList" : [ + [ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + }, + [ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "Root", + "GridMaterial" + ], + { + "isExpanded" : true, + "isLocked" : false + }, + [ + "0A9B4653-B11E-4D6A-850E-C6FCB621626C", + "Root", + "Sphere" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + }, + "1CBF3893-ABFD-408C-8B91-045BFD257808" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660255, + -0.49999988, + 0, + 0, + 0.49999988, + 0.8660255, + 0, + 0, + 0.27093542, + 0.46927398, + 1 + ], + "objectMetadataList" : [ + + ] + }, + "03E02005-EFA6-48D6-8A76-05B2822A74E9" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660254, + -0.49999994, + 0, + 0, + 0.49999994, + 0.8660254, + 0, + 0, + 0.5981957, + 1.0361054, + 1 + ], + "objectMetadataList" : [ + + ] + }, + "26DBAE76-5DD8-47B6-A085-1B4ADA111097" : { + "cameraTransform" : [ + 1, + 0, + -0, + 0, + -0, + 0.7071069, + -0.7071067, + 0, + 0, + 0.7071067, + 0.7071069, + 0, + 0, + 0.2681068, + 0.26850593, + 1 + ], + "objectMetadataList" : [ + [ + "26DBAE76-5DD8-47B6-A085-1B4ADA111097", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + }, + "34C460AE-CA1B-4348-BD05-621ACBDFFE97" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660255, + -0.49999988, + 0, + 0, + 0.49999988, + 0.8660255, + 0, + 0, + 0.27093542, + 0.46927398, + 1 + ], + "objectMetadataList" : [ + + ] + }, + "440DE5B4-E4E4-459B-AABF-9ACE96319272" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660254, + -0.49999994, + 0, + 0, + 0.49999994, + 0.8660254, + 0, + 0, + 0.5981957, + 1.0361054, + 1 + ], + "objectMetadataList" : [ + [ + "440DE5B4-E4E4-459B-AABF-9ACE96319272", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + }, + "FBD8436F-6B8B-4B82-99B5-995D538B4704" : { + "cameraTransform" : [ + 0.99999994, + 0, + -0, + 0, + -0, + 0.8660254, + -0.49999994, + 0, + 0, + 0.49999994, + 0.8660254, + 0, + 0, + 0.5981957, + 1.0361054, + 1 + ], + "objectMetadataList" : [ + [ + "FBD8436F-6B8B-4B82-99B5-995D538B4704", + "Root" + ], + { + "isExpanded" : true, + "isLocked" : false + } + ] + } +} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata new file mode 100644 index 0000000..6dea95c --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.realitycomposerpro/WorkspaceData/Settings.rcprojectdata @@ -0,0 +1,17 @@ +{ + "cameraPresets" : { + + }, + "secondaryToolbarData" : { + "isGridVisible" : true, + "sceneReverbPreset" : -1 + }, + "unitDefaults" : { + "°" : "°", + "kg" : "g", + "m" : "cm", + "m\/s" : "m\/s", + "m\/s²" : "m\/s²", + "s" : "s" + } +} \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Package.swift b/Example/Packages/RealityKitContent/Package.swift new file mode 100644 index 0000000..d043ae1 --- /dev/null +++ b/Example/Packages/RealityKitContent/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version:5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "RealityKitContent", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "RealityKitContent", + targets: ["RealityKitContent"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .target( + name: "RealityKitContent", + dependencies: []), + ] +) \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/README.md b/Example/Packages/RealityKitContent/README.md new file mode 100644 index 0000000..486b575 --- /dev/null +++ b/Example/Packages/RealityKitContent/README.md @@ -0,0 +1,3 @@ +# RealityKitContent + +A description of this package. \ No newline at end of file diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda new file mode 100644 index 0000000..b7afd02 --- /dev/null +++ b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Materials/GridMaterial.usda @@ -0,0 +1,216 @@ +#usda 1.0 +( + defaultPrim = "Root" + metersPerUnit = 1 + upAxis = "Y" +) + +def Xform "Root" +{ + def Material "GridMaterial" + { + reorder nameChildren = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "DefaultSurfaceShader", "MaterialXPreviewSurface", "Texcoord", "Add", "Multiply", "Fractional", "LineCounts", "Multiply_1", "Separate2", "Separate2_1", "Ifgreater", "Ifgreater_1", "Max", "Background_Color"] + token outputs:mtlx:surface.connect = + token outputs:realitykit:vertex + token outputs:surface + float2 ui:nodegraph:realitykit:subgraphOutputs:pos = (2222, 300.5) + float2 ui:nodegraph:realitykit:subgraphOutputs:size = (182, 89) + int ui:nodegraph:realitykit:subgraphOutputs:stackingOrder = 749 + + def Shader "DefaultSurfaceShader" + { + uniform token info:id = "UsdPreviewSurface" + color3f inputs:diffuseColor = (1, 1, 1) + float inputs:roughness = 0.75 + token outputs:surface + } + + def Shader "MaterialXPreviewSurface" + { + uniform token info:id = "ND_UsdPreviewSurface_surfaceshader" + float inputs:clearcoat + float inputs:clearcoatRoughness + color3f inputs:diffuseColor.connect = + color3f inputs:emissiveColor + float inputs:ior + float inputs:metallic = 0.15 + float3 inputs:normal + float inputs:occlusion + float inputs:opacity + float inputs:opacityThreshold + float inputs:roughness = 0.5 + token outputs:out + float2 ui:nodegraph:node:pos = (1967, 300.5) + float2 ui:nodegraph:node:size = (208, 297) + int ui:nodegraph:node:stackingOrder = 870 + string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["Advanced"] + } + + def Shader "Texcoord" + { + uniform token info:id = "ND_texcoord_vector2" + float2 outputs:out + float2 ui:nodegraph:node:pos = (94.14453, 35.29297) + float2 ui:nodegraph:node:size = (182, 43) + int ui:nodegraph:node:stackingOrder = 1358 + } + + def Shader "Multiply" + { + uniform token info:id = "ND_multiply_vector2" + float2 inputs:in1.connect = + float2 inputs:in2 = (32, 15) + float2 inputs:in2.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (275.64453, 47.29297) + float2 ui:nodegraph:node:size = (61, 36) + int ui:nodegraph:node:stackingOrder = 1348 + string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["inputs:in2"] + } + + def Shader "Fractional" + { + uniform token info:id = "ND_realitykit_fractional_vector2" + float2 inputs:in.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (440.5, 49.5) + float2 ui:nodegraph:node:size = (155, 99) + int ui:nodegraph:node:stackingOrder = 1345 + } + + def Shader "BaseColor" + { + uniform token info:id = "ND_constant_color3" + color3f inputs:value = (0.89737034, 0.89737034, 0.89737034) ( + colorSpace = "Input - Texture - sRGB - sRGB" + ) + color3f inputs:value.connect = None + color3f outputs:out + float2 ui:nodegraph:node:pos = (1537.5977, 363.07812) + float2 ui:nodegraph:node:size = (150, 43) + int ui:nodegraph:node:stackingOrder = 1353 + } + + def Shader "LineColor" + { + uniform token info:id = "ND_constant_color3" + color3f inputs:value = (0.55945957, 0.55945957, 0.55945957) ( + colorSpace = "Input - Texture - sRGB - sRGB" + ) + color3f inputs:value.connect = None + color3f outputs:out + float2 ui:nodegraph:node:pos = (1536.9844, 287.86328) + float2 ui:nodegraph:node:size = (146, 43) + int ui:nodegraph:node:stackingOrder = 1355 + } + + def Shader "LineWidths" + { + uniform token info:id = "ND_combine2_vector2" + float inputs:in1 = 0.1 + float inputs:in2 = 0.1 + float2 outputs:out + float2 ui:nodegraph:node:pos = (443.64453, 233.79297) + float2 ui:nodegraph:node:size = (151, 43) + int ui:nodegraph:node:stackingOrder = 1361 + } + + def Shader "LineCounts" + { + uniform token info:id = "ND_combine2_vector2" + float inputs:in1 = 24 + float inputs:in2 = 12 + float2 outputs:out + float2 ui:nodegraph:node:pos = (94.14453, 138.29297) + float2 ui:nodegraph:node:size = (153, 43) + int ui:nodegraph:node:stackingOrder = 1359 + } + + def Shader "Remap" + { + uniform token info:id = "ND_remap_color3" + color3f inputs:in.connect = + color3f inputs:inhigh.connect = None + color3f inputs:inlow.connect = None + color3f inputs:outhigh.connect = + color3f inputs:outlow.connect = + color3f outputs:out + float2 ui:nodegraph:node:pos = (1755.5, 300.5) + float2 ui:nodegraph:node:size = (95, 171) + int ui:nodegraph:node:stackingOrder = 1282 + string[] ui:nodegraph:realitykit:node:attributesShowingChildren = ["inputs:outlow"] + } + + def Shader "Separate2" + { + uniform token info:id = "ND_separate2_vector2" + float2 inputs:in.connect = + float outputs:outx + float outputs:outy + float2 ui:nodegraph:node:pos = (1212.6445, 128.91797) + float2 ui:nodegraph:node:size = (116, 117) + int ui:nodegraph:node:stackingOrder = 1363 + } + + def Shader "Combine3" + { + uniform token info:id = "ND_combine3_color3" + float inputs:in1.connect = + float inputs:in2.connect = + float inputs:in3.connect = + color3f outputs:out + float2 ui:nodegraph:node:pos = (1578.1445, 128.91797) + float2 ui:nodegraph:node:size = (146, 54) + int ui:nodegraph:node:stackingOrder = 1348 + } + + def Shader "Range" + { + uniform token info:id = "ND_range_vector2" + bool inputs:doclamp = 1 + float2 inputs:gamma = (2, 2) + float2 inputs:in.connect = + float2 inputs:inhigh.connect = + float2 inputs:inlow = (0.02, 0.02) + float2 inputs:outhigh + float2 inputs:outlow + float2 outputs:out + float2 ui:nodegraph:node:pos = (990.64453, 128.91797) + float2 ui:nodegraph:node:size = (98, 207) + int ui:nodegraph:node:stackingOrder = 1364 + } + + def Shader "Subtract" + { + uniform token info:id = "ND_subtract_vector2" + float2 inputs:in1.connect = + float2 inputs:in2.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (612.64453, 87.04297) + float2 ui:nodegraph:node:size = (63, 36) + int ui:nodegraph:node:stackingOrder = 1348 + } + + def Shader "Absval" + { + uniform token info:id = "ND_absval_vector2" + float2 inputs:in.connect = + float2 outputs:out + float2 ui:nodegraph:node:pos = (765.64453, 87.04297) + float2 ui:nodegraph:node:size = (123, 43) + int ui:nodegraph:node:stackingOrder = 1348 + } + + def Shader "Min" + { + uniform token info:id = "ND_min_float" + float inputs:in1.connect = + float inputs:in2.connect = + float outputs:out + float2 ui:nodegraph:node:pos = (1388.1445, 128.91797) + float2 ui:nodegraph:node:size = (114, 36) + int ui:nodegraph:node:stackingOrder = 1363 + } + } +} + diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda new file mode 100644 index 0000000..4cb070b --- /dev/null +++ b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.rkassets/Scene.usda @@ -0,0 +1,59 @@ +#usda 1.0 +( + defaultPrim = "Root" + metersPerUnit = 1 + upAxis = "Y" +) + +def Xform "Root" +{ + reorder nameChildren = ["GridMaterial", "Sphere"] + rel material:binding = None ( + bindMaterialAs = "weakerThanDescendants" + ) + + def Sphere "Sphere" ( + active = true + prepend apiSchemas = ["MaterialBindingAPI"] + ) + { + rel material:binding = ( + bindMaterialAs = "weakerThanDescendants" + ) + double radius = 0.05 + quatf xformOp:orient = (1, 0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + float3 xformOp:translate = (0, 0, 0.0004) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + + def RealityKitComponent "Collider" + { + uint group = 1 + uniform token info:id = "RealityKit.Collider" + uint mask = 4294967295 + token type = "Default" + + def RealityKitStruct "Shape" + { + float3 extent = (0.2, 0.2, 0.2) + float radius = 0.05 + token shapeType = "Sphere" + } + } + + def RealityKitComponent "InputTarget" + { + uniform token info:id = "RealityKit.InputTarget" + } + } + + def "GridMaterial" ( + active = true + prepend references = @Materials/GridMaterial.usda@ + ) + { + float3 xformOp:scale = (1, 1, 1) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] + } +} + diff --git a/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift new file mode 100644 index 0000000..5caba4e --- /dev/null +++ b/Example/Packages/RealityKitContent/Sources/RealityKitContent/RealityKitContent.swift @@ -0,0 +1,4 @@ +import Foundation + +/// Bundle for the RealityKitContent project +public let realityKitContentBundle = Bundle.module diff --git a/Example/ParalayoutDemo.xcodeproj/project.pbxproj b/Example/ParalayoutDemo.xcodeproj/project.pbxproj index d88e0e8..65e6c51 100644 --- a/Example/ParalayoutDemo.xcodeproj/project.pbxproj +++ b/Example/ParalayoutDemo.xcodeproj/project.pbxproj @@ -22,6 +22,13 @@ 3D2881A52B64920900F2A1EA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D2881A32B64920900F2A1EA /* Main.storyboard */; }; 3D2881A72B64920A00F2A1EA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D2881A62B64920A00F2A1EA /* Assets.xcassets */; }; 3D2881AA2B64920A00F2A1EA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D2881A82B64920A00F2A1EA /* LaunchScreen.storyboard */; }; + 3DC24B062B64D7E500F3FADB /* RealityKitContent in Frameworks */ = {isa = PBXBuildFile; productRef = 3DC24B052B64D7E500F3FADB /* RealityKitContent */; }; + 3DC24B082B64D7E500F3FADB /* ParalayoutVisionDemoApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC24B072B64D7E500F3FADB /* ParalayoutVisionDemoApp.swift */; }; + 3DC24B0A2B64D7E500F3FADB /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC24B092B64D7E500F3FADB /* ContentView.swift */; }; + 3DC24B0C2B64D7E600F3FADB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3DC24B0B2B64D7E600F3FADB /* Assets.xcassets */; }; + 3DC24B0F2B64D7E600F3FADB /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3DC24B0E2B64D7E600F3FADB /* Preview Assets.xcassets */; }; + 3DC24B152B64DA9E00F3FADB /* UIKitContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DC24B142B64DA9E00F3FADB /* UIKitContentView.swift */; }; + AB37C692BE369C5BBF1B11C1 /* Pods_ParalayoutVisionDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 677C56ECD27566D4C3881E4C /* Pods_ParalayoutVisionDemo.framework */; }; BE56DECC24CB86EBC45FB81B /* Pods_ParalayoutDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B4977CFAD5319FFF0258BF8 /* Pods_ParalayoutDemo.framework */; }; F20FAA43E36DEA7EF7B2EF68 /* Pods_ParalayoutTVDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2B3529D8CFFFE6ACBDF55FD /* Pods_ParalayoutTVDemo.framework */; }; /* End PBXBuildFile section */ @@ -58,9 +65,20 @@ 3D2881A42B64920900F2A1EA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 3D2881A62B64920A00F2A1EA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 3D2881A92B64920A00F2A1EA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 3DC24B012B64D7E500F3FADB /* ParalayoutVisionDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ParalayoutVisionDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 3DC24B042B64D7E500F3FADB /* RealityKitContent */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = RealityKitContent; sourceTree = ""; }; + 3DC24B072B64D7E500F3FADB /* ParalayoutVisionDemoApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParalayoutVisionDemoApp.swift; sourceTree = ""; }; + 3DC24B092B64D7E500F3FADB /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 3DC24B0B2B64D7E600F3FADB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3DC24B0E2B64D7E600F3FADB /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 3DC24B102B64D7E600F3FADB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3DC24B142B64DA9E00F3FADB /* UIKitContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitContentView.swift; sourceTree = ""; }; + 3ED911B2B4BC9DC23A40E453 /* Pods-ParalayoutVisionDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ParalayoutVisionDemo.release.xcconfig"; path = "Target Support Files/Pods-ParalayoutVisionDemo/Pods-ParalayoutVisionDemo.release.xcconfig"; sourceTree = ""; }; 56BC1C4B5B8050608972ED18 /* Pods_ParalayoutDemo_ParalayoutSnapshotTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ParalayoutDemo_ParalayoutSnapshotTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 66DA0A22B6BAC3A9DB54080E /* Pods-ParalayoutDemo-ParalayoutSnapshotTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ParalayoutDemo-ParalayoutSnapshotTests.release.xcconfig"; path = "Target Support Files/Pods-ParalayoutDemo-ParalayoutSnapshotTests/Pods-ParalayoutDemo-ParalayoutSnapshotTests.release.xcconfig"; sourceTree = ""; }; + 677C56ECD27566D4C3881E4C /* Pods_ParalayoutVisionDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ParalayoutVisionDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A103ABF2C8967E513AA8A2A1 /* Pods-ParalayoutDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ParalayoutDemo.debug.xcconfig"; path = "Target Support Files/Pods-ParalayoutDemo/Pods-ParalayoutDemo.debug.xcconfig"; sourceTree = ""; }; + B3D736C30B36A20847ACD43B /* Pods-ParalayoutVisionDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ParalayoutVisionDemo.debug.xcconfig"; path = "Target Support Files/Pods-ParalayoutVisionDemo/Pods-ParalayoutVisionDemo.debug.xcconfig"; sourceTree = ""; }; F0EE39C2249F3A3CBAE7BE68 /* Pods-ParalayoutDemo-ParalayoutSnapshotTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ParalayoutDemo-ParalayoutSnapshotTests.debug.xcconfig"; path = "Target Support Files/Pods-ParalayoutDemo-ParalayoutSnapshotTests/Pods-ParalayoutDemo-ParalayoutSnapshotTests.debug.xcconfig"; sourceTree = ""; }; F1B27B87E98660865E37B7C1 /* Pods-ParalayoutTVDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ParalayoutTVDemo.debug.xcconfig"; path = "Target Support Files/Pods-ParalayoutTVDemo/Pods-ParalayoutTVDemo.debug.xcconfig"; sourceTree = ""; }; F2B3529D8CFFFE6ACBDF55FD /* Pods_ParalayoutTVDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ParalayoutTVDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -92,6 +110,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3DC24AFE2B64D7E500F3FADB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3DC24B062B64D7E500F3FADB /* RealityKitContent in Frameworks */, + AB37C692BE369C5BBF1B11C1 /* Pods_ParalayoutVisionDemo.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -101,6 +128,8 @@ 3D0BEEAD26047F6400C728FA /* ParalayoutDemo */, 3D0BEED22604854C00C728FA /* ParalayoutSnapshotTests */, 3D28819E2B64920900F2A1EA /* ParalayoutTVDemo */, + 3DC24B022B64D7E500F3FADB /* ParalayoutVisionDemo */, + 3DC24B032B64D7E500F3FADB /* Packages */, 3D0BEEAC26047F6400C728FA /* Products */, 7E0941CD49D94306CE8399B6 /* Pods */, A2A4EAD12583EFDA5AA16EAC /* Frameworks */, @@ -113,6 +142,7 @@ 3D0BEEAB26047F6400C728FA /* ParalayoutDemo.app */, 3D0BEED12604854C00C728FA /* ParalayoutSnapshotTests.xctest */, 3D28819D2B64920900F2A1EA /* ParalayoutTVDemo.app */, + 3DC24B012B64D7E500F3FADB /* ParalayoutVisionDemo.app */, ); name = Products; sourceTree = ""; @@ -154,6 +184,35 @@ path = ParalayoutTVDemo; sourceTree = ""; }; + 3DC24B022B64D7E500F3FADB /* ParalayoutVisionDemo */ = { + isa = PBXGroup; + children = ( + 3DC24B072B64D7E500F3FADB /* ParalayoutVisionDemoApp.swift */, + 3DC24B092B64D7E500F3FADB /* ContentView.swift */, + 3DC24B142B64DA9E00F3FADB /* UIKitContentView.swift */, + 3DC24B0B2B64D7E600F3FADB /* Assets.xcassets */, + 3DC24B102B64D7E600F3FADB /* Info.plist */, + 3DC24B0D2B64D7E600F3FADB /* Preview Content */, + ); + path = ParalayoutVisionDemo; + sourceTree = ""; + }; + 3DC24B032B64D7E500F3FADB /* Packages */ = { + isa = PBXGroup; + children = ( + 3DC24B042B64D7E500F3FADB /* RealityKitContent */, + ); + path = Packages; + sourceTree = ""; + }; + 3DC24B0D2B64D7E600F3FADB /* Preview Content */ = { + isa = PBXGroup; + children = ( + 3DC24B0E2B64D7E600F3FADB /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; 7E0941CD49D94306CE8399B6 /* Pods */ = { isa = PBXGroup; children = ( @@ -163,6 +222,8 @@ 66DA0A22B6BAC3A9DB54080E /* Pods-ParalayoutDemo-ParalayoutSnapshotTests.release.xcconfig */, F1B27B87E98660865E37B7C1 /* Pods-ParalayoutTVDemo.debug.xcconfig */, F8B97B440C6E1131045B90BF /* Pods-ParalayoutTVDemo.release.xcconfig */, + B3D736C30B36A20847ACD43B /* Pods-ParalayoutVisionDemo.debug.xcconfig */, + 3ED911B2B4BC9DC23A40E453 /* Pods-ParalayoutVisionDemo.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -173,6 +234,7 @@ 2B4977CFAD5319FFF0258BF8 /* Pods_ParalayoutDemo.framework */, 56BC1C4B5B8050608972ED18 /* Pods_ParalayoutDemo_ParalayoutSnapshotTests.framework */, F2B3529D8CFFFE6ACBDF55FD /* Pods_ParalayoutTVDemo.framework */, + 677C56ECD27566D4C3881E4C /* Pods_ParalayoutVisionDemo.framework */, ); name = Frameworks; sourceTree = ""; @@ -238,6 +300,28 @@ productReference = 3D28819D2B64920900F2A1EA /* ParalayoutTVDemo.app */; productType = "com.apple.product-type.application"; }; + 3DC24B002B64D7E500F3FADB /* ParalayoutVisionDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3DC24B112B64D7E600F3FADB /* Build configuration list for PBXNativeTarget "ParalayoutVisionDemo" */; + buildPhases = ( + 55384290183EBEB21495FC4D /* [CP] Check Pods Manifest.lock */, + 3DC24AFD2B64D7E500F3FADB /* Sources */, + 3DC24AFE2B64D7E500F3FADB /* Frameworks */, + 3DC24AFF2B64D7E500F3FADB /* Resources */, + 954DC931173487C6787A7F41 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ParalayoutVisionDemo; + packageProductDependencies = ( + 3DC24B052B64D7E500F3FADB /* RealityKitContent */, + ); + productName = ParalayoutVisionDemo; + productReference = 3DC24B012B64D7E500F3FADB /* ParalayoutVisionDemo.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -257,6 +341,9 @@ 3D28819C2B64920900F2A1EA = { CreatedOnToolsVersion = 15.2; }; + 3DC24B002B64D7E500F3FADB = { + CreatedOnToolsVersion = 15.2; + }; }; }; buildConfigurationList = 3D0BEEA626047F6400C728FA /* Build configuration list for PBXProject "ParalayoutDemo" */; @@ -275,6 +362,7 @@ 3D0BEEAA26047F6400C728FA /* ParalayoutDemo */, 3D0BEED02604854C00C728FA /* ParalayoutSnapshotTests */, 3D28819C2B64920900F2A1EA /* ParalayoutTVDemo */, + 3DC24B002B64D7E500F3FADB /* ParalayoutVisionDemo */, ); }; /* End PBXProject section */ @@ -306,6 +394,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3DC24AFF2B64D7E500F3FADB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3DC24B0F2B64D7E600F3FADB /* Preview Assets.xcassets in Resources */, + 3DC24B0C2B64D7E600F3FADB /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -365,6 +462,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ParalayoutDemo-ParalayoutSnapshotTests/Pods-ParalayoutDemo-ParalayoutSnapshotTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 55384290183EBEB21495FC4D /* [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-ParalayoutVisionDemo-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; + }; 7947B4CD2572DC4A609A1457 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -382,6 +501,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ParalayoutTVDemo/Pods-ParalayoutTVDemo-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 954DC931173487C6787A7F41 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ParalayoutVisionDemo/Pods-ParalayoutVisionDemo-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-ParalayoutVisionDemo/Pods-ParalayoutVisionDemo-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ParalayoutVisionDemo/Pods-ParalayoutVisionDemo-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; F763318CE664BA5D8B464D85 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -459,6 +595,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 3DC24AFD2B64D7E500F3FADB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3DC24B0A2B64D7E500F3FADB /* ContentView.swift in Sources */, + 3DC24B152B64DA9E00F3FADB /* UIKitContentView.swift in Sources */, + 3DC24B082B64D7E500F3FADB /* ParalayoutVisionDemoApp.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -758,6 +904,73 @@ }; name = Release; }; + 3DC24B122B64D7E600F3FADB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B3D736C30B36A20847ACD43B /* Pods-ParalayoutVisionDemo.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ParalayoutVisionDemo/Preview Content\""; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "$(TARGET_NAME)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.squareup.ParalayoutVisionDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = xros; + SUPPORTED_PLATFORMS = "xros xrsimulator"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 1.0; + }; + name = Debug; + }; + 3DC24B132B64D7E600F3FADB /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3ED911B2B4BC9DC23A40E453 /* Pods-ParalayoutVisionDemo.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"ParalayoutVisionDemo/Preview Content\""; + ENABLE_PREVIEWS = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "$(TARGET_NAME)/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.squareup.ParalayoutVisionDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = xros; + SUPPORTED_PLATFORMS = "xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 1.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -797,7 +1010,23 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 3DC24B112B64D7E600F3FADB /* Build configuration list for PBXNativeTarget "ParalayoutVisionDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3DC24B122B64D7E600F3FADB /* Debug */, + 3DC24B132B64D7E600F3FADB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ + +/* Begin XCSwiftPackageProductDependency section */ + 3DC24B052B64D7E500F3FADB /* RealityKitContent */ = { + isa = XCSwiftPackageProductDependency; + productName = RealityKitContent; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 3D0BEEA326047F6400C728FA /* Project object */; } diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..04056a5 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "vision", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Contents.json new file mode 100644 index 0000000..950af4d --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.solidimagestacklayer" + }, + { + "filename" : "Middle.solidimagestacklayer" + }, + { + "filename" : "Back.solidimagestacklayer" + } + ] +} diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..04056a5 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "vision", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json new file mode 100644 index 0000000..04056a5 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "idiom" : "vision", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/ParalayoutVisionDemo/Assets.xcassets/Contents.json b/Example/ParalayoutVisionDemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/ParalayoutVisionDemo/ContentView.swift b/Example/ParalayoutVisionDemo/ContentView.swift new file mode 100644 index 0000000..8313abb --- /dev/null +++ b/Example/ParalayoutVisionDemo/ContentView.swift @@ -0,0 +1,27 @@ +// +// ContentView.swift +// ParalayoutVisionDemo +// +// Created by Nicholas Entin on 1/26/24. +// + +import SwiftUI +import RealityKit +import RealityKitContent +import UIKit + +struct ContentView: View { + var body: some View { + VStack { + Model3D(named: "Scene", bundle: realityKitContentBundle) + .padding(.bottom, 50) + + UIKitContentView() + } + .padding() + } +} + +#Preview(windowStyle: .automatic) { + ContentView() +} diff --git a/Example/ParalayoutVisionDemo/Info.plist b/Example/ParalayoutVisionDemo/Info.plist new file mode 100644 index 0000000..20f75e2 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Info.plist @@ -0,0 +1,15 @@ + + + + + UIApplicationSceneManifest + + UIApplicationPreferredDefaultSceneSessionRole + UIWindowSceneSessionRoleApplication + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + + + diff --git a/Example/ParalayoutVisionDemo/ParalayoutVisionDemoApp.swift b/Example/ParalayoutVisionDemo/ParalayoutVisionDemoApp.swift new file mode 100644 index 0000000..c19683f --- /dev/null +++ b/Example/ParalayoutVisionDemo/ParalayoutVisionDemoApp.swift @@ -0,0 +1,17 @@ +// +// ParalayoutVisionDemoApp.swift +// ParalayoutVisionDemo +// +// Created by Nicholas Entin on 1/26/24. +// + +import SwiftUI + +@main +struct ParalayoutVisionDemoApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/Example/ParalayoutVisionDemo/Preview Content/Preview Assets.xcassets/Contents.json b/Example/ParalayoutVisionDemo/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Example/ParalayoutVisionDemo/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Example/ParalayoutVisionDemo/UIKitContentView.swift b/Example/ParalayoutVisionDemo/UIKitContentView.swift new file mode 100644 index 0000000..25fdbd5 --- /dev/null +++ b/Example/ParalayoutVisionDemo/UIKitContentView.swift @@ -0,0 +1,56 @@ +// +// UIKitContentView.swift +// ParalayoutVisionDemo +// +// Created by Nicholas Entin on 1/26/24. +// + +import Paralayout +import SwiftUI +import UIKit + +struct UIKitContentView: UIViewRepresentable { + + typealias UIViewType = CustomView + + func makeUIView(context: Context) -> CustomView { + return CustomView() + } + + func updateUIView(_ uiView: CustomView, context: Context) { + // No-op. + } + +} + +final class CustomView: UIView { + + // MARK: - Life Cycle + + override init(frame: CGRect) { + super.init(frame: frame) + + label.text = "Hello, TV" + label.textColor = .black + addSubview(label) + + backgroundColor = .white + } + + @available(*, unavailable) + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Private Properties + + private let label: UILabel = .init() + + // MARK: - UIView + + override func layoutSubviews() { + label.sizeToFit() + label.align(withSuperview: .center) + } + +} diff --git a/Example/Podfile b/Example/Podfile index 104c0d4..38e290f 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -15,3 +15,10 @@ target 'ParalayoutTVDemo' do pod 'Paralayout', :path => '../Paralayout.podspec', :testspecs => ['Tests'] end + +target 'ParalayoutVisionDemo' do + platform :visionos, '1.0' + use_frameworks! + + pod 'Paralayout', :path => '../Paralayout.podspec', :testspecs => ['Tests'] +end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index d20bc06..344e8dc 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -17,9 +17,9 @@ EXTERNAL SOURCES: :path: "../Paralayout.podspec" SPEC CHECKSUMS: - Paralayout: 630413fce9d44e3553e5da7ba8cdf090d3851ff5 + Paralayout: 3f0e1cd698c2cff6c362488e3cc9b31c9f23f507 SnapshotTesting: 38947050d13960d57a4a9c166fcf51bca7d56970 -PODFILE CHECKSUM: 1195b1e2af1889f21c2642dcd8511d34ed3e16c3 +PODFILE CHECKSUM: e96f063df6b977d7126db1b83aead0ae8107f060 COCOAPODS: 1.14.3 diff --git a/Paralayout.podspec b/Paralayout.podspec index 363ef7c..1dc7b8d 100644 --- a/Paralayout.podspec +++ b/Paralayout.podspec @@ -9,6 +9,7 @@ Pod::Spec.new do |s| s.source_files = 'Paralayout/*.{swift}' s.ios.deployment_target = '12.0' s.tvos.deployment_target = '14.0' + s.visionos.deployment_target = '1.0' s.swift_version = '5.0' s.test_spec 'Tests' do |test_spec| diff --git a/Paralayout/PixelRounding.swift b/Paralayout/PixelRounding.swift index 2c9d3e5..84ab6b1 100644 --- a/Paralayout/PixelRounding.swift +++ b/Paralayout/PixelRounding.swift @@ -23,6 +23,8 @@ public protocol ScaleFactorProviding { } +#if os(iOS) || os(tvOS) + extension UIScreen: ScaleFactorProviding { public var pixelsPerPoint: CGFloat { @@ -31,6 +33,8 @@ extension UIScreen: ScaleFactorProviding { } +#endif + extension UIView: ScaleFactorProviding { public var pixelsPerPoint: CGFloat {