├── .gitignore ├── README.md ├── SimpleARExperience.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── t_aso.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── SimpleARExperience ├── AppDelegate.swift ├── Assets.xcassets ├── ARContentsImages │ ├── Contents.json │ ├── cupandsaucer.imageset │ │ ├── Contents.json │ │ └── cupandsaucer.jpg │ ├── gramophone.imageset │ │ ├── Contents.json │ │ └── gramophone.jpg │ ├── macPro.imageset │ │ ├── Contents.json │ │ └── macPro.png │ ├── plantpot.imageset │ │ ├── Contents.json │ │ └── plantpot.jpg │ ├── proDisplayXDR.imageset │ │ ├── Contents.json │ │ └── proDisplayXDR.png │ ├── redchair.imageset │ │ ├── Contents.json │ │ └── redchair.jpg │ ├── retrotv.imageset │ │ ├── Contents.json │ │ └── retrotv.jpg │ ├── stratocaster.imageset │ │ ├── Contents.json │ │ └── stratocaster.jpg │ ├── teapot.imageset │ │ ├── Contents.json │ │ └── teapot.jpg │ ├── trowel.imageset │ │ ├── Contents.json │ │ └── trowel.jpg │ ├── tulip.imageset │ │ ├── Contents.json │ │ └── tulip.jpg │ ├── wateringcan.imageset │ │ ├── Contents.json │ │ └── wateringcan.jpg │ └── wheelbarrow.imageset │ │ ├── Contents.json │ │ └── wheelbarrow.jpg ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── ContentsCollectionViewCell.swift ├── ContentsCollectionViewCell.xib ├── Info.plist ├── ViewController.swift └── usdz ├── cupandsaucer.usdz ├── gramophone.usdz ├── plantpot.usdz ├── redchair.usdz ├── retrotv.usdz ├── stratocaster.usdz ├── teapot.usdz ├── trowel.usdz ├── tulip.usdz ├── wateringcan.usdz └── wheelbarrow.usdz /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | SimpleARExperience.xcodeproj/project.xcworkspace/xcuserdata/ 3 | SimpleARExperience.xcodeproj/xcuserdata/ 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SimpleARExperience 2 | This App is the simple AR experience App by using AR Quick Look. 3 | 4 | ## Environment 5 | * iOS 12 and later 6 | * Xcode 10.2.1 and later 7 | * macOS 10.14.5 and later 8 | * Swift 5.0 9 | 10 | ## Update Log 11 | 12 | |Version|note| 13 | |:--|:--| 14 | |v1.0|-| 15 | |v1.1|Added new WebAR contents(Mac Pro and Pro Display XDR)
Swift 4.2 -> Swift 5.0| 16 | 17 | ## Commentary article 18 | This app made for my Qiita article's sample code. 19 | I am a Japanese iOS application developer. 20 | So this article is written in Japanese, sorry... 21 | 22 | https://qiita.com/MilanistaDev/items/27860b02d9b15e282e36 23 | 24 | ## USDZ files 25 | This app uses usdz files from Apple site. 26 | 27 | https://developer.apple.com/arkit/gallery/ 28 | 29 | ## Usage 30 | 1. Build 31 | 2. Select object image you want to check and tap cell. 32 | 3. You can check Object and AR mode. 33 | 34 | Tap cell you want to check. 35 | ![ar_04.PNG](https://qiita-image-store.s3.amazonaws.com/0/88266/3a89a033-aea7-d46c-d453-cca34eff0058.png) 36 | 37 | Object Mode 38 | 39 |
40 |
41 | AR mode 42 | 43 | 44 | 45 | Enjoy! 46 | 47 | ## Web AR Contents 48 | 49 | From v1.1, I added Web AR Contents(Mac Pro and Pro Display XDR). 50 | Orange border cell is applicable. 51 | 52 | 53 | -------------------------------------------------------------------------------- /SimpleARExperience.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 195DD9E72151270C00ADD9AF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195DD9E62151270C00ADD9AF /* AppDelegate.swift */; }; 11 | 195DD9E92151270C00ADD9AF /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195DD9E82151270C00ADD9AF /* ViewController.swift */; }; 12 | 195DD9EC2151270C00ADD9AF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 195DD9EA2151270C00ADD9AF /* Main.storyboard */; }; 13 | 195DD9EE2151270E00ADD9AF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 195DD9ED2151270E00ADD9AF /* Assets.xcassets */; }; 14 | 195DD9F12151270E00ADD9AF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 195DD9EF2151270E00ADD9AF /* LaunchScreen.storyboard */; }; 15 | 19687B0921527C8D0039E6BF /* ContentsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19687B0721527C8D0039E6BF /* ContentsCollectionViewCell.swift */; }; 16 | 19687B0A21527C8D0039E6BF /* ContentsCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 19687B0821527C8D0039E6BF /* ContentsCollectionViewCell.xib */; }; 17 | 19687B16215364CE0039E6BF /* wheelbarrow.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B0C215364CE0039E6BF /* wheelbarrow.usdz */; }; 18 | 19687B17215364CE0039E6BF /* wateringcan.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B0D215364CE0039E6BF /* wateringcan.usdz */; }; 19 | 19687B18215364CE0039E6BF /* trowel.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B0E215364CE0039E6BF /* trowel.usdz */; }; 20 | 19687B19215364CE0039E6BF /* teapot.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B0F215364CE0039E6BF /* teapot.usdz */; }; 21 | 19687B1A215364CE0039E6BF /* gramophone.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B10215364CE0039E6BF /* gramophone.usdz */; }; 22 | 19687B1B215364CE0039E6BF /* cupandsaucer.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B11215364CE0039E6BF /* cupandsaucer.usdz */; }; 23 | 19687B1C215364CE0039E6BF /* retrotv.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B12215364CE0039E6BF /* retrotv.usdz */; }; 24 | 19687B1D215364CE0039E6BF /* redchair.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B13215364CE0039E6BF /* redchair.usdz */; }; 25 | 19687B1E215364CE0039E6BF /* tulip.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B14215364CE0039E6BF /* tulip.usdz */; }; 26 | 19687B1F215364CE0039E6BF /* plantpot.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 19687B15215364CE0039E6BF /* plantpot.usdz */; }; 27 | FD79089C22D6E66E0018A064 /* stratocaster.usdz in Resources */ = {isa = PBXBuildFile; fileRef = FD79089B22D6E66E0018A064 /* stratocaster.usdz */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 195DD9E32151270C00ADD9AF /* SimpleARExperience.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleARExperience.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 195DD9E62151270C00ADD9AF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33 | 195DD9E82151270C00ADD9AF /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 34 | 195DD9EB2151270C00ADD9AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 35 | 195DD9ED2151270E00ADD9AF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 36 | 195DD9F02151270E00ADD9AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 37 | 195DD9F22151270E00ADD9AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 19687B0721527C8D0039E6BF /* ContentsCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentsCollectionViewCell.swift; sourceTree = ""; }; 39 | 19687B0821527C8D0039E6BF /* ContentsCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ContentsCollectionViewCell.xib; sourceTree = ""; }; 40 | 19687B0C215364CE0039E6BF /* wheelbarrow.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = wheelbarrow.usdz; sourceTree = ""; }; 41 | 19687B0D215364CE0039E6BF /* wateringcan.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = wateringcan.usdz; sourceTree = ""; }; 42 | 19687B0E215364CE0039E6BF /* trowel.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = trowel.usdz; sourceTree = ""; }; 43 | 19687B0F215364CE0039E6BF /* teapot.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = teapot.usdz; sourceTree = ""; }; 44 | 19687B10215364CE0039E6BF /* gramophone.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = gramophone.usdz; sourceTree = ""; }; 45 | 19687B11215364CE0039E6BF /* cupandsaucer.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = cupandsaucer.usdz; sourceTree = ""; }; 46 | 19687B12215364CE0039E6BF /* retrotv.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = retrotv.usdz; sourceTree = ""; }; 47 | 19687B13215364CE0039E6BF /* redchair.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = redchair.usdz; sourceTree = ""; }; 48 | 19687B14215364CE0039E6BF /* tulip.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = tulip.usdz; sourceTree = ""; }; 49 | 19687B15215364CE0039E6BF /* plantpot.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = plantpot.usdz; sourceTree = ""; }; 50 | FD79089B22D6E66E0018A064 /* stratocaster.usdz */ = {isa = PBXFileReference; lastKnownFileType = file; path = stratocaster.usdz; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 195DD9E02151270C00ADD9AF /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 195DD9DA2151270C00ADD9AF = { 65 | isa = PBXGroup; 66 | children = ( 67 | 195DD9E52151270C00ADD9AF /* SimpleARExperience */, 68 | 195DD9E42151270C00ADD9AF /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | 195DD9E42151270C00ADD9AF /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 195DD9E32151270C00ADD9AF /* SimpleARExperience.app */, 76 | ); 77 | name = Products; 78 | sourceTree = ""; 79 | }; 80 | 195DD9E52151270C00ADD9AF /* SimpleARExperience */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 195DD9E62151270C00ADD9AF /* AppDelegate.swift */, 84 | 195DD9E82151270C00ADD9AF /* ViewController.swift */, 85 | 195DD9EA2151270C00ADD9AF /* Main.storyboard */, 86 | 195DD9ED2151270E00ADD9AF /* Assets.xcassets */, 87 | 19687B0B215364CE0039E6BF /* usdz */, 88 | 195DD9EF2151270E00ADD9AF /* LaunchScreen.storyboard */, 89 | 195DD9F22151270E00ADD9AF /* Info.plist */, 90 | 19687B0721527C8D0039E6BF /* ContentsCollectionViewCell.swift */, 91 | 19687B0821527C8D0039E6BF /* ContentsCollectionViewCell.xib */, 92 | ); 93 | path = SimpleARExperience; 94 | sourceTree = ""; 95 | }; 96 | 19687B0B215364CE0039E6BF /* usdz */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 19687B0C215364CE0039E6BF /* wheelbarrow.usdz */, 100 | 19687B0D215364CE0039E6BF /* wateringcan.usdz */, 101 | 19687B0E215364CE0039E6BF /* trowel.usdz */, 102 | 19687B0F215364CE0039E6BF /* teapot.usdz */, 103 | 19687B10215364CE0039E6BF /* gramophone.usdz */, 104 | 19687B11215364CE0039E6BF /* cupandsaucer.usdz */, 105 | 19687B12215364CE0039E6BF /* retrotv.usdz */, 106 | 19687B13215364CE0039E6BF /* redchair.usdz */, 107 | 19687B14215364CE0039E6BF /* tulip.usdz */, 108 | 19687B15215364CE0039E6BF /* plantpot.usdz */, 109 | FD79089B22D6E66E0018A064 /* stratocaster.usdz */, 110 | ); 111 | path = usdz; 112 | sourceTree = ""; 113 | }; 114 | /* End PBXGroup section */ 115 | 116 | /* Begin PBXNativeTarget section */ 117 | 195DD9E22151270C00ADD9AF /* SimpleARExperience */ = { 118 | isa = PBXNativeTarget; 119 | buildConfigurationList = 195DD9F52151270E00ADD9AF /* Build configuration list for PBXNativeTarget "SimpleARExperience" */; 120 | buildPhases = ( 121 | 195DD9DF2151270C00ADD9AF /* Sources */, 122 | 195DD9E02151270C00ADD9AF /* Frameworks */, 123 | 195DD9E12151270C00ADD9AF /* Resources */, 124 | ); 125 | buildRules = ( 126 | ); 127 | dependencies = ( 128 | ); 129 | name = SimpleARExperience; 130 | productName = SimpleARExperience; 131 | productReference = 195DD9E32151270C00ADD9AF /* SimpleARExperience.app */; 132 | productType = "com.apple.product-type.application"; 133 | }; 134 | /* End PBXNativeTarget section */ 135 | 136 | /* Begin PBXProject section */ 137 | 195DD9DB2151270C00ADD9AF /* Project object */ = { 138 | isa = PBXProject; 139 | attributes = { 140 | LastSwiftUpdateCheck = 1000; 141 | LastUpgradeCheck = 1000; 142 | ORGANIZATIONNAME = com.ASTK; 143 | TargetAttributes = { 144 | 195DD9E22151270C00ADD9AF = { 145 | CreatedOnToolsVersion = 10.0; 146 | }; 147 | }; 148 | }; 149 | buildConfigurationList = 195DD9DE2151270C00ADD9AF /* Build configuration list for PBXProject "SimpleARExperience" */; 150 | compatibilityVersion = "Xcode 9.3"; 151 | developmentRegion = en; 152 | hasScannedForEncodings = 0; 153 | knownRegions = ( 154 | en, 155 | Base, 156 | ); 157 | mainGroup = 195DD9DA2151270C00ADD9AF; 158 | productRefGroup = 195DD9E42151270C00ADD9AF /* Products */; 159 | projectDirPath = ""; 160 | projectRoot = ""; 161 | targets = ( 162 | 195DD9E22151270C00ADD9AF /* SimpleARExperience */, 163 | ); 164 | }; 165 | /* End PBXProject section */ 166 | 167 | /* Begin PBXResourcesBuildPhase section */ 168 | 195DD9E12151270C00ADD9AF /* Resources */ = { 169 | isa = PBXResourcesBuildPhase; 170 | buildActionMask = 2147483647; 171 | files = ( 172 | 19687B0A21527C8D0039E6BF /* ContentsCollectionViewCell.xib in Resources */, 173 | 19687B1A215364CE0039E6BF /* gramophone.usdz in Resources */, 174 | FD79089C22D6E66E0018A064 /* stratocaster.usdz in Resources */, 175 | 195DD9F12151270E00ADD9AF /* LaunchScreen.storyboard in Resources */, 176 | 19687B16215364CE0039E6BF /* wheelbarrow.usdz in Resources */, 177 | 19687B17215364CE0039E6BF /* wateringcan.usdz in Resources */, 178 | 19687B1F215364CE0039E6BF /* plantpot.usdz in Resources */, 179 | 19687B19215364CE0039E6BF /* teapot.usdz in Resources */, 180 | 19687B18215364CE0039E6BF /* trowel.usdz in Resources */, 181 | 19687B1D215364CE0039E6BF /* redchair.usdz in Resources */, 182 | 19687B1E215364CE0039E6BF /* tulip.usdz in Resources */, 183 | 19687B1B215364CE0039E6BF /* cupandsaucer.usdz in Resources */, 184 | 195DD9EE2151270E00ADD9AF /* Assets.xcassets in Resources */, 185 | 19687B1C215364CE0039E6BF /* retrotv.usdz in Resources */, 186 | 195DD9EC2151270C00ADD9AF /* Main.storyboard in Resources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXResourcesBuildPhase section */ 191 | 192 | /* Begin PBXSourcesBuildPhase section */ 193 | 195DD9DF2151270C00ADD9AF /* Sources */ = { 194 | isa = PBXSourcesBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | 195DD9E92151270C00ADD9AF /* ViewController.swift in Sources */, 198 | 19687B0921527C8D0039E6BF /* ContentsCollectionViewCell.swift in Sources */, 199 | 195DD9E72151270C00ADD9AF /* AppDelegate.swift in Sources */, 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | /* End PBXSourcesBuildPhase section */ 204 | 205 | /* Begin PBXVariantGroup section */ 206 | 195DD9EA2151270C00ADD9AF /* Main.storyboard */ = { 207 | isa = PBXVariantGroup; 208 | children = ( 209 | 195DD9EB2151270C00ADD9AF /* Base */, 210 | ); 211 | name = Main.storyboard; 212 | sourceTree = ""; 213 | }; 214 | 195DD9EF2151270E00ADD9AF /* LaunchScreen.storyboard */ = { 215 | isa = PBXVariantGroup; 216 | children = ( 217 | 195DD9F02151270E00ADD9AF /* Base */, 218 | ); 219 | name = LaunchScreen.storyboard; 220 | sourceTree = ""; 221 | }; 222 | /* End PBXVariantGroup section */ 223 | 224 | /* Begin XCBuildConfiguration section */ 225 | 195DD9F32151270E00ADD9AF /* Debug */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | CLANG_ANALYZER_NONNULL = YES; 230 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 231 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 232 | CLANG_CXX_LIBRARY = "libc++"; 233 | CLANG_ENABLE_MODULES = YES; 234 | CLANG_ENABLE_OBJC_ARC = YES; 235 | CLANG_ENABLE_OBJC_WEAK = YES; 236 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 237 | CLANG_WARN_BOOL_CONVERSION = YES; 238 | CLANG_WARN_COMMA = YES; 239 | CLANG_WARN_CONSTANT_CONVERSION = YES; 240 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 241 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 242 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 243 | CLANG_WARN_EMPTY_BODY = YES; 244 | CLANG_WARN_ENUM_CONVERSION = YES; 245 | CLANG_WARN_INFINITE_RECURSION = YES; 246 | CLANG_WARN_INT_CONVERSION = YES; 247 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 248 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 249 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 250 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 251 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 252 | CLANG_WARN_STRICT_PROTOTYPES = YES; 253 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 254 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 255 | CLANG_WARN_UNREACHABLE_CODE = YES; 256 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 257 | CODE_SIGN_IDENTITY = "iPhone Developer"; 258 | COPY_PHASE_STRIP = NO; 259 | DEBUG_INFORMATION_FORMAT = dwarf; 260 | ENABLE_STRICT_OBJC_MSGSEND = YES; 261 | ENABLE_TESTABILITY = YES; 262 | GCC_C_LANGUAGE_STANDARD = gnu11; 263 | GCC_DYNAMIC_NO_PIC = NO; 264 | GCC_NO_COMMON_BLOCKS = YES; 265 | GCC_OPTIMIZATION_LEVEL = 0; 266 | GCC_PREPROCESSOR_DEFINITIONS = ( 267 | "DEBUG=1", 268 | "$(inherited)", 269 | ); 270 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 271 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 272 | GCC_WARN_UNDECLARED_SELECTOR = YES; 273 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 274 | GCC_WARN_UNUSED_FUNCTION = YES; 275 | GCC_WARN_UNUSED_VARIABLE = YES; 276 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 277 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 278 | MTL_FAST_MATH = YES; 279 | ONLY_ACTIVE_ARCH = YES; 280 | SDKROOT = iphoneos; 281 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 282 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 283 | }; 284 | name = Debug; 285 | }; 286 | 195DD9F42151270E00ADD9AF /* Release */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ALWAYS_SEARCH_USER_PATHS = NO; 290 | CLANG_ANALYZER_NONNULL = YES; 291 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 293 | CLANG_CXX_LIBRARY = "libc++"; 294 | CLANG_ENABLE_MODULES = YES; 295 | CLANG_ENABLE_OBJC_ARC = YES; 296 | CLANG_ENABLE_OBJC_WEAK = YES; 297 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 298 | CLANG_WARN_BOOL_CONVERSION = YES; 299 | CLANG_WARN_COMMA = YES; 300 | CLANG_WARN_CONSTANT_CONVERSION = YES; 301 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 302 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 303 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 304 | CLANG_WARN_EMPTY_BODY = YES; 305 | CLANG_WARN_ENUM_CONVERSION = YES; 306 | CLANG_WARN_INFINITE_RECURSION = YES; 307 | CLANG_WARN_INT_CONVERSION = YES; 308 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 309 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 310 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 311 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 312 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 313 | CLANG_WARN_STRICT_PROTOTYPES = YES; 314 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 315 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 316 | CLANG_WARN_UNREACHABLE_CODE = YES; 317 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 318 | CODE_SIGN_IDENTITY = "iPhone Developer"; 319 | COPY_PHASE_STRIP = NO; 320 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 321 | ENABLE_NS_ASSERTIONS = NO; 322 | ENABLE_STRICT_OBJC_MSGSEND = YES; 323 | GCC_C_LANGUAGE_STANDARD = gnu11; 324 | GCC_NO_COMMON_BLOCKS = YES; 325 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 326 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 327 | GCC_WARN_UNDECLARED_SELECTOR = YES; 328 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 329 | GCC_WARN_UNUSED_FUNCTION = YES; 330 | GCC_WARN_UNUSED_VARIABLE = YES; 331 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 332 | MTL_ENABLE_DEBUG_INFO = NO; 333 | MTL_FAST_MATH = YES; 334 | SDKROOT = iphoneos; 335 | SWIFT_COMPILATION_MODE = wholemodule; 336 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 337 | VALIDATE_PRODUCT = YES; 338 | }; 339 | name = Release; 340 | }; 341 | 195DD9F62151270E00ADD9AF /* Debug */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 345 | CODE_SIGN_STYLE = Automatic; 346 | DEVELOPMENT_TEAM = 7M7ZGYSAKB; 347 | INFOPLIST_FILE = SimpleARExperience/Info.plist; 348 | LD_RUNPATH_SEARCH_PATHS = ( 349 | "$(inherited)", 350 | "@executable_path/Frameworks", 351 | ); 352 | PRODUCT_BUNDLE_IDENTIFIER = com.ASTK.SimpleARExperience; 353 | PRODUCT_NAME = "$(TARGET_NAME)"; 354 | SWIFT_VERSION = 5.0; 355 | TARGETED_DEVICE_FAMILY = "1,2"; 356 | }; 357 | name = Debug; 358 | }; 359 | 195DD9F72151270E00ADD9AF /* Release */ = { 360 | isa = XCBuildConfiguration; 361 | buildSettings = { 362 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 363 | CODE_SIGN_STYLE = Automatic; 364 | DEVELOPMENT_TEAM = 7M7ZGYSAKB; 365 | INFOPLIST_FILE = SimpleARExperience/Info.plist; 366 | LD_RUNPATH_SEARCH_PATHS = ( 367 | "$(inherited)", 368 | "@executable_path/Frameworks", 369 | ); 370 | PRODUCT_BUNDLE_IDENTIFIER = com.ASTK.SimpleARExperience; 371 | PRODUCT_NAME = "$(TARGET_NAME)"; 372 | SWIFT_VERSION = 5.0; 373 | TARGETED_DEVICE_FAMILY = "1,2"; 374 | }; 375 | name = Release; 376 | }; 377 | /* End XCBuildConfiguration section */ 378 | 379 | /* Begin XCConfigurationList section */ 380 | 195DD9DE2151270C00ADD9AF /* Build configuration list for PBXProject "SimpleARExperience" */ = { 381 | isa = XCConfigurationList; 382 | buildConfigurations = ( 383 | 195DD9F32151270E00ADD9AF /* Debug */, 384 | 195DD9F42151270E00ADD9AF /* Release */, 385 | ); 386 | defaultConfigurationIsVisible = 0; 387 | defaultConfigurationName = Release; 388 | }; 389 | 195DD9F52151270E00ADD9AF /* Build configuration list for PBXNativeTarget "SimpleARExperience" */ = { 390 | isa = XCConfigurationList; 391 | buildConfigurations = ( 392 | 195DD9F62151270E00ADD9AF /* Debug */, 393 | 195DD9F72151270E00ADD9AF /* Release */, 394 | ); 395 | defaultConfigurationIsVisible = 0; 396 | defaultConfigurationName = Release; 397 | }; 398 | /* End XCConfigurationList section */ 399 | }; 400 | rootObject = 195DD9DB2151270C00ADD9AF /* Project object */; 401 | } 402 | -------------------------------------------------------------------------------- /SimpleARExperience.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SimpleARExperience.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SimpleARExperience.xcodeproj/xcuserdata/t_aso.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SimpleARExperience.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SimpleARExperience/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SimpleARExperience 4 | // 5 | // Created by 麻生 拓弥 on 2018/09/18. 6 | // Copyright © 2018年 com.ASTK. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/cupandsaucer.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "cupandsaucer.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/cupandsaucer.imageset/cupandsaucer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/cupandsaucer.imageset/cupandsaucer.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/gramophone.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "gramophone.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/gramophone.imageset/gramophone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/gramophone.imageset/gramophone.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/macPro.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "macPro.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/macPro.imageset/macPro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/macPro.imageset/macPro.png -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/plantpot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "plantpot.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/plantpot.imageset/plantpot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/plantpot.imageset/plantpot.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/proDisplayXDR.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "proDisplayXDR.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/proDisplayXDR.imageset/proDisplayXDR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/proDisplayXDR.imageset/proDisplayXDR.png -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/redchair.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "redchair.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/redchair.imageset/redchair.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/redchair.imageset/redchair.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/retrotv.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "retrotv.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/retrotv.imageset/retrotv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/retrotv.imageset/retrotv.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/stratocaster.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "stratocaster.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/stratocaster.imageset/stratocaster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/stratocaster.imageset/stratocaster.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/teapot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "teapot.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/teapot.imageset/teapot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/teapot.imageset/teapot.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/trowel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "trowel.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/trowel.imageset/trowel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/trowel.imageset/trowel.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/tulip.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "tulip.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/tulip.imageset/tulip.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/tulip.imageset/tulip.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/wateringcan.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "wateringcan.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/wateringcan.imageset/wateringcan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/wateringcan.imageset/wateringcan.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/wheelbarrow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "wheelbarrow.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/ARContentsImages/wheelbarrow.imageset/wheelbarrow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/Assets.xcassets/ARContentsImages/wheelbarrow.imageset/wheelbarrow.jpg -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /SimpleARExperience/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SimpleARExperience/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /SimpleARExperience/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /SimpleARExperience/ContentsCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentsCollectionViewCell.swift 3 | // SimpleARExperience 4 | // 5 | // Created by 麻生 拓弥 on 2018/09/19. 6 | // Copyright © 2018年 com.ASTK. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ContentsCollectionViewCell: UICollectionViewCell { 12 | 13 | @IBOutlet weak var baseView: UIView! 14 | @IBOutlet weak var contentsImageView: UIImageView! 15 | 16 | override func awakeFromNib() { 17 | super.awakeFromNib() 18 | self.layer.cornerRadius = 5.0 19 | self.layer.masksToBounds = true 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SimpleARExperience/ContentsCollectionViewCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /SimpleARExperience/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | NSCameraUsageDescription 45 | This App uses camera for AR contents. 46 | 47 | 48 | -------------------------------------------------------------------------------- /SimpleARExperience/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SimpleARExperience 4 | // 5 | // Created by 麻生 拓弥 on 2018/09/18. 6 | // Copyright © 2018年 com.ASTK. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import QuickLook 11 | import SafariServices 12 | 13 | final class ViewController: UIViewController { 14 | 15 | @IBOutlet weak var contentsCollectionView: UICollectionView! 16 | 17 | private enum ContentType: Int, CaseIterable { 18 | case web 19 | case usdz 20 | } 21 | 22 | // Web Contents Tuple(Mac Pro & Pro Display XDR) 23 | private let webContentsArray: [(name: String, url: String)] = 24 | [("macPro", "https://www.apple.com/jp/mac-pro/"), 25 | ("proDisplayXDR", "https://www.apple.com/jp/pro-display-xdr/")] 26 | 27 | // USDZファイル名のArray 28 | private let contentsArray: [String] = ["cupandsaucer", "stratocaster", "gramophone", 29 | "plantpot", "redchair", "retrotv", "teapot", 30 | "trowel", "tulip", "wateringcan", "wheelbarrow"] 31 | // セルを押した際のCollectionViewのindex値 32 | private var selectedItemIndex: Int = -1 33 | 34 | override func viewDidLoad() { 35 | super.viewDidLoad() 36 | self.setUpUI() 37 | } 38 | 39 | private func setUpUI() { 40 | self.navigationItem.title = "Simple AR Experience" 41 | self.contentsCollectionView.delegate = self 42 | self.contentsCollectionView.dataSource = self 43 | let cellNib = UINib(nibName: "ContentsCollectionViewCell", bundle: nil) 44 | self.contentsCollectionView.register(cellNib, forCellWithReuseIdentifier: "ContentsCell") 45 | } 46 | 47 | private func previewARContents() { 48 | let previewController = QLPreviewController() 49 | previewController.dataSource = self 50 | self.present(previewController, animated: true, completion: nil) 51 | } 52 | } 53 | 54 | // MARK: - UICollectionViewDelegate 55 | 56 | extension ViewController: UICollectionViewDelegate { 57 | 58 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 59 | switch indexPath.section { 60 | case ContentType.web.rawValue: 61 | let url = URL(string: self.webContentsArray[indexPath.row].url) 62 | let safariVC = SFSafariViewController(url: url!) 63 | self.present(safariVC, animated: true, completion: nil) 64 | default: 65 | // CollectionViewのセルをタップしたindex値を保持しておく 66 | self.selectedItemIndex = indexPath.row 67 | // QLPreviewControllerを開く 68 | self.previewARContents() 69 | } 70 | } 71 | } 72 | 73 | // MARK: - UICollectionViewDataSource 74 | 75 | extension ViewController: UICollectionViewDataSource { 76 | 77 | func numberOfSections(in collectionView: UICollectionView) -> Int { 78 | return ContentType.allCases.count 79 | } 80 | 81 | 82 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 83 | switch section { 84 | case ContentType.web.rawValue: 85 | return self.webContentsArray.count 86 | default: 87 | return self.contentsArray.count 88 | } 89 | } 90 | 91 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 92 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ContentsCell", for: indexPath) as! ContentsCollectionViewCell 93 | switch indexPath.section { 94 | case ContentType.web.rawValue: 95 | cell.baseView.backgroundColor = UIColor(red: 243/255, green: 151/255, blue: 0, alpha: 1.0) 96 | cell.contentsImageView.image = UIImage(named: self.webContentsArray[indexPath.row].name) 97 | default: 98 | cell.contentsImageView.image = UIImage(named: self.contentsArray[indexPath.row]) 99 | } 100 | return cell 101 | } 102 | } 103 | 104 | // MARK: - UICollectionViewDelegateFlowLayout 105 | 106 | extension ViewController: UICollectionViewDelegateFlowLayout { 107 | 108 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 109 | let width: CGFloat = UIScreen.main.bounds.width / 2 - 7.5 110 | let height = width 111 | return CGSize(width: width, height: height) 112 | } 113 | } 114 | 115 | // MARK:- QLPreviewController DataSource 116 | 117 | extension ViewController: QLPreviewControllerDataSource { 118 | 119 | /// Quick Look で表示するアイテム数 120 | /// 121 | /// - Parameter controller: controller 122 | /// - Returns: Quick Look で表示するアイテム数 123 | func numberOfPreviewItems(in controller: QLPreviewController) -> Int { 124 | return 1 125 | } 126 | 127 | /// Quick Look で表示するアイテムを返す 128 | /// 129 | /// - Parameters: 130 | /// - controller: controller 131 | /// - index: アイテムのindex値 132 | /// - Returns: Quick Look で表示するアイテム 133 | func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { 134 | // Return the file URL to the .usdz file 135 | let fileUrl = (self.selectedItemIndex < 0) ? 136 | Bundle.main.url(forResource: "cupandsaucer", withExtension: "usdz")! : 137 | Bundle.main.url(forResource: self.contentsArray[self.selectedItemIndex], withExtension: "usdz")! 138 | return fileUrl as QLPreviewItem 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /SimpleARExperience/usdz/cupandsaucer.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/cupandsaucer.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/gramophone.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/gramophone.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/plantpot.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/plantpot.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/redchair.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/redchair.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/retrotv.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/retrotv.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/stratocaster.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/stratocaster.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/teapot.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/teapot.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/trowel.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/trowel.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/tulip.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/tulip.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/wateringcan.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/wateringcan.usdz -------------------------------------------------------------------------------- /SimpleARExperience/usdz/wheelbarrow.usdz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MilanistaDev/SimpleARExperience/71c5d35dc482b346809a5cb00375e330c8a9fbee/SimpleARExperience/usdz/wheelbarrow.usdz --------------------------------------------------------------------------------