From 0910d03b55b9832e7b92e8d3aef6d309f262a421 Mon Sep 17 00:00:00 2001 From: Max Cobb Date: Mon, 10 Apr 2023 23:08:31 +0100 Subject: [PATCH 1/4] Updated Example project. And made changes for swift 5.8 compat --- .../project.pbxproj | 397 +++++++++++++++++ .../contents.xcworkspacedata | 0 .../RealityUI+Example/ARViewContainer.swift | 114 +++++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 63 +++ .../Assets.xcassets/Contents.json | 0 .../RealityUI+Example/ContentView.swift | 48 ++ .../Preview Assets.xcassets/Contents.json | 6 + .../RealityUI_Example.entitlements | 10 + .../RealityUI_ExampleApp.swift | 17 + .../RealityUI-Example-Info.plist | 5 + .../project.pbxproj | 415 ------------------ .../RealityUI+Examples/AppDelegate.swift | 26 -- .../AppIcon.appiconset/Contents.json | 98 ----- .../rotato.imageset/Contents.json | 21 - .../rotato.imageset/rotato.png | Bin 17482 -> 0 bytes .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Entity+Extensions.swift | 18 - .../RealityUI+Examples/Info.plist | 48 -- .../ViewController+NonRealityUI.swift | 128 ------ .../ViewController+RealityControls.swift | 130 ------ .../RealityUI+Examples/ViewController.swift | 56 --- Sources/RealityUI/RUIButton.swift | 2 + Sources/RealityUI/RUISlider.swift | 2 + Sources/RealityUI/RUIStepper.swift | 2 + Sources/RealityUI/RUISwitch.swift | 2 + Sources/RealityUI/RUIText.swift | 2 + Sources/RealityUI/RUITexture.swift | 49 +-- 28 files changed, 682 insertions(+), 1013 deletions(-) create mode 100644 RealityUI+Example/RealityUI+Example.xcodeproj/project.pbxproj rename {RealityUI+Examples/RealityUI+Examples.xcodeproj => RealityUI+Example/RealityUI+Example.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) create mode 100644 RealityUI+Example/RealityUI+Example/ARViewContainer.swift create mode 100644 RealityUI+Example/RealityUI+Example/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 RealityUI+Example/RealityUI+Example/Assets.xcassets/AppIcon.appiconset/Contents.json rename {RealityUI+Examples/RealityUI+Examples => RealityUI+Example/RealityUI+Example}/Assets.xcassets/Contents.json (100%) create mode 100644 RealityUI+Example/RealityUI+Example/ContentView.swift create mode 100644 RealityUI+Example/RealityUI+Example/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 RealityUI+Example/RealityUI+Example/RealityUI_Example.entitlements create mode 100644 RealityUI+Example/RealityUI+Example/RealityUI_ExampleApp.swift create mode 100644 RealityUI+Example/RealityUI-Example-Info.plist delete mode 100644 RealityUI+Examples/RealityUI+Examples.xcodeproj/project.pbxproj delete mode 100644 RealityUI+Examples/RealityUI+Examples/AppDelegate.swift delete mode 100644 RealityUI+Examples/RealityUI+Examples/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 RealityUI+Examples/RealityUI+Examples/Assets.xcassets/rotato.imageset/Contents.json delete mode 100644 RealityUI+Examples/RealityUI+Examples/Assets.xcassets/rotato.imageset/rotato.png delete mode 100644 RealityUI+Examples/RealityUI+Examples/Base.lproj/LaunchScreen.storyboard delete mode 100644 RealityUI+Examples/RealityUI+Examples/Entity+Extensions.swift delete mode 100644 RealityUI+Examples/RealityUI+Examples/Info.plist delete mode 100644 RealityUI+Examples/RealityUI+Examples/ViewController+NonRealityUI.swift delete mode 100644 RealityUI+Examples/RealityUI+Examples/ViewController+RealityControls.swift delete mode 100644 RealityUI+Examples/RealityUI+Examples/ViewController.swift diff --git a/RealityUI+Example/RealityUI+Example.xcodeproj/project.pbxproj b/RealityUI+Example/RealityUI+Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..06ddda9 --- /dev/null +++ b/RealityUI+Example/RealityUI+Example.xcodeproj/project.pbxproj @@ -0,0 +1,397 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + F31E9ADC29E47B060084306F /* RealityUI_ExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F31E9ADB29E47B060084306F /* RealityUI_ExampleApp.swift */; }; + F31E9ADE29E47B060084306F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F31E9ADD29E47B060084306F /* ContentView.swift */; }; + F31E9AE029E47B090084306F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F31E9ADF29E47B090084306F /* Assets.xcassets */; }; + F31E9AE429E47B090084306F /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F31E9AE329E47B090084306F /* Preview Assets.xcassets */; }; + F31E9AED29E47B700084306F /* ARViewContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F31E9AEC29E47B700084306F /* ARViewContainer.swift */; }; + F31E9AF129E47CD20084306F /* RealityUI in Frameworks */ = {isa = PBXBuildFile; productRef = F31E9AF029E47CD20084306F /* RealityUI */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + F31E9AD829E47B060084306F /* RealityUI+Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RealityUI+Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + F31E9ADB29E47B060084306F /* RealityUI_ExampleApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RealityUI_ExampleApp.swift; sourceTree = ""; }; + F31E9ADD29E47B060084306F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + F31E9ADF29E47B090084306F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + F31E9AE129E47B090084306F /* RealityUI_Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RealityUI_Example.entitlements; sourceTree = ""; }; + F31E9AE329E47B090084306F /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + F31E9AEB29E47B2E0084306F /* RealityUI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = RealityUI; path = ..; sourceTree = ""; }; + F31E9AEC29E47B700084306F /* ARViewContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARViewContainer.swift; sourceTree = ""; }; + F31E9AEE29E47CCB0084306F /* RealityUI-Example-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "RealityUI-Example-Info.plist"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + F31E9AD529E47B060084306F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F31E9AF129E47CD20084306F /* RealityUI in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + F31E9ACF29E47B060084306F = { + isa = PBXGroup; + children = ( + F31E9AEA29E47B2E0084306F /* Packages */, + F31E9ADA29E47B060084306F /* RealityUI+Example */, + F31E9AD929E47B060084306F /* Products */, + F31E9AEF29E47CD20084306F /* Frameworks */, + ); + sourceTree = ""; + }; + F31E9AD929E47B060084306F /* Products */ = { + isa = PBXGroup; + children = ( + F31E9AD829E47B060084306F /* RealityUI+Example.app */, + ); + name = Products; + sourceTree = ""; + }; + F31E9ADA29E47B060084306F /* RealityUI+Example */ = { + isa = PBXGroup; + children = ( + F31E9AEE29E47CCB0084306F /* RealityUI-Example-Info.plist */, + F31E9ADB29E47B060084306F /* RealityUI_ExampleApp.swift */, + F31E9ADD29E47B060084306F /* ContentView.swift */, + F31E9AEC29E47B700084306F /* ARViewContainer.swift */, + F31E9ADF29E47B090084306F /* Assets.xcassets */, + F31E9AE129E47B090084306F /* RealityUI_Example.entitlements */, + F31E9AE229E47B090084306F /* Preview Content */, + ); + path = "RealityUI+Example"; + sourceTree = ""; + }; + F31E9AE229E47B090084306F /* Preview Content */ = { + isa = PBXGroup; + children = ( + F31E9AE329E47B090084306F /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + F31E9AEA29E47B2E0084306F /* Packages */ = { + isa = PBXGroup; + children = ( + F31E9AEB29E47B2E0084306F /* RealityUI */, + ); + name = Packages; + sourceTree = ""; + }; + F31E9AEF29E47CD20084306F /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + F31E9AD729E47B060084306F /* RealityUI+Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = F31E9AE729E47B090084306F /* Build configuration list for PBXNativeTarget "RealityUI+Example" */; + buildPhases = ( + F31E9AD429E47B060084306F /* Sources */, + F31E9AD529E47B060084306F /* Frameworks */, + F31E9AD629E47B060084306F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "RealityUI+Example"; + packageProductDependencies = ( + F31E9AF029E47CD20084306F /* RealityUI */, + ); + productName = "RealityUI+Example"; + productReference = F31E9AD829E47B060084306F /* RealityUI+Example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + F31E9AD029E47B060084306F /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; + TargetAttributes = { + F31E9AD729E47B060084306F = { + CreatedOnToolsVersion = 14.3; + }; + }; + }; + buildConfigurationList = F31E9AD329E47B060084306F /* Build configuration list for PBXProject "RealityUI+Example" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = F31E9ACF29E47B060084306F; + productRefGroup = F31E9AD929E47B060084306F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + F31E9AD729E47B060084306F /* RealityUI+Example */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + F31E9AD629E47B060084306F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F31E9AE429E47B090084306F /* Preview Assets.xcassets in Resources */, + F31E9AE029E47B090084306F /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + F31E9AD429E47B060084306F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + F31E9ADE29E47B060084306F /* ContentView.swift in Sources */, + F31E9ADC29E47B060084306F /* RealityUI_ExampleApp.swift in Sources */, + F31E9AED29E47B700084306F /* ARViewContainer.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + F31E9AE529E47B090084306F /* 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; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + F31E9AE629E47B090084306F /* 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; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + F31E9AE829E47B090084306F /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "RealityUI+Example/RealityUI_Example.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"RealityUI+Example/Preview Content\""; + DEVELOPMENT_TEAM = 278494H572; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "RealityUI-Example-Info.plist"; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 13.1; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "uk.rocketar.RealityUI-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + F31E9AE929E47B090084306F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "RealityUI+Example/RealityUI_Example.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"RealityUI+Example/Preview Content\""; + DEVELOPMENT_TEAM = 278494H572; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "RealityUI-Example-Info.plist"; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 16.4; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 13.1; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "uk.rocketar.RealityUI-Example"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + F31E9AD329E47B060084306F /* Build configuration list for PBXProject "RealityUI+Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F31E9AE529E47B090084306F /* Debug */, + F31E9AE629E47B090084306F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + F31E9AE729E47B090084306F /* Build configuration list for PBXNativeTarget "RealityUI+Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F31E9AE829E47B090084306F /* Debug */, + F31E9AE929E47B090084306F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCSwiftPackageProductDependency section */ + F31E9AF029E47CD20084306F /* RealityUI */ = { + isa = XCSwiftPackageProductDependency; + productName = RealityUI; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = F31E9AD029E47B060084306F /* Project object */; +} diff --git a/RealityUI+Examples/RealityUI+Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/RealityUI+Example/RealityUI+Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from RealityUI+Examples/RealityUI+Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to RealityUI+Example/RealityUI+Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/RealityUI+Example/RealityUI+Example/ARViewContainer.swift b/RealityUI+Example/RealityUI+Example/ARViewContainer.swift new file mode 100644 index 0000000..312790b --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/ARViewContainer.swift @@ -0,0 +1,114 @@ +// +// ARViewContainer.swift +// RealityUI+Example +// +// Created by Max Cobb on 10/04/2023. +// + +import Foundation +import RealityKit +import SwiftUI +import RealityUI +#if os(macOS) +typealias UIViewRepresentable = NSViewRepresentable +#endif + +struct ARViewContainer: UIViewRepresentable { + func makeNSView(context: Context) -> ARView { + self.makeUIView(context: context) + } + + func updateNSView(_ nsView: ARView, context: Context) { + updateUIView(nsView, context: context) + } + + typealias NSViewType = ARView + + + @Binding var objectType: RealityObject + @Binding var stepperTally: Int + @State fileprivate var prevObjectType: RealityObject? = nil + func makeUIView(context: Context) -> ARView { + // Create an ARView + let arView = ARView(frame: .zero) + #if os(iOS) + arView.cameraMode = .nonAR + #endif + + // Add the anchor to the scene + let anchor = AnchorEntity(world: .zero) + arView.scene.addAnchor(anchor) + let cam = PerspectiveCamera() + cam.look(at: .zero, from: [0, 0, -2.5], relativeTo: nil) + anchor.addChild(cam) + + self.setModel(view: arView) + RealityUI.enableGestures(.all, on: arView) + return arView + } + + func setModel(view: ARView) { + guard let worldAnchor = view.scene.anchors.first, + prevObjectType != objectType else + { return } + if let oldRui = view.scene.findEntity(named: "ruiReplace") { + worldAnchor.removeChild(oldRui) + } + view.environment.background = .color(.gray) + switch objectType { + case .toggle: + let mySwitch = RUISwitch(switchCallback: { hasSwitch in + view.environment.background = .color(hasSwitch.isOn ? .green : .gray) + }) + mySwitch.name = "ruiReplace" + worldAnchor.addChild(mySwitch) + case .slider: + let scalingCube = ModelEntity(mesh: .generateBox(size: 3)) + scalingCube.position.z = 3 + let slider = RUISlider(start: 1) { slider, state in + scalingCube.scale = .one * (slider.value + 0.2) / 1.2 + } + slider.addChild(scalingCube) + slider.scale = .init(repeating: 0.3) + slider.name = "ruiReplace" + worldAnchor.addChild(slider) + case .stepper: + let stepper = RUIStepper { _ in + stepperTally += 1 + } downTrigger: { _ in + stepperTally -= 1 + } + + stepper.name = "ruiReplace" + worldAnchor.addChild(stepper) + case .button: + let button = RUIButton( + rui: RUIComponent(respondsToLighting: true) + ) { button in + button.ruiShake(by: .init(angle: .pi / 16, axis: [0, 0, 1]), period: 0.05, times: 3) + } + button.look(at: [0, 1, -1], from: .zero, relativeTo: nil) + button.name = "ruiReplace" + worldAnchor.addChild(button) + } + DispatchQueue.main.async { + prevObjectType = objectType + } + } + + func updateUIView(_ uiView: ARView, context: Context) { + setModel(view: uiView) + } +} + +extension ARViewContainer { + func switchAction(switch: HasSwitch) { + + } +} + +struct ARViewContainer_Previews: PreviewProvider { + static var previews: some View { + ARViewContainer(objectType: .constant(.toggle), stepperTally: .constant(0)) + } +} diff --git a/RealityUI+Example/RealityUI+Example/Assets.xcassets/AccentColor.colorset/Contents.json b/RealityUI+Example/RealityUI+Example/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RealityUI+Example/RealityUI+Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/RealityUI+Example/RealityUI+Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..532cd72 --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,63 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/Contents.json b/RealityUI+Example/RealityUI+Example/Assets.xcassets/Contents.json similarity index 100% rename from RealityUI+Examples/RealityUI+Examples/Assets.xcassets/Contents.json rename to RealityUI+Example/RealityUI+Example/Assets.xcassets/Contents.json diff --git a/RealityUI+Example/RealityUI+Example/ContentView.swift b/RealityUI+Example/RealityUI+Example/ContentView.swift new file mode 100644 index 0000000..03ee56c --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/ContentView.swift @@ -0,0 +1,48 @@ +// +// ContentView.swift +// RealityUI+Example +// +// Created by Max Cobb on 10/04/2023. +// + +import SwiftUI + +/// An enum object that will determine which 3D model to display +public enum RealityObject: String, CaseIterable { + case toggle + case slider + case stepper + case button +} + +struct ContentView: View { + /// 3D RealityUI object that is displayed + @State var displayObject: RealityObject = .toggle + @State var stepperTally = 0 + var body: some View { + VStack { + ARViewContainer( + objectType: $displayObject, stepperTally: $stepperTally + ).overlay { + if self.displayObject == .stepper { + VStack { + Text("Stepper Count: \(stepperTally)") + Spacer() + } + } + } + Picker("RealityUI Object", selection: $displayObject) { + ForEach(RealityObject.allCases, id: \.self) { val in + Text(val.rawValue).tag(val) + } + }.pickerStyle(SegmentedPickerStyle()) + } + .padding() + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/RealityUI+Example/RealityUI+Example/Preview Content/Preview Assets.xcassets/Contents.json b/RealityUI+Example/RealityUI+Example/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RealityUI+Example/RealityUI+Example/RealityUI_Example.entitlements b/RealityUI+Example/RealityUI+Example/RealityUI_Example.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/RealityUI_Example.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/RealityUI+Example/RealityUI+Example/RealityUI_ExampleApp.swift b/RealityUI+Example/RealityUI+Example/RealityUI_ExampleApp.swift new file mode 100644 index 0000000..979bde8 --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/RealityUI_ExampleApp.swift @@ -0,0 +1,17 @@ +// +// RealityUI_ExampleApp.swift +// RealityUI+Example +// +// Created by Max Cobb on 10/04/2023. +// + +import SwiftUI + +@main +struct RealityUI_ExampleApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/RealityUI+Example/RealityUI-Example-Info.plist b/RealityUI+Example/RealityUI-Example-Info.plist new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/RealityUI+Example/RealityUI-Example-Info.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/RealityUI+Examples/RealityUI+Examples.xcodeproj/project.pbxproj b/RealityUI+Examples/RealityUI+Examples.xcodeproj/project.pbxproj deleted file mode 100644 index e6c71cf..0000000 --- a/RealityUI+Examples/RealityUI+Examples.xcodeproj/project.pbxproj +++ /dev/null @@ -1,415 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 52; - objects = { - -/* Begin PBXBuildFile section */ - F301D8A8247A62ED004AE1FA /* ViewController+RealityControls.swift in Sources */ = {isa = PBXBuildFile; fileRef = F301D8A7247A62ED004AE1FA /* ViewController+RealityControls.swift */; }; - F3414191246FF53E006B1ECA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3414190246FF53E006B1ECA /* AppDelegate.swift */; }; - F3414193246FF53E006B1ECA /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3414192246FF53E006B1ECA /* ViewController.swift */; }; - F3414195246FF540006B1ECA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F3414194246FF540006B1ECA /* Assets.xcassets */; }; - F3414198246FF540006B1ECA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3414196246FF540006B1ECA /* LaunchScreen.storyboard */; }; - F34141B12471A595006B1ECA /* ShowTime in Frameworks */ = {isa = PBXBuildFile; productRef = F34141B02471A595006B1ECA /* ShowTime */; }; - F361A60F298D58A8006606BC /* RealityUI in Frameworks */ = {isa = PBXBuildFile; productRef = F361A60E298D58A8006606BC /* RealityUI */; }; - F38598C2247AE28F007BBC88 /* Entity+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F38598C1247AE28F007BBC88 /* Entity+Extensions.swift */; }; - F3DB9D81247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DB9D80247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - F301D8A7247A62ED004AE1FA /* ViewController+RealityControls.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+RealityControls.swift"; sourceTree = ""; }; - F341418D246FF53E006B1ECA /* RealityUI+Examples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "RealityUI+Examples.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - F3414190246FF53E006B1ECA /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - F3414192246FF53E006B1ECA /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - F3414194246FF540006B1ECA /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - F3414197246FF540006B1ECA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - F3414199246FF540006B1ECA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F361A60C298D57A5006606BC /* RealityUI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = RealityUI; path = ..; sourceTree = ""; }; - F38598C1247AE28F007BBC88 /* Entity+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Entity+Extensions.swift"; sourceTree = ""; }; - F3DB9D80247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+NonRealityUI.swift"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F341418A246FF53E006B1ECA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F34141B12471A595006B1ECA /* ShowTime in Frameworks */, - F361A60F298D58A8006606BC /* RealityUI in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - F3414184246FF53E006B1ECA = { - isa = PBXGroup; - children = ( - F361A60B298D57A5006606BC /* Packages */, - F341418F246FF53E006B1ECA /* RealityUI+Examples */, - F341418E246FF53E006B1ECA /* Products */, - F361A60D298D58A8006606BC /* Frameworks */, - ); - sourceTree = ""; - }; - F341418E246FF53E006B1ECA /* Products */ = { - isa = PBXGroup; - children = ( - F341418D246FF53E006B1ECA /* RealityUI+Examples.app */, - ); - name = Products; - sourceTree = ""; - }; - F341418F246FF53E006B1ECA /* RealityUI+Examples */ = { - isa = PBXGroup; - children = ( - F3414190246FF53E006B1ECA /* AppDelegate.swift */, - F3414192246FF53E006B1ECA /* ViewController.swift */, - F301D8A7247A62ED004AE1FA /* ViewController+RealityControls.swift */, - F3DB9D80247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift */, - F38598C1247AE28F007BBC88 /* Entity+Extensions.swift */, - F3414194246FF540006B1ECA /* Assets.xcassets */, - F3414196246FF540006B1ECA /* LaunchScreen.storyboard */, - F3414199246FF540006B1ECA /* Info.plist */, - ); - path = "RealityUI+Examples"; - sourceTree = ""; - }; - F361A60B298D57A5006606BC /* Packages */ = { - isa = PBXGroup; - children = ( - F361A60C298D57A5006606BC /* RealityUI */, - ); - name = Packages; - sourceTree = ""; - }; - F361A60D298D58A8006606BC /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - F341418C246FF53E006B1ECA /* RealityUI+Examples */ = { - isa = PBXNativeTarget; - buildConfigurationList = F341419C246FF540006B1ECA /* Build configuration list for PBXNativeTarget "RealityUI+Examples" */; - buildPhases = ( - F3414189246FF53E006B1ECA /* Sources */, - F341418A246FF53E006B1ECA /* Frameworks */, - F341418B246FF53E006B1ECA /* Resources */, - F3CA3A3C2482ABD80013B413 /* Swiftlint */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "RealityUI+Examples"; - packageProductDependencies = ( - F34141B02471A595006B1ECA /* ShowTime */, - F361A60E298D58A8006606BC /* RealityUI */, - ); - productName = "RealityUI+Examples"; - productReference = F341418D246FF53E006B1ECA /* RealityUI+Examples.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - F3414185246FF53E006B1ECA /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1140; - LastUpgradeCheck = 1420; - ORGANIZATIONNAME = "Max Cobb"; - TargetAttributes = { - F341418C246FF53E006B1ECA = { - CreatedOnToolsVersion = 11.4.1; - }; - }; - }; - buildConfigurationList = F3414188246FF53E006B1ECA /* Build configuration list for PBXProject "RealityUI+Examples" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = F3414184246FF53E006B1ECA; - packageReferences = ( - F34141AF2471A595006B1ECA /* XCRemoteSwiftPackageReference "ShowTime" */, - ); - productRefGroup = F341418E246FF53E006B1ECA /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - F341418C246FF53E006B1ECA /* RealityUI+Examples */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - F341418B246FF53E006B1ECA /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F3414195246FF540006B1ECA /* Assets.xcassets in Resources */, - F3414198246FF540006B1ECA /* LaunchScreen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - F3CA3A3C2482ABD80013B413 /* Swiftlint */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = Swiftlint; - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - F3414189246FF53E006B1ECA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F38598C2247AE28F007BBC88 /* Entity+Extensions.swift in Sources */, - F3414193246FF53E006B1ECA /* ViewController.swift in Sources */, - F3DB9D81247D8BF8006D6CE5 /* ViewController+NonRealityUI.swift in Sources */, - F301D8A8247A62ED004AE1FA /* ViewController+RealityControls.swift in Sources */, - F3414191246FF53E006B1ECA /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - F3414196246FF540006B1ECA /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - F3414197246FF540006B1ECA /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - F341419A246FF540006B1ECA /* 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++14"; - CLANG_CXX_LIBRARY = "libc++"; - 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 = 13.4; - 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; - }; - F341419B246FF540006B1ECA /* 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++14"; - CLANG_CXX_LIBRARY = "libc++"; - 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 = 13.4; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - F341419D246FF540006B1ECA /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 278494H572; - INFOPLIST_FILE = "RealityUI+Examples/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = uk.rocketar.test; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - F341419E246FF540006B1ECA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 278494H572; - INFOPLIST_FILE = "RealityUI+Examples/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = uk.rocketar.test; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - F3414188246FF53E006B1ECA /* Build configuration list for PBXProject "RealityUI+Examples" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F341419A246FF540006B1ECA /* Debug */, - F341419B246FF540006B1ECA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F341419C246FF540006B1ECA /* Build configuration list for PBXNativeTarget "RealityUI+Examples" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F341419D246FF540006B1ECA /* Debug */, - F341419E246FF540006B1ECA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - F34141AF2471A595006B1ECA /* XCRemoteSwiftPackageReference "ShowTime" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/KaneCheshire/ShowTime.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 2.5.2; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - F34141B02471A595006B1ECA /* ShowTime */ = { - isa = XCSwiftPackageProductDependency; - package = F34141AF2471A595006B1ECA /* XCRemoteSwiftPackageReference "ShowTime" */; - productName = ShowTime; - }; - F361A60E298D58A8006606BC /* RealityUI */ = { - isa = XCSwiftPackageProductDependency; - productName = RealityUI; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = F3414185246FF53E006B1ECA /* Project object */; -} diff --git a/RealityUI+Examples/RealityUI+Examples/AppDelegate.swift b/RealityUI+Examples/RealityUI+Examples/AppDelegate.swift deleted file mode 100644 index 4c34f91..0000000 --- a/RealityUI+Examples/RealityUI+Examples/AppDelegate.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// AppDelegate.swift -// RealityUI+Examples -// -// Created by Max Cobb on 5/16/20. -// Copyright © 2020 Max Cobb. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = ViewController() - window.makeKeyAndVisible() - self.window = window - return true - } -} diff --git a/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/AppIcon.appiconset/Contents.json b/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 9221b9b..0000000 --- a/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/rotato.imageset/Contents.json b/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/rotato.imageset/Contents.json deleted file mode 100644 index ebce670..0000000 --- a/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/rotato.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "rotato.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/rotato.imageset/rotato.png b/RealityUI+Examples/RealityUI+Examples/Assets.xcassets/rotato.imageset/rotato.png deleted file mode 100644 index 57b2411c54d2c4371058e10dae0a20d210f0d554..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17482 zcmeJE^;=Y5^gfIqT3R}k5Gm)S*Y2RW#hCn=>ZOrr(#5o=jpxs?Q9OJG(4s+9ts6??L2WyZhQPXtN-i`#xsLx*q&PJ z3GR#HWk&t4SRy4Gg!1oONR<1oKM&o=e(3${jr1ZH=zj2a-H^(<;nIozmX7+jh1SbM zcDq*vK}!sw)pJU-2w^MV&7-F&KLka8KIdk}ab1vPA&pI^I7mGA8_QOe;nl>a#0=}$ zUB$~|8Y%rF2Um0<8eKa!Pwiyg);2Nq54M#q3S1o2on)ISoBG0O^j)I4(OoCLvMS#` za^>Bp+5z04*lR~lR2knnfi921kHl8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L6!1r5Pb&e$v~20ci1yzxhH&?B>HW%B zB-|7CEh57&JHXp#oqYy^q4)f(uMrmpV&{W_Q71eb#=XS1?4|u|@0M@9bK17xRa3h# z^Y-=J1`Iy1{x#N+4an4Wal|Qus@8}+i?GTsfz zTlTtt39?59UihCJl3h^=vPZve3xg+Fu8mCZCYRePMV7^Rrd5m~&m@3H{{q__*&m?&{X=lEc)PyEUGO3+PV@qJqFW2iJS_J{GPnyvJj z;T7%M!X}!647dEz3QTk|4(9FWC!fZwKh~45musq~c{Fu45Mp=56ILCbiWM9YF_>1y zOGEnJ%UbC={cLkI9}e1juPN29>x))L7bJ5X*~Gv{Pp!04q$*x@gDEvkWxJAW5i4Q& zsiSLxoSNf6q5HA>d{y^H5nT3~yqL^Onjfl^1WM$8{ZFI?PizBch}T4%3%Fyod=Mbh z)L@%b@LFOPJ=-j4wgJ)g__D_ay*i9+>0_e@(cQRNZW&O#v!pukckPLL5Yq#tFZ(MI z^vAs^HNLXajE;TX($j%UFPU7PJis5>E1qNUG`+@=9>Vd#h_c?7aBq#gW>|7VAD2KU znhshCe2QEz`x~4>0|{{4*cd|+-5iIs+0gla2{_Mexg3by?{x4(W7Et(kaCZ;8+*NH z=ZpSd()qWbeT>LytEpI}i>;1csIrC>8mqtMl#yI0#zUdN`RNSsRW~uh=Z@%6>~za0 zCthyBY>&fG^w*TVDORzY4xu3X0S{r>~y6r5rJ diff --git a/RealityUI+Examples/RealityUI+Examples/Base.lproj/LaunchScreen.storyboard b/RealityUI+Examples/RealityUI+Examples/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e932..0000000 --- a/RealityUI+Examples/RealityUI+Examples/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/RealityUI+Examples/RealityUI+Examples/Entity+Extensions.swift b/RealityUI+Examples/RealityUI+Examples/Entity+Extensions.swift deleted file mode 100644 index 9d9f2a9..0000000 --- a/RealityUI+Examples/RealityUI+Examples/Entity+Extensions.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Entity+Extensions.swift -// RealityUI+Examples -// -// Created by Max Cobb on 5/24/20. -// Copyright © 2020 Max Cobb. All rights reserved. -// - -import RealityKit -import Foundation -import Combine -import RealityUI - -internal extension Entity { - func spin(in axis: SIMD3, duration: TimeInterval, repeats: Bool = true) { - self.ruiSpin(by: axis, period: duration, times: -1) - } -} diff --git a/RealityUI+Examples/RealityUI+Examples/Info.plist b/RealityUI+Examples/RealityUI+Examples/Info.plist deleted file mode 100644 index 3c072de..0000000 --- a/RealityUI+Examples/RealityUI+Examples/Info.plist +++ /dev/null @@ -1,48 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSCameraUsageDescription - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - arkit - - UIStatusBarHidden - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/RealityUI+Examples/RealityUI+Examples/ViewController+NonRealityUI.swift b/RealityUI+Examples/RealityUI+Examples/ViewController+NonRealityUI.swift deleted file mode 100644 index 3d81ead..0000000 --- a/RealityUI+Examples/RealityUI+Examples/ViewController+NonRealityUI.swift +++ /dev/null @@ -1,128 +0,0 @@ -// -// ViewController+NonRealityUI.swift -// RealityUI+Examples -// -// Created by Max Cobb on 5/24/20. -// Copyright © 2020 Max Cobb. All rights reserved. -// - -import RealityKit - - import RealityUI - -class ContainerCube: Entity, HasPhysicsBody, HasModel { - private static var boxPositions: [SIMD3] = [ - [-1, 0, 0], - [1, 0, 0], - [0, -1, 0], - [0, 1, 0], - [0, 0, -1], - [0, 0, 1] - ] - required init(showingInterior: Bool) { - super.init() - self.collision = CollisionComponent( - shapes: ContainerCube.boxPositions.map { - ShapeResource.generateBox(size: [1, 1, 1]).offsetBy(translation: $0) }, - mode: .default, filter: CollisionFilter( - group: .init(rawValue: 1 << 31), - mask: .init(rawValue: 1 << 31) - ) - ) - if showingInterior { - let cubeModel = ModelEntity( - mesh: .generateBox(size: 1), materials: [ - SimpleMaterial(color: Material.Color.lightGray.withAlphaComponent(0.5), isMetallic: false) - ]) - cubeModel.scale *= -1 - self.addChild(cubeModel) - } - self.physicsBody = PhysicsBodyComponent(shapes: ContainerCube.boxPositions.map { - ShapeResource.generateBox(size: .one).offsetBy(translation: $0) - }, mass: 1, mode: .static) -// self.model = ModelComponent(mesh: .generateBox(size: 0.2), materials: []) - } - - required init() { - fatalError("init() has not been implemented") - } -} - -extension ControlsParent { - func addTumbler() { - let tumbler = ContainerCube(showingInterior: true) - if let cubeColl = tumbler.collision { - RealityUI.longGestureMask.remove(cubeColl.filter.group) - RealityUI.tapGestureMask.remove(cubeColl.filter.group) - } - tumbler.position = [0, 0.75, -1.25] - self.addChild(tumbler) - self.tumbler = tumbler - } - func popBoxes(power: Float) { - for cube in self.tumblingCubes { - cube.applyImpulse([0, power * pow(cube.scale.x, 3), 0], at: .zero, relativeTo: nil) - } - } - - func shiftShape(_ shift: Int, on stepper: Entity) { - self.currShape = (self.currShape + shift + self.shiftShapes.count) - % self.shiftShapes.count - for shape in self.tumblingCubes { - shape.model?.mesh = self.shiftShapes[self.currShape] - shape.collision = nil - shape.physicsBody = nil - shape.generateCollisionShapes(recursive: false) - shape.collision?.filter = CollisionFilter(group: .all, mask: .all) - shape.physicsBody = PhysicsBodyComponent( - shapes: [.generateSphere(radius: 0.1)], - mass: 1, - material: .generate(friction: 20, restitution: 0.5), - mode: .dynamic - ) - } - var shapeVisualised = stepper.findEntity(named: "shapeVisualised") - if shapeVisualised == nil { - let visModel = ModelEntity() - visModel.name = "shapeVisualised" - visModel.scale = .init(repeating: 3) - visModel.position.y = 1 - stepper.addChild(visModel) - shapeVisualised = visModel - } - shapeVisualised?.stopAllAnimations() - (shapeVisualised as? ModelEntity)?.model = ModelComponent( - mesh: self.shiftShapes[self.currShape], - materials: [ - UnlitMaterial(color: Material.Color.blue.withAlphaComponent(0.9)) - ] - ) - shapeVisualised?.spin(in: [0, 1, 0], duration: 5) - } - func removeCube() { - if tumblingCubes.isEmpty { - return - } - let lastCube = tumblingCubes.removeLast() - lastCube.removeFromParent() - } - - func spawnShape(with scale: SIMD3) { - let newCube = ModelEntity( - mesh: self.shiftShapes[self.currShape], - materials: [SimpleMaterial(color: .blue, isMetallic: false)] - ) - newCube.generateCollisionShapes(recursive: false) - newCube.collision?.filter = CollisionFilter(group: .all, mask: .all) - newCube.physicsBody = PhysicsBodyComponent( - shapes: [.generateConvex(from: self.shiftShapes[self.currShape])], - mass: 1, - material: .generate(friction: 0.8, restitution: 0.3), - mode: .dynamic - ) - newCube.orientation = .init(angle: .pi / 1.5, axis: [1, 0, 0]) - newCube.scale = scale - tumbler?.addChild(newCube) - tumblingCubes.append(newCube) - } -} diff --git a/RealityUI+Examples/RealityUI+Examples/ViewController+RealityControls.swift b/RealityUI+Examples/RealityUI+Examples/ViewController+RealityControls.swift deleted file mode 100644 index a2613a4..0000000 --- a/RealityUI+Examples/RealityUI+Examples/ViewController+RealityControls.swift +++ /dev/null @@ -1,130 +0,0 @@ -// -// ViewController+RealityControls.swift -// RealityUI+Examples -// -// Created by Max Cobb on 5/24/20. -// Copyright © 2020 Max Cobb. All rights reserved. -// - -import RealityKit -import Foundation -import Combine - -import RealityUI - -class ControlsParent: Entity, HasAnchoring, HasCollision, HasModel, HasTurnTouch { - - var tumbler: ContainerCube? - var tumblingCubes: [ModelEntity] = [] - required init() { - super.init() - self.anchoring = AnchoringComponent(.plane( - .horizontal, classification: .any, minimumBounds: [0.5, 0.5] - )) - self.maxDistance = 0.75 - self.addControls() - /// Uncomment this to try out HasTurnTouch, but it's still in an experimental stage. - if let rotateImg = try? TextureResource.load(named: "rotato") { - self.collision = CollisionComponent(shapes: [.generateBox(size: [10, 0.1, 10])]) - var unlitTextured = UnlitMaterial(color: .white) - unlitTextured.baseColor = MaterialColorParameter.texture(rotateImg) - unlitTextured.tintColor = unlitTextured.tintColor.withAlphaComponent(0.75) - self.model = ModelComponent(mesh: .generatePlane(width: 1.5, depth: 1.5), materials: [unlitTextured]) - } - } - - func entityAnchored() { - self.addTumbler() - } - - /// Add all the RealityUI Controls - func addControls() { - let button = RUIButton( - button: ButtonComponent(size: [2, 1, 0.4]), - RUI: RUIComponent(respondsToLighting: true), - updateCallback: { _ in self.popBoxes(power: 0.5)} - ) - button.transform = Transform( - scale: .init(repeating: 0.2), - rotation: simd_quatf(angle: .pi / 2, axis: [1, 0, 0]), translation: .zero - ) - self.addChild(button) - let toggle = RUISwitch(changedCallback: { tog in - if tog.isOn { - self.tumbler?.spin(in: [0, 0, 1], duration: 3) - self.popBoxes(power: 0.1) - } else { self.tumbler?.ruiStopAnim() } - }) - toggle.transform = Transform( - scale: .init(repeating: 0.15), rotation: .init(angle: .pi, axis: [0, 1, 0]), translation: [0, 0.25, -0.25] - ) - self.addChild(toggle) - - let slider = RUISlider(slider: SliderComponent(startingValue: 0.5, steps: 0)) { (slider, _) in - self.tumblingCubes.forEach { $0.scale = .init(repeating: slider.value + 0.5)} - } - slider.transform = Transform( - scale: .init(repeating: 0.1), - rotation: .init(angle: .pi, axis: [0, 1, 0]), - translation: [0, 1.15, -0.25] - ) - self.addChild(slider) - - let minusPlusStepper = RUIStepper(upTrigger: { _ in - if self.tumblingCubes.count <= 8 { - self.spawnShape(with: SIMD3(repeating: slider.value + 0.5)) - } - }, downTrigger: { _ in self.removeCube() }) - minusPlusStepper.transform = Transform( - scale: .init(repeating: 0.15), rotation: .init(angle: .pi, axis: [0, 1, 0]), translation: [-0.5, 0.25, -0.25] - ) - self.addChild(minusPlusStepper) - let shapeStepper = RUIStepper( - style: .arrowLeftRight, - upTrigger: { stepper in self.shiftShape(1, on: stepper) }, - downTrigger: { stepper in self.shiftShape(-1, on: stepper) } - ) - shapeStepper.transform = Transform( - scale: .init(repeating: 0.15), rotation: .init(angle: .pi, axis: [0, 1, 0]), translation: [0.5, 0.25, -0.25] - ) - self.addChild(shapeStepper) - self.shiftShape(0, on: shapeStepper) - } - - var currShape: Int = 0 - /// The object shapes that will be added - var shiftShapes: [MeshResource] = [ - .generateBox(size: 0.2), - // Slight problem with sphere and physics body, cause unknown to me - .generateSphere(radius: 0.1), - .generateBox(size: [0.2, 0.2, 0.01]) - ] -} - -extension ViewController { - static var letRotate = false - func addObjectToPlane() { - let controlsAnchor = ControlsParent() - controlsAnchor.position.z = -0.25 - var anchorFoundCallback: Cancellable? - anchorFoundCallback = self.arView.scene.subscribe( - to: SceneEvents.AnchoredStateChanged.self, on: controlsAnchor, { anchorEvent in - if anchorEvent.isAnchored { - controlsAnchor.entityAnchored() - if ViewController.letRotate { - let visBounds = controlsAnchor.visualBounds(relativeTo: controlsAnchor) - controlsAnchor.collision = CollisionComponent(shapes: [ - ShapeResource.generateBox(size: visBounds.extents * 1.1).offsetBy(translation: visBounds.center) - ]) - self.arView.installGestures(.rotation, for: controlsAnchor) - } - DispatchQueue.main.async { anchorFoundCallback?.cancel() } - } - } - ) - self.arView.scene.addAnchor(controlsAnchor) - let textAbove = RUIText(with: "RealityUI") - textAbove.look(at: [0, 1.5, 0], from: [0, 1.5, -1], relativeTo: nil) - controlsAnchor.addChild(textAbove) - } -} diff --git a/RealityUI+Examples/RealityUI+Examples/ViewController.swift b/RealityUI+Examples/RealityUI+Examples/ViewController.swift deleted file mode 100644 index 97f8ce1..0000000 --- a/RealityUI+Examples/RealityUI+Examples/ViewController.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// ViewController.swift -// RealityUI+Examples -// -// Created by Max Cobb on 5/16/20. -// Copyright © 2020 Max Cobb. All rights reserved. -// - -import UIKit -import RealityKit -import ARKit - -import RealityUI - -class ViewController: UIViewController { - - var arView = ARView(frame: .zero, cameraMode: .ar, automaticallyConfigureSession: false) - var arMode = true - func addARView() { - - arView.frame = self.view.bounds - self.arView.autoresizingMask = [.flexibleWidth, .flexibleHeight] - self.view.addSubview(arView) - RealityUI.enableGestures(.all, on: self.arView) - self.arView.renderOptions.insert(.disableGroundingShadows) - - if self.arMode { - let config = ARWorldTrackingConfiguration() - config.planeDetection = [.horizontal] - arView.session.run(config, options: []) - self.addObjectToPlane() - } else { - arView.cameraMode = .nonAR - arView.environment.background = .color(.orange) - self.addNonARParts() - } - // Replaces camera feed, if 6dof VR look is wanted -// arView.environment.background = .color(.systemGray) - - // Register all the components used in RealityUI - RealityUI.registerComponents() - } - - func addNonARParts() { - let stepper = RUIStepper() - let anchor = AnchorEntity(world: .zero) - self.arView.scene.addAnchor(anchor) - anchor.addChild(stepper) - } - - override func viewDidLoad() { - super.viewDidLoad() - // Add all RealityUI gestures to the current ARView - self.addARView() - } -} diff --git a/Sources/RealityUI/RUIButton.swift b/Sources/RealityUI/RUIButton.swift index 780a379..2ac4327 100644 --- a/Sources/RealityUI/RUIButton.swift +++ b/Sources/RealityUI/RUIButton.swift @@ -9,6 +9,8 @@ import RealityKit #if canImport(AppKit) import AppKit +#elseif canImport(UIKit) +import UIKit.UIColor #endif /// A RealityUI Button to be added to a RealityKit scene. diff --git a/Sources/RealityUI/RUISlider.swift b/Sources/RealityUI/RUISlider.swift index 9800516..117283e 100644 --- a/Sources/RealityUI/RUISlider.swift +++ b/Sources/RealityUI/RUISlider.swift @@ -10,6 +10,8 @@ import Foundation import RealityKit #if canImport(AppKit) import AppKit +#elseif canImport(UIKit) +import UIKit.UIColor #endif /// A RealityUI Slider to be added to a RealityKit scene. diff --git a/Sources/RealityUI/RUIStepper.swift b/Sources/RealityUI/RUIStepper.swift index fd870ad..e7f075f 100644 --- a/Sources/RealityUI/RUIStepper.swift +++ b/Sources/RealityUI/RUIStepper.swift @@ -10,6 +10,8 @@ import RealityKit import Combine #if canImport(AppKit) import AppKit +#elseif canImport(UIKit) +import UIKit.UIColor #endif /// A new RealityUI Stepper to be added to your RealityKit scene. diff --git a/Sources/RealityUI/RUISwitch.swift b/Sources/RealityUI/RUISwitch.swift index fb7182e..631aa19 100644 --- a/Sources/RealityUI/RUISwitch.swift +++ b/Sources/RealityUI/RUISwitch.swift @@ -9,6 +9,8 @@ import RealityKit #if canImport(AppKit) import AppKit +#elseif canImport(UIKit) +import UIKit.UIColor #endif /// A RealityUI Switch to be added to a RealityKit scene. diff --git a/Sources/RealityUI/RUIText.swift b/Sources/RealityUI/RUIText.swift index 4c57669..0597147 100644 --- a/Sources/RealityUI/RUIText.swift +++ b/Sources/RealityUI/RUIText.swift @@ -10,6 +10,8 @@ import RealityKit import CoreText #if canImport(AppKit) import AppKit +#elseif canImport(UIKit) +import UIKit.UIColor #endif /// A RealityUI Text object to be added to a RealityKit scene. diff --git a/Sources/RealityUI/RUITexture.swift b/Sources/RealityUI/RUITexture.swift index bc49281..ccc4ea7 100644 --- a/Sources/RealityUI/RUITexture.swift +++ b/Sources/RealityUI/RUITexture.swift @@ -68,56 +68,9 @@ public struct RUITexture { systemName: String, config: UIImage.SymbolConfiguration ) async throws -> TextureResource { let cgImage = try self.generateCGImage(systemName: systemName, config: config) - #if canImport(AppKit) return try await TextureResource.generate( - from: cgImage, + from: cgImage, withName: nil, options: .init(semantic: nil, mipmapsMode: TextureResource.MipmapsMode.allocateAndGenerateAll) ) - #else - return try await withCheckedThrowingContinuation { continuation in - let generateTexture: @Sendable () -> Void = { - do { - let texture = try TextureResource.generate( - from: cgImage, withName: nil, - options: .init(semantic: nil, mipmapsMode: TextureResource.MipmapsMode.allocateAndGenerateAll) - ) - continuation.resume(returning: texture) - } catch { - continuation.resume(throwing: error) - } - } - DispatchQueue.main.async(execute: generateTexture) - } - #endif - } - -#if canImport(UIKit) - /// Create a `TextureResource` with a system image name and point size. - /// - Parameters: - /// - systemName: Name of the SF Symbol Image. - /// - config: Image SymbolConfiguration for the SF Symbol Image. - /// - completion: Completion result for creating the `TextureResource`. - public static func generateTexture( - systemName: String, config: UIImage.SymbolConfiguration, - completion: @escaping (Result) -> Void - ) { - do { - let cgImage = try self.generateCGImage(systemName: systemName, config: config) - let generateTexture: @Sendable () -> Void = { - do { - let texture = try TextureResource.generate( - from: cgImage, withName: nil, - options: .init(semantic: nil, mipmapsMode: TextureResource.MipmapsMode.allocateAndGenerateAll) - ) - completion(.success(texture)) - } catch { - completion(.failure(error)) - } - } - DispatchQueue.main.async(execute: generateTexture) - } catch { - completion(.failure(error)) - } } - #endif } From daa6d8d9a395b01b7c05bbbee271d8ce13eeb100 Mon Sep 17 00:00:00 2001 From: Max Cobb Date: Tue, 11 Apr 2023 09:02:08 +0100 Subject: [PATCH 2/4] added rotation example, change slider to start from middle --- .../RealityUI+Example/ARViewContainer.swift | 29 +++++++++++++++++- .../rotato.imageset/Contents.json | 21 +++++++++++++ .../rotato.imageset/rotato.png | Bin 0 -> 17482 bytes .../RealityUI+Example/ContentView.swift | 1 + 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 RealityUI+Example/RealityUI+Example/Assets.xcassets/rotato.imageset/Contents.json create mode 100644 RealityUI+Example/RealityUI+Example/Assets.xcassets/rotato.imageset/rotato.png diff --git a/RealityUI+Example/RealityUI+Example/ARViewContainer.swift b/RealityUI+Example/RealityUI+Example/ARViewContainer.swift index 312790b..8f85503 100644 --- a/RealityUI+Example/RealityUI+Example/ARViewContainer.swift +++ b/RealityUI+Example/RealityUI+Example/ARViewContainer.swift @@ -65,11 +65,12 @@ struct ARViewContainer: UIViewRepresentable { case .slider: let scalingCube = ModelEntity(mesh: .generateBox(size: 3)) scalingCube.position.z = 3 - let slider = RUISlider(start: 1) { slider, state in + let slider = RUISlider(start: 0.5) { slider, state in scalingCube.scale = .one * (slider.value + 0.2) / 1.2 } slider.addChild(scalingCube) slider.scale = .init(repeating: 0.3) + scalingCube.scale = .one * (slider.value + 0.2) / 1.2 slider.name = "ruiReplace" worldAnchor.addChild(slider) case .stepper: @@ -90,6 +91,11 @@ struct ARViewContainer: UIViewRepresentable { button.look(at: [0, 1, -1], from: .zero, relativeTo: nil) button.name = "ruiReplace" worldAnchor.addChild(button) + case .rotation: + let plane = RotationPlane(turnAxis: [0, 0, 1]) + plane.scale = .one * 2 + plane.name = "ruiReplace" + worldAnchor.addChild(plane) } DispatchQueue.main.async { prevObjectType = objectType @@ -101,6 +107,27 @@ struct ARViewContainer: UIViewRepresentable { } } +class RotationPlane: Entity, HasModel, HasCollision, HasTurnTouch { + + required init(turnAxis: SIMD3) { + super.init() + self.turnAxis = turnAxis + var rotateMat = SimpleMaterial() + rotateMat.color = SimpleMaterial.BaseColor( + tint: .white.withAlphaComponent(0.99), texture: MaterialParameters.Texture( + try! TextureResource.load(named: "rotato") + ) + ) + self.model = ModelComponent(mesh: .generatePlane(width: 1, height: 1), materials: [rotateMat]) + self.orientation = .init(angle: .pi, axis: [0, 1, 0]) + self.collision = CollisionComponent(shapes: [.generateBox(width: 1, height: 1, depth: 0.1)]) + } + + @MainActor required init() { + fatalError("init() has not been implemented") + } +} + extension ARViewContainer { func switchAction(switch: HasSwitch) { diff --git a/RealityUI+Example/RealityUI+Example/Assets.xcassets/rotato.imageset/Contents.json b/RealityUI+Example/RealityUI+Example/Assets.xcassets/rotato.imageset/Contents.json new file mode 100644 index 0000000..ebce670 --- /dev/null +++ b/RealityUI+Example/RealityUI+Example/Assets.xcassets/rotato.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "rotato.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RealityUI+Example/RealityUI+Example/Assets.xcassets/rotato.imageset/rotato.png b/RealityUI+Example/RealityUI+Example/Assets.xcassets/rotato.imageset/rotato.png new file mode 100644 index 0000000000000000000000000000000000000000..57b2411c54d2c4371058e10dae0a20d210f0d554 GIT binary patch literal 17482 zcmeJE^;=Y5^gfIqT3R}k5Gm)S*Y2RW#hCn=>ZOrr(#5o=jpxs?Q9OJG(4s+9ts6??L2WyZhQPXtN-i`#xsLx*q&PJ z3GR#HWk&t4SRy4Gg!1oONR<1oKM&o=e(3${jr1ZH=zj2a-H^(<;nIozmX7+jh1SbM zcDq*vK}!sw)pJU-2w^MV&7-F&KLka8KIdk}ab1vPA&pI^I7mGA8_QOe;nl>a#0=}$ zUB$~|8Y%rF2Um0<8eKa!Pwiyg);2Nq54M#q3S1o2on)ISoBG0O^j)I4(OoCLvMS#` za^>Bp+5z04*lR~lR2knnfi921kHl8Nd8^}9eoBo-W{*!rR z-Td$g%p~YqYH`?0a>}b;Y!g~riyHL*_rJD2=&QfKUp;a;K2R2g3`0a0&HIr~b!Q@o zyS5%;X9;`gXc>GID0C>X8909`0$-Mu2)tkb&-(8DJc9G1jo0*-Go&1jMurfVL(mBX z>>7H>q{Ww?LJyc|AA>5NX@VIVyKA?fp6?m`Y3sL?K)c!#Gry{pe03n@6=nMj5J;<< z>b7>43P1#W;IUa+Kh6M}&u1W48-mjHQv{>!fDoU<;+JdX`McmILmHo%Y_jYrv}@IQ zm$jA}xqeK(o`l$-%A2;(dY7h{kfc~KG(X3nk&u0czt5$qfOewWjsaDAciRnR0?5}3 zvh2B>2!HpDy-=%N9FCnzRXQn~0}?SX-(h2zO0e_mfeep}0wOXeEH&;`spj=BC+{bD z4{=#kgLzJ3=8wl#YKi?WaX7i4&=sOn25u;EIBP1XVI1BiWeyKEN24OSOXj(7E4dDl-;&J_vIDZ)JoIL1)5%*qy zU)0Y4-PpuR&tzJe)j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PU7PJis5>E1qNUG`+@=9>Vd#h_c?7aBq#gW>|7VAD2KU znhshCe2QEz`x~4>0|{{4*cd|+-5iIs+0gla2{_Mexg3by?{x4(W7Et(kaCZ;8+*NH z=ZpSd()qWbeT>LytEpI}i>;1csIrC>8mqtMl#yI0#zUdN`RNSsRW~uh=Z@%6>~za0 zCthyBY>&fG^w*TVDORzY4xu3X0S{r>~y6r5rJ literal 0 HcmV?d00001 diff --git a/RealityUI+Example/RealityUI+Example/ContentView.swift b/RealityUI+Example/RealityUI+Example/ContentView.swift index 03ee56c..e60b075 100644 --- a/RealityUI+Example/RealityUI+Example/ContentView.swift +++ b/RealityUI+Example/RealityUI+Example/ContentView.swift @@ -13,6 +13,7 @@ public enum RealityObject: String, CaseIterable { case slider case stepper case button + case rotation } struct ContentView: View { From 13e2a202a476ee66e7413e469fecc8abe848556e Mon Sep 17 00:00:00 2001 From: Max Cobb Date: Tue, 11 Apr 2023 22:27:04 +0100 Subject: [PATCH 3/4] removed a bit of the example code. added a typealias for RUIToggle. --- .../RealityUI+Example/ARViewContainer.swift | 45 +++++++++---------- Sources/RealityUI/RUISwitch.swift | 5 +++ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/RealityUI+Example/RealityUI+Example/ARViewContainer.swift b/RealityUI+Example/RealityUI+Example/ARViewContainer.swift index 8f85503..a4ee300 100644 --- a/RealityUI+Example/RealityUI+Example/ARViewContainer.swift +++ b/RealityUI+Example/RealityUI+Example/ARViewContainer.swift @@ -26,6 +26,7 @@ struct ARViewContainer: UIViewRepresentable { @Binding var objectType: RealityObject + /// Stepper tally will be displayed at the top of the view when `RUIStepper` is visible. @Binding var stepperTally: Int @State fileprivate var prevObjectType: RealityObject? = nil func makeUIView(context: Context) -> ARView { @@ -38,6 +39,8 @@ struct ARViewContainer: UIViewRepresentable { // Add the anchor to the scene let anchor = AnchorEntity(world: .zero) arView.scene.addAnchor(anchor) + + // Setup RealityKit camera let cam = PerspectiveCamera() cam.look(at: .zero, from: [0, 0, -2.5], relativeTo: nil) anchor.addChild(cam) @@ -47,56 +50,49 @@ struct ARViewContainer: UIViewRepresentable { return arView } + /// Update the model in the scene depending on ``objectType`` + /// - Parameter view: The `ARView` being displayed. func setModel(view: ARView) { guard let worldAnchor = view.scene.anchors.first, - prevObjectType != objectType else - { return } + prevObjectType != objectType else { return } if let oldRui = view.scene.findEntity(named: "ruiReplace") { worldAnchor.removeChild(oldRui) } view.environment.background = .color(.gray) + let ruiModel: Entity switch objectType { case .toggle: - let mySwitch = RUISwitch(switchCallback: { hasSwitch in + ruiModel = RUISwitch(switchCallback: { hasSwitch in view.environment.background = .color(hasSwitch.isOn ? .green : .gray) }) - mySwitch.name = "ruiReplace" - worldAnchor.addChild(mySwitch) case .slider: let scalingCube = ModelEntity(mesh: .generateBox(size: 3)) scalingCube.position.z = 3 - let slider = RUISlider(start: 0.5) { slider, state in + ruiModel = RUISlider(start: 0.5) { slider, state in scalingCube.scale = .one * (slider.value + 0.2) / 1.2 } - slider.addChild(scalingCube) - slider.scale = .init(repeating: 0.3) - scalingCube.scale = .one * (slider.value + 0.2) / 1.2 - slider.name = "ruiReplace" - worldAnchor.addChild(slider) + ruiModel.addChild(scalingCube) + ruiModel.scale = .init(repeating: 0.3) + scalingCube.scale = .one * ((ruiModel as! HasSlider).value + 0.2) / 1.2 case .stepper: - let stepper = RUIStepper { _ in + ruiModel = RUIStepper { _ in stepperTally += 1 } downTrigger: { _ in stepperTally -= 1 } - - stepper.name = "ruiReplace" - worldAnchor.addChild(stepper) case .button: - let button = RUIButton( + ruiModel = RUIButton( rui: RUIComponent(respondsToLighting: true) ) { button in button.ruiShake(by: .init(angle: .pi / 16, axis: [0, 0, 1]), period: 0.05, times: 3) } - button.look(at: [0, 1, -1], from: .zero, relativeTo: nil) - button.name = "ruiReplace" - worldAnchor.addChild(button) + ruiModel.look(at: [0, 1, -1], from: .zero, relativeTo: nil) case .rotation: - let plane = RotationPlane(turnAxis: [0, 0, 1]) - plane.scale = .one * 2 - plane.name = "ruiReplace" - worldAnchor.addChild(plane) + ruiModel = RotationPlane(turnAxis: [0, 0, 1]) + ruiModel.scale = .one * 2 } + ruiModel.name = "ruiReplace" + worldAnchor.addChild(ruiModel) DispatchQueue.main.async { prevObjectType = objectType } @@ -107,8 +103,11 @@ struct ARViewContainer: UIViewRepresentable { } } +/// Class for demonstrating the HasTurnTouch protocol. class RotationPlane: Entity, HasModel, HasCollision, HasTurnTouch { + /// Create a new ``RotationPlane``, which conforms to HasTurnTouch + /// - Parameter turnAxis: Axis that the object will be rotated around. required init(turnAxis: SIMD3) { super.init() self.turnAxis = turnAxis diff --git a/Sources/RealityUI/RUISwitch.swift b/Sources/RealityUI/RUISwitch.swift index 631aa19..aa38f27 100644 --- a/Sources/RealityUI/RUISwitch.swift +++ b/Sources/RealityUI/RUISwitch.swift @@ -13,6 +13,11 @@ import AppKit import UIKit.UIColor #endif +/// Testing this out as an alternative name for ``RUISwitch`` +/// +/// If you see this, please let me know if you prefer ``RUISwitch`` or ``RUIToggle``! +public typealias RUIToggle = RUISwitch + /// A RealityUI Switch to be added to a RealityKit scene. public class RUISwitch: Entity, HasSwitch, HasPanTouch { public var panGestureOffset: SIMD3 = .zero From 4fd66e0fe52da2a5b0dfdbc06d38a664ee301ce4 Mon Sep 17 00:00:00 2001 From: Max Cobb Date: Tue, 11 Apr 2023 22:35:00 +0100 Subject: [PATCH 4/4] Fixed swiftlint doc to avoid example project --- .swiftlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index c6a2fcd..354fab9 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,4 +1,4 @@ line_length: ignores_comments: true excluded: - - RealityUI+Examples \ No newline at end of file + - RealityUI+Example \ No newline at end of file