├── ARMeasure.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── majimadaisuke.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── ARMeasure ├── ARMeasureApp.swift ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── ContentView.swift ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json └── ViewController.swift ├── ARMeasureTests └── ARMeasureTests.swift ├── ARMeasureUITests ├── ARMeasureUITests.swift └── ARMeasureUITestsLaunchTests.swift └── README.md /ARMeasure.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7354069C27AC6F6C004CCACC /* ARMeasureApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7354069B27AC6F6C004CCACC /* ARMeasureApp.swift */; }; 11 | 7354069E27AC6F6C004CCACC /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7354069D27AC6F6C004CCACC /* ContentView.swift */; }; 12 | 735406A027AC6F6F004CCACC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7354069F27AC6F6F004CCACC /* Assets.xcassets */; }; 13 | 735406A327AC6F6F004CCACC /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 735406A227AC6F6F004CCACC /* Preview Assets.xcassets */; }; 14 | 735406AD27AC6F6F004CCACC /* ARMeasureTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735406AC27AC6F6F004CCACC /* ARMeasureTests.swift */; }; 15 | 735406B727AC6F6F004CCACC /* ARMeasureUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735406B627AC6F6F004CCACC /* ARMeasureUITests.swift */; }; 16 | 735406B927AC6F6F004CCACC /* ARMeasureUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735406B827AC6F6F004CCACC /* ARMeasureUITestsLaunchTests.swift */; }; 17 | 735406C627AC6F87004CCACC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735406C527AC6F87004CCACC /* ViewController.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 735406A927AC6F6F004CCACC /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 7354069027AC6F6C004CCACC /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 7354069727AC6F6C004CCACC; 26 | remoteInfo = ARMeasure; 27 | }; 28 | 735406B327AC6F6F004CCACC /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 7354069027AC6F6C004CCACC /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 7354069727AC6F6C004CCACC; 33 | remoteInfo = ARMeasure; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 7354069827AC6F6C004CCACC /* ARMeasure.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ARMeasure.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 7354069B27AC6F6C004CCACC /* ARMeasureApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARMeasureApp.swift; sourceTree = ""; }; 40 | 7354069D27AC6F6C004CCACC /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 41 | 7354069F27AC6F6F004CCACC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | 735406A227AC6F6F004CCACC /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 43 | 735406A827AC6F6F004CCACC /* ARMeasureTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ARMeasureTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 735406AC27AC6F6F004CCACC /* ARMeasureTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARMeasureTests.swift; sourceTree = ""; }; 45 | 735406B227AC6F6F004CCACC /* ARMeasureUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ARMeasureUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 735406B627AC6F6F004CCACC /* ARMeasureUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARMeasureUITests.swift; sourceTree = ""; }; 47 | 735406B827AC6F6F004CCACC /* ARMeasureUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ARMeasureUITestsLaunchTests.swift; sourceTree = ""; }; 48 | 735406C527AC6F87004CCACC /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 7354069527AC6F6C004CCACC /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | 735406A527AC6F6F004CCACC /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | 735406AF27AC6F6F004CCACC /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 7354068F27AC6F6C004CCACC = { 77 | isa = PBXGroup; 78 | children = ( 79 | 7354069A27AC6F6C004CCACC /* ARMeasure */, 80 | 735406AB27AC6F6F004CCACC /* ARMeasureTests */, 81 | 735406B527AC6F6F004CCACC /* ARMeasureUITests */, 82 | 7354069927AC6F6C004CCACC /* Products */, 83 | ); 84 | sourceTree = ""; 85 | }; 86 | 7354069927AC6F6C004CCACC /* Products */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 7354069827AC6F6C004CCACC /* ARMeasure.app */, 90 | 735406A827AC6F6F004CCACC /* ARMeasureTests.xctest */, 91 | 735406B227AC6F6F004CCACC /* ARMeasureUITests.xctest */, 92 | ); 93 | name = Products; 94 | sourceTree = ""; 95 | }; 96 | 7354069A27AC6F6C004CCACC /* ARMeasure */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 7354069B27AC6F6C004CCACC /* ARMeasureApp.swift */, 100 | 7354069D27AC6F6C004CCACC /* ContentView.swift */, 101 | 735406C527AC6F87004CCACC /* ViewController.swift */, 102 | 7354069F27AC6F6F004CCACC /* Assets.xcassets */, 103 | 735406A127AC6F6F004CCACC /* Preview Content */, 104 | ); 105 | path = ARMeasure; 106 | sourceTree = ""; 107 | }; 108 | 735406A127AC6F6F004CCACC /* Preview Content */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 735406A227AC6F6F004CCACC /* Preview Assets.xcassets */, 112 | ); 113 | path = "Preview Content"; 114 | sourceTree = ""; 115 | }; 116 | 735406AB27AC6F6F004CCACC /* ARMeasureTests */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 735406AC27AC6F6F004CCACC /* ARMeasureTests.swift */, 120 | ); 121 | path = ARMeasureTests; 122 | sourceTree = ""; 123 | }; 124 | 735406B527AC6F6F004CCACC /* ARMeasureUITests */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 735406B627AC6F6F004CCACC /* ARMeasureUITests.swift */, 128 | 735406B827AC6F6F004CCACC /* ARMeasureUITestsLaunchTests.swift */, 129 | ); 130 | path = ARMeasureUITests; 131 | sourceTree = ""; 132 | }; 133 | /* End PBXGroup section */ 134 | 135 | /* Begin PBXNativeTarget section */ 136 | 7354069727AC6F6C004CCACC /* ARMeasure */ = { 137 | isa = PBXNativeTarget; 138 | buildConfigurationList = 735406BC27AC6F6F004CCACC /* Build configuration list for PBXNativeTarget "ARMeasure" */; 139 | buildPhases = ( 140 | 7354069427AC6F6C004CCACC /* Sources */, 141 | 7354069527AC6F6C004CCACC /* Frameworks */, 142 | 7354069627AC6F6C004CCACC /* Resources */, 143 | ); 144 | buildRules = ( 145 | ); 146 | dependencies = ( 147 | ); 148 | name = ARMeasure; 149 | productName = ARMeasure; 150 | productReference = 7354069827AC6F6C004CCACC /* ARMeasure.app */; 151 | productType = "com.apple.product-type.application"; 152 | }; 153 | 735406A727AC6F6F004CCACC /* ARMeasureTests */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = 735406BF27AC6F6F004CCACC /* Build configuration list for PBXNativeTarget "ARMeasureTests" */; 156 | buildPhases = ( 157 | 735406A427AC6F6F004CCACC /* Sources */, 158 | 735406A527AC6F6F004CCACC /* Frameworks */, 159 | 735406A627AC6F6F004CCACC /* Resources */, 160 | ); 161 | buildRules = ( 162 | ); 163 | dependencies = ( 164 | 735406AA27AC6F6F004CCACC /* PBXTargetDependency */, 165 | ); 166 | name = ARMeasureTests; 167 | productName = ARMeasureTests; 168 | productReference = 735406A827AC6F6F004CCACC /* ARMeasureTests.xctest */; 169 | productType = "com.apple.product-type.bundle.unit-test"; 170 | }; 171 | 735406B127AC6F6F004CCACC /* ARMeasureUITests */ = { 172 | isa = PBXNativeTarget; 173 | buildConfigurationList = 735406C227AC6F6F004CCACC /* Build configuration list for PBXNativeTarget "ARMeasureUITests" */; 174 | buildPhases = ( 175 | 735406AE27AC6F6F004CCACC /* Sources */, 176 | 735406AF27AC6F6F004CCACC /* Frameworks */, 177 | 735406B027AC6F6F004CCACC /* Resources */, 178 | ); 179 | buildRules = ( 180 | ); 181 | dependencies = ( 182 | 735406B427AC6F6F004CCACC /* PBXTargetDependency */, 183 | ); 184 | name = ARMeasureUITests; 185 | productName = ARMeasureUITests; 186 | productReference = 735406B227AC6F6F004CCACC /* ARMeasureUITests.xctest */; 187 | productType = "com.apple.product-type.bundle.ui-testing"; 188 | }; 189 | /* End PBXNativeTarget section */ 190 | 191 | /* Begin PBXProject section */ 192 | 7354069027AC6F6C004CCACC /* Project object */ = { 193 | isa = PBXProject; 194 | attributes = { 195 | BuildIndependentTargetsInParallel = 1; 196 | LastSwiftUpdateCheck = 1320; 197 | LastUpgradeCheck = 1320; 198 | TargetAttributes = { 199 | 7354069727AC6F6C004CCACC = { 200 | CreatedOnToolsVersion = 13.2.1; 201 | }; 202 | 735406A727AC6F6F004CCACC = { 203 | CreatedOnToolsVersion = 13.2.1; 204 | TestTargetID = 7354069727AC6F6C004CCACC; 205 | }; 206 | 735406B127AC6F6F004CCACC = { 207 | CreatedOnToolsVersion = 13.2.1; 208 | TestTargetID = 7354069727AC6F6C004CCACC; 209 | }; 210 | }; 211 | }; 212 | buildConfigurationList = 7354069327AC6F6C004CCACC /* Build configuration list for PBXProject "ARMeasure" */; 213 | compatibilityVersion = "Xcode 13.0"; 214 | developmentRegion = en; 215 | hasScannedForEncodings = 0; 216 | knownRegions = ( 217 | en, 218 | Base, 219 | ); 220 | mainGroup = 7354068F27AC6F6C004CCACC; 221 | productRefGroup = 7354069927AC6F6C004CCACC /* Products */; 222 | projectDirPath = ""; 223 | projectRoot = ""; 224 | targets = ( 225 | 7354069727AC6F6C004CCACC /* ARMeasure */, 226 | 735406A727AC6F6F004CCACC /* ARMeasureTests */, 227 | 735406B127AC6F6F004CCACC /* ARMeasureUITests */, 228 | ); 229 | }; 230 | /* End PBXProject section */ 231 | 232 | /* Begin PBXResourcesBuildPhase section */ 233 | 7354069627AC6F6C004CCACC /* Resources */ = { 234 | isa = PBXResourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | 735406A327AC6F6F004CCACC /* Preview Assets.xcassets in Resources */, 238 | 735406A027AC6F6F004CCACC /* Assets.xcassets in Resources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | 735406A627AC6F6F004CCACC /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | 735406B027AC6F6F004CCACC /* Resources */ = { 250 | isa = PBXResourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXResourcesBuildPhase section */ 257 | 258 | /* Begin PBXSourcesBuildPhase section */ 259 | 7354069427AC6F6C004CCACC /* Sources */ = { 260 | isa = PBXSourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | 7354069E27AC6F6C004CCACC /* ContentView.swift in Sources */, 264 | 735406C627AC6F87004CCACC /* ViewController.swift in Sources */, 265 | 7354069C27AC6F6C004CCACC /* ARMeasureApp.swift in Sources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | 735406A427AC6F6F004CCACC /* Sources */ = { 270 | isa = PBXSourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | 735406AD27AC6F6F004CCACC /* ARMeasureTests.swift in Sources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | 735406AE27AC6F6F004CCACC /* Sources */ = { 278 | isa = PBXSourcesBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 735406B927AC6F6F004CCACC /* ARMeasureUITestsLaunchTests.swift in Sources */, 282 | 735406B727AC6F6F004CCACC /* ARMeasureUITests.swift in Sources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | /* End PBXSourcesBuildPhase section */ 287 | 288 | /* Begin PBXTargetDependency section */ 289 | 735406AA27AC6F6F004CCACC /* PBXTargetDependency */ = { 290 | isa = PBXTargetDependency; 291 | target = 7354069727AC6F6C004CCACC /* ARMeasure */; 292 | targetProxy = 735406A927AC6F6F004CCACC /* PBXContainerItemProxy */; 293 | }; 294 | 735406B427AC6F6F004CCACC /* PBXTargetDependency */ = { 295 | isa = PBXTargetDependency; 296 | target = 7354069727AC6F6C004CCACC /* ARMeasure */; 297 | targetProxy = 735406B327AC6F6F004CCACC /* PBXContainerItemProxy */; 298 | }; 299 | /* End PBXTargetDependency section */ 300 | 301 | /* Begin XCBuildConfiguration section */ 302 | 735406BA27AC6F6F004CCACC /* Debug */ = { 303 | isa = XCBuildConfiguration; 304 | buildSettings = { 305 | ALWAYS_SEARCH_USER_PATHS = NO; 306 | CLANG_ANALYZER_NONNULL = YES; 307 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_ENABLE_OBJC_WEAK = YES; 313 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 314 | CLANG_WARN_BOOL_CONVERSION = YES; 315 | CLANG_WARN_COMMA = YES; 316 | CLANG_WARN_CONSTANT_CONVERSION = YES; 317 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 318 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 319 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 320 | CLANG_WARN_EMPTY_BODY = YES; 321 | CLANG_WARN_ENUM_CONVERSION = YES; 322 | CLANG_WARN_INFINITE_RECURSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 325 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 326 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 328 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 329 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 330 | CLANG_WARN_STRICT_PROTOTYPES = YES; 331 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 332 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 333 | CLANG_WARN_UNREACHABLE_CODE = YES; 334 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 335 | COPY_PHASE_STRIP = NO; 336 | DEBUG_INFORMATION_FORMAT = dwarf; 337 | ENABLE_STRICT_OBJC_MSGSEND = YES; 338 | ENABLE_TESTABILITY = YES; 339 | GCC_C_LANGUAGE_STANDARD = gnu11; 340 | GCC_DYNAMIC_NO_PIC = NO; 341 | GCC_NO_COMMON_BLOCKS = YES; 342 | GCC_OPTIMIZATION_LEVEL = 0; 343 | GCC_PREPROCESSOR_DEFINITIONS = ( 344 | "DEBUG=1", 345 | "$(inherited)", 346 | ); 347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 349 | GCC_WARN_UNDECLARED_SELECTOR = YES; 350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 351 | GCC_WARN_UNUSED_FUNCTION = YES; 352 | GCC_WARN_UNUSED_VARIABLE = YES; 353 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 354 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 355 | MTL_FAST_MATH = YES; 356 | ONLY_ACTIVE_ARCH = YES; 357 | SDKROOT = iphoneos; 358 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 359 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 360 | }; 361 | name = Debug; 362 | }; 363 | 735406BB27AC6F6F004CCACC /* Release */ = { 364 | isa = XCBuildConfiguration; 365 | buildSettings = { 366 | ALWAYS_SEARCH_USER_PATHS = NO; 367 | CLANG_ANALYZER_NONNULL = YES; 368 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 369 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 370 | CLANG_CXX_LIBRARY = "libc++"; 371 | CLANG_ENABLE_MODULES = YES; 372 | CLANG_ENABLE_OBJC_ARC = YES; 373 | CLANG_ENABLE_OBJC_WEAK = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 381 | CLANG_WARN_EMPTY_BODY = YES; 382 | CLANG_WARN_ENUM_CONVERSION = YES; 383 | CLANG_WARN_INFINITE_RECURSION = YES; 384 | CLANG_WARN_INT_CONVERSION = YES; 385 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 386 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 387 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 388 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 389 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 390 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 391 | CLANG_WARN_STRICT_PROTOTYPES = YES; 392 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 393 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 394 | CLANG_WARN_UNREACHABLE_CODE = YES; 395 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 396 | COPY_PHASE_STRIP = NO; 397 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 398 | ENABLE_NS_ASSERTIONS = NO; 399 | ENABLE_STRICT_OBJC_MSGSEND = YES; 400 | GCC_C_LANGUAGE_STANDARD = gnu11; 401 | GCC_NO_COMMON_BLOCKS = YES; 402 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 403 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 404 | GCC_WARN_UNDECLARED_SELECTOR = YES; 405 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 406 | GCC_WARN_UNUSED_FUNCTION = YES; 407 | GCC_WARN_UNUSED_VARIABLE = YES; 408 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 409 | MTL_ENABLE_DEBUG_INFO = NO; 410 | MTL_FAST_MATH = YES; 411 | SDKROOT = iphoneos; 412 | SWIFT_COMPILATION_MODE = wholemodule; 413 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 414 | VALIDATE_PRODUCT = YES; 415 | }; 416 | name = Release; 417 | }; 418 | 735406BD27AC6F6F004CCACC /* Debug */ = { 419 | isa = XCBuildConfiguration; 420 | buildSettings = { 421 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 422 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 423 | CODE_SIGN_STYLE = Automatic; 424 | CURRENT_PROJECT_VERSION = 1; 425 | DEVELOPMENT_ASSET_PATHS = "\"ARMeasure/Preview Content\""; 426 | DEVELOPMENT_TEAM = MFN25KNUGJ; 427 | ENABLE_PREVIEWS = YES; 428 | GENERATE_INFOPLIST_FILE = YES; 429 | INFOPLIST_KEY_NSCameraUsageDescription = ""; 430 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 431 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 432 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 433 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 434 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 435 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 436 | LD_RUNPATH_SEARCH_PATHS = ( 437 | "$(inherited)", 438 | "@executable_path/Frameworks", 439 | ); 440 | MARKETING_VERSION = 1.0; 441 | PRODUCT_BUNDLE_IDENTIFIER = com.daisukemajima.ARMeasure; 442 | PRODUCT_NAME = "$(TARGET_NAME)"; 443 | SWIFT_EMIT_LOC_STRINGS = YES; 444 | SWIFT_VERSION = 5.0; 445 | TARGETED_DEVICE_FAMILY = "1,2"; 446 | }; 447 | name = Debug; 448 | }; 449 | 735406BE27AC6F6F004CCACC /* Release */ = { 450 | isa = XCBuildConfiguration; 451 | buildSettings = { 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 454 | CODE_SIGN_STYLE = Automatic; 455 | CURRENT_PROJECT_VERSION = 1; 456 | DEVELOPMENT_ASSET_PATHS = "\"ARMeasure/Preview Content\""; 457 | DEVELOPMENT_TEAM = MFN25KNUGJ; 458 | ENABLE_PREVIEWS = YES; 459 | GENERATE_INFOPLIST_FILE = YES; 460 | INFOPLIST_KEY_NSCameraUsageDescription = ""; 461 | INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; 462 | INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; 463 | INFOPLIST_KEY_UILaunchScreen_Generation = YES; 464 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 465 | INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; 466 | IPHONEOS_DEPLOYMENT_TARGET = 14.0; 467 | LD_RUNPATH_SEARCH_PATHS = ( 468 | "$(inherited)", 469 | "@executable_path/Frameworks", 470 | ); 471 | MARKETING_VERSION = 1.0; 472 | PRODUCT_BUNDLE_IDENTIFIER = com.daisukemajima.ARMeasure; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | SWIFT_EMIT_LOC_STRINGS = YES; 475 | SWIFT_VERSION = 5.0; 476 | TARGETED_DEVICE_FAMILY = "1,2"; 477 | }; 478 | name = Release; 479 | }; 480 | 735406C027AC6F6F004CCACC /* Debug */ = { 481 | isa = XCBuildConfiguration; 482 | buildSettings = { 483 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 484 | BUNDLE_LOADER = "$(TEST_HOST)"; 485 | CODE_SIGN_STYLE = Automatic; 486 | CURRENT_PROJECT_VERSION = 1; 487 | DEVELOPMENT_TEAM = MFN25KNUGJ; 488 | GENERATE_INFOPLIST_FILE = YES; 489 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 490 | MARKETING_VERSION = 1.0; 491 | PRODUCT_BUNDLE_IDENTIFIER = com.daisukemajima.ARMeasureTests; 492 | PRODUCT_NAME = "$(TARGET_NAME)"; 493 | SWIFT_EMIT_LOC_STRINGS = NO; 494 | SWIFT_VERSION = 5.0; 495 | TARGETED_DEVICE_FAMILY = "1,2"; 496 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ARMeasure.app/ARMeasure"; 497 | }; 498 | name = Debug; 499 | }; 500 | 735406C127AC6F6F004CCACC /* Release */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 504 | BUNDLE_LOADER = "$(TEST_HOST)"; 505 | CODE_SIGN_STYLE = Automatic; 506 | CURRENT_PROJECT_VERSION = 1; 507 | DEVELOPMENT_TEAM = MFN25KNUGJ; 508 | GENERATE_INFOPLIST_FILE = YES; 509 | IPHONEOS_DEPLOYMENT_TARGET = 15.2; 510 | MARKETING_VERSION = 1.0; 511 | PRODUCT_BUNDLE_IDENTIFIER = com.daisukemajima.ARMeasureTests; 512 | PRODUCT_NAME = "$(TARGET_NAME)"; 513 | SWIFT_EMIT_LOC_STRINGS = NO; 514 | SWIFT_VERSION = 5.0; 515 | TARGETED_DEVICE_FAMILY = "1,2"; 516 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ARMeasure.app/ARMeasure"; 517 | }; 518 | name = Release; 519 | }; 520 | 735406C327AC6F6F004CCACC /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 524 | CODE_SIGN_STYLE = Automatic; 525 | CURRENT_PROJECT_VERSION = 1; 526 | DEVELOPMENT_TEAM = MFN25KNUGJ; 527 | GENERATE_INFOPLIST_FILE = YES; 528 | MARKETING_VERSION = 1.0; 529 | PRODUCT_BUNDLE_IDENTIFIER = com.daisukemajima.ARMeasureUITests; 530 | PRODUCT_NAME = "$(TARGET_NAME)"; 531 | SWIFT_EMIT_LOC_STRINGS = NO; 532 | SWIFT_VERSION = 5.0; 533 | TARGETED_DEVICE_FAMILY = "1,2"; 534 | TEST_TARGET_NAME = ARMeasure; 535 | }; 536 | name = Debug; 537 | }; 538 | 735406C427AC6F6F004CCACC /* Release */ = { 539 | isa = XCBuildConfiguration; 540 | buildSettings = { 541 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 542 | CODE_SIGN_STYLE = Automatic; 543 | CURRENT_PROJECT_VERSION = 1; 544 | DEVELOPMENT_TEAM = MFN25KNUGJ; 545 | GENERATE_INFOPLIST_FILE = YES; 546 | MARKETING_VERSION = 1.0; 547 | PRODUCT_BUNDLE_IDENTIFIER = com.daisukemajima.ARMeasureUITests; 548 | PRODUCT_NAME = "$(TARGET_NAME)"; 549 | SWIFT_EMIT_LOC_STRINGS = NO; 550 | SWIFT_VERSION = 5.0; 551 | TARGETED_DEVICE_FAMILY = "1,2"; 552 | TEST_TARGET_NAME = ARMeasure; 553 | }; 554 | name = Release; 555 | }; 556 | /* End XCBuildConfiguration section */ 557 | 558 | /* Begin XCConfigurationList section */ 559 | 7354069327AC6F6C004CCACC /* Build configuration list for PBXProject "ARMeasure" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | 735406BA27AC6F6F004CCACC /* Debug */, 563 | 735406BB27AC6F6F004CCACC /* Release */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | 735406BC27AC6F6F004CCACC /* Build configuration list for PBXNativeTarget "ARMeasure" */ = { 569 | isa = XCConfigurationList; 570 | buildConfigurations = ( 571 | 735406BD27AC6F6F004CCACC /* Debug */, 572 | 735406BE27AC6F6F004CCACC /* Release */, 573 | ); 574 | defaultConfigurationIsVisible = 0; 575 | defaultConfigurationName = Release; 576 | }; 577 | 735406BF27AC6F6F004CCACC /* Build configuration list for PBXNativeTarget "ARMeasureTests" */ = { 578 | isa = XCConfigurationList; 579 | buildConfigurations = ( 580 | 735406C027AC6F6F004CCACC /* Debug */, 581 | 735406C127AC6F6F004CCACC /* Release */, 582 | ); 583 | defaultConfigurationIsVisible = 0; 584 | defaultConfigurationName = Release; 585 | }; 586 | 735406C227AC6F6F004CCACC /* Build configuration list for PBXNativeTarget "ARMeasureUITests" */ = { 587 | isa = XCConfigurationList; 588 | buildConfigurations = ( 589 | 735406C327AC6F6F004CCACC /* Debug */, 590 | 735406C427AC6F6F004CCACC /* Release */, 591 | ); 592 | defaultConfigurationIsVisible = 0; 593 | defaultConfigurationName = Release; 594 | }; 595 | /* End XCConfigurationList section */ 596 | }; 597 | rootObject = 7354069027AC6F6C004CCACC /* Project object */; 598 | } 599 | -------------------------------------------------------------------------------- /ARMeasure.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ARMeasure.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ARMeasure.xcodeproj/xcuserdata/majimadaisuke.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /ARMeasure.xcodeproj/xcuserdata/majimadaisuke.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ARMeasure.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ARMeasure/ARMeasureApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARMeasureApp.swift 3 | // ARMeasure 4 | // 5 | // Created by 間嶋大輔 on 2022/02/04. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct ARMeasureApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ARMeasure/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ARMeasure/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ARMeasure/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ARMeasure/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // ARMeasure 4 | // 5 | // Created by DAISUKEMAJIMA on 2022/02/04. 6 | // 7 | 8 | import SwiftUI 9 | import SceneKit 10 | 11 | struct ContentView : View { 12 | var body: some View { 13 | return ViewControllerContainer().edgesIgnoringSafeArea(.all) 14 | } 15 | } 16 | 17 | struct ViewControllerContainer: UIViewControllerRepresentable { 18 | 19 | func makeUIViewController(context: Context) -> ViewController { 20 | 21 | let viewController = ViewController() 22 | return viewController 23 | 24 | } 25 | 26 | func updateUIViewController(_ uiViewController: ViewController, context: Context) {} 27 | func makeCoordinator() -> ViewControllerContainer.Coordinator { 28 | return Coordinator() 29 | } 30 | class Coordinator { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ARMeasure/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ARMeasure/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARViewController.swift 3 | // CapturedObjectViewer 4 | // 5 | // Created by DAISUKEMAJIMA on 2022/01/17. 6 | // 7 | 8 | import UIKit 9 | import SceneKit 10 | import ARKit 11 | 12 | class ViewController: UIViewController, ARSessionDelegate { 13 | 14 | var sceneView:ARSCNView! 15 | var trackingStateOK: Bool = false 16 | 17 | let sphereNode = SCNNode(geometry: SCNSphere(radius: 0.01)) 18 | var tappedPointNodeOrigin: SCNNode? 19 | var tappedPointNodeDest: SCNNode? 20 | var lineNode = SCNNode() 21 | var objectNode: SCNNode! 22 | 23 | var distanceLabel = UILabel() 24 | let coachingOverlayView = UIView() 25 | 26 | override func viewDidLoad() { 27 | super.viewDidLoad() 28 | 29 | sceneView = ARSCNView(frame: view.bounds) 30 | view.addSubview(sceneView) 31 | 32 | sceneView.scene.rootNode.addChildNode(lineNode) 33 | 34 | distanceLabel.text = "" 35 | distanceLabel.frame = CGRect(x: 0, y: view.bounds.maxY - 200, width: view.bounds.width, height: 200) 36 | view.addSubview(distanceLabel) 37 | distanceLabel.textColor = .red 38 | distanceLabel.textAlignment = .center 39 | distanceLabel.numberOfLines = 3 40 | distanceLabel.font = .systemFont(ofSize: 40, weight: .bold) 41 | 42 | view.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(tap(recognizer:)))) 43 | setupCoachingOverlay() 44 | 45 | } 46 | 47 | override func viewWillAppear(_ animated: Bool) { 48 | super.viewWillAppear(animated) 49 | let worldtracking = ARWorldTrackingConfiguration() 50 | sceneView.session.run(worldtracking, options: [.removeExistingAnchors]) 51 | sceneView.session.delegate = self 52 | } 53 | 54 | func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) { 55 | switch camera.trackingState { 56 | case .normal: 57 | coachingOverlayView.isHidden = true 58 | trackingStateOK = true 59 | distanceLabel.text = "Displays the distance\n between the two touched points" 60 | default: 61 | coachingOverlayView.isHidden = false 62 | trackingStateOK = false 63 | } 64 | } 65 | 66 | @objc func tap(recognizer: UITapGestureRecognizer) { 67 | guard trackingStateOK == true else { return } 68 | 69 | // guard let query = sceneView.raycastQuery(from: recognizer.location(in: sceneView), allowing: .estimatedPlane, alignment: .any) else {return} 70 | // let results = sceneView.session.raycast(query) 71 | // guard let position = results.first?.worldTransform else {return} 72 | // let worldCoordinates = simd_float3(x: position.columns.3.x, y: position.columns.3.y, z: position.columns.3.z) 73 | let hitTestResults = sceneView.hitTest(recognizer.location(in: sceneView),types:[.estimatedHorizontalPlane,.estimatedVerticalPlane]) 74 | guard let result = hitTestResults.first else { return } 75 | let worldCoordinates = simd_float3(x: result.worldTransform.columns.3.x, y: result.worldTransform.columns.3.y, z: result.worldTransform.columns.3.z) 76 | 77 | guard tappedPointNodeOrigin != nil else { 78 | tappedPointNodeOrigin = sphereNode.clone() 79 | tappedPointNodeOrigin?.geometry?.materials.first?.diffuse.contents = UIColor.red 80 | sceneView.scene.rootNode.addChildNode(tappedPointNodeOrigin!) 81 | tappedPointNodeOrigin?.simdWorldPosition = worldCoordinates 82 | return 83 | } 84 | 85 | if tappedPointNodeDest != nil { 86 | tappedPointNodeDest?.removeFromParentNode() 87 | lineNode.removeFromParentNode() 88 | tappedPointNodeDest = nil 89 | 90 | 91 | tappedPointNodeOrigin?.simdWorldPosition = worldCoordinates 92 | } else { 93 | tappedPointNodeDest = sphereNode.clone() 94 | tappedPointNodeDest?.geometry?.materials.first?.diffuse.contents = UIColor.red 95 | tappedPointNodeDest?.simdWorldPosition = worldCoordinates 96 | sceneView.scene.rootNode.addChildNode(tappedPointNodeDest!) 97 | 98 | let distance = distance(tappedPointNodeOrigin!.simdWorldPosition, tappedPointNodeDest!.simdWorldPosition) 99 | distanceLabel.text = String(floor(distance*10000)/100) + "cm" 100 | print(distance) 101 | let lineNode = lineBetweenNodes(positionA: tappedPointNodeOrigin!.worldPosition, positionB: tappedPointNodeDest!.worldPosition, inScene: sceneView.scene) 102 | lineNode.geometry?.materials.first?.readsFromDepthBuffer = false 103 | 104 | sceneView.scene.rootNode.addChildNode(lineNode) 105 | self.lineNode.removeFromParentNode() 106 | self.lineNode = lineNode 107 | } 108 | 109 | 110 | } 111 | 112 | func lineBetweenNodes(positionA: SCNVector3, positionB: SCNVector3, inScene: SCNScene) -> SCNNode { 113 | let vector = SCNVector3(positionA.x - positionB.x, positionA.y - positionB.y, positionA.z - positionB.z) 114 | let distance = sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z) 115 | let midPosition = SCNVector3 (x:(positionA.x + positionB.x) / 2, y:(positionA.y + positionB.y) / 2, z:(positionA.z + positionB.z) / 2) 116 | 117 | let lineGeometry = SCNCylinder() 118 | lineGeometry.radius = 0.005 119 | lineGeometry.height = CGFloat(distance) 120 | lineGeometry.radialSegmentCount = 5 121 | lineGeometry.firstMaterial!.diffuse.contents = UIColor.red 122 | 123 | let lineNode = SCNNode(geometry: lineGeometry) 124 | lineNode.position = midPosition 125 | lineNode.look (at: positionB, up: inScene.rootNode.worldUp, localFront: lineNode.worldUp) 126 | 127 | return lineNode 128 | } 129 | 130 | func setupCoachingOverlay(){ 131 | let label = UILabel(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: 200)) 132 | label.text = "If the app can't detect the tapped surface,\nMove the device to understand the environment" 133 | label.numberOfLines = 3 134 | label.textAlignment = .center 135 | label.textColor = .white 136 | view.addSubview(label) 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /ARMeasureTests/ARMeasureTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARMeasureTests.swift 3 | // ARMeasureTests 4 | // 5 | // Created by 間嶋大輔 on 2022/02/04. 6 | // 7 | 8 | import XCTest 9 | @testable import ARMeasure 10 | 11 | class ARMeasureTests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | } 16 | 17 | override func tearDownWithError() throws { 18 | // Put teardown code here. This method is called after the invocation of each test method in the class. 19 | } 20 | 21 | func testExample() throws { 22 | // This is an example of a functional test case. 23 | // Use XCTAssert and related functions to verify your tests produce the correct results. 24 | // Any test you write for XCTest can be annotated as throws and async. 25 | // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. 26 | // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. 27 | } 28 | 29 | func testPerformanceExample() throws { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ARMeasureUITests/ARMeasureUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARMeasureUITests.swift 3 | // ARMeasureUITests 4 | // 5 | // Created by 間嶋大輔 on 2022/02/04. 6 | // 7 | 8 | import XCTest 9 | 10 | class ARMeasureUITests: XCTestCase { 11 | 12 | override func setUpWithError() throws { 13 | // Put setup code here. This method is called before the invocation of each test method in the class. 14 | 15 | // In UI tests it is usually best to stop immediately when a failure occurs. 16 | continueAfterFailure = false 17 | 18 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 19 | } 20 | 21 | override func tearDownWithError() throws { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | func testExample() throws { 26 | // UI tests must launch the application that they test. 27 | let app = XCUIApplication() 28 | app.launch() 29 | 30 | // Use recording to get started writing UI tests. 31 | // Use XCTAssert and related functions to verify your tests produce the correct results. 32 | } 33 | 34 | func testLaunchPerformance() throws { 35 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { 36 | // This measures how long it takes to launch your application. 37 | measure(metrics: [XCTApplicationLaunchMetric()]) { 38 | XCUIApplication().launch() 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ARMeasureUITests/ARMeasureUITestsLaunchTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ARMeasureUITestsLaunchTests.swift 3 | // ARMeasureUITests 4 | // 5 | // Created by 間嶋大輔 on 2022/02/04. 6 | // 7 | 8 | import XCTest 9 | 10 | class ARMeasureUITestsLaunchTests: XCTestCase { 11 | 12 | override class var runsForEachTargetApplicationUIConfiguration: Bool { 13 | true 14 | } 15 | 16 | override func setUpWithError() throws { 17 | continueAfterFailure = false 18 | } 19 | 20 | func testLaunch() throws { 21 | let app = XCUIApplication() 22 | app.launch() 23 | 24 | // Insert steps here to perform after app launch but before taking a screenshot, 25 | // such as logging into a test account or navigating somewhere in the app 26 | 27 | let attachment = XCTAttachment(screenshot: app.screenshot()) 28 | attachment.name = "Launch Screen" 29 | attachment.lifetime = .keepAlways 30 | add(attachment) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ARMeasure 2 | 3 | A tape measure that can measure distance with a tap 4 | 5 | 6 | 7 | # How to use 8 | 9 | Clone this repo. 10 | 11 | 12 | Change team account of project with yours. 13 | 14 | Build. 15 | 16 | # Auther 17 | 18 | Daisuke Majima 19 | 20 | Freelance engineer. iOS/MachineLearning/AR 21 | I can work on mobile ML projects and AR project. 22 | Feel free to contact: rockyshikoku@gmail.com 23 | 24 | [GitHub](https://github.com/john-rocky) 25 | [Twitter](https://twitter.com/JackdeS11) 26 | [Medium](https://rockyshikoku.medium.com/) 27 | --------------------------------------------------------------------------------