I was just filling the submission for the swift student challenge and there is a note below adding the zip file saying
Note: Xcode app playgrounds are run in Simulator.
Now my xcode app playground(.swiftpm) is an AR app and needs an ipad or an iphone to run . So will my submission still be eligible for assessment and checked on ipad???
Post
Replies
Boosts
Views
Activity
I want to compare the colors of two model entities (spheres). How can i do it? The method i'm currently trying to apply is as follows
case let .color(controlColor) = controlMaterial.baseColor, controlColor == .green {
// Flip target sphere colour
if let targetMaterial = targetsphere.model?.materials.first as? SimpleMaterial,
case let .color(targetColor) = targetMaterial.baseColor, targetColor == .blue {
targetsphere.model?.materials = [SimpleMaterial(color: .green, isMetallic: false)] // Change to |1⟩
} else {
targetsphere.model?.materials = [SimpleMaterial(color: .blue, isMetallic: false)] // Change to |0⟩
}
}
This method (baseColor) was deprecated in swift 15.0 changes to 'color' but i cannot compare the value color to each other.👾
I’m working in the app playground and want to add my usdz file but when i drag drop the file to my main folder i cannot add target to it which leads to a resource not found error while I build my app. It was working on a normal xcode project but while transitioning to app playground it is not working. How can I fix this issue?
I'm developing an ar app using reality kit and Arkit and i want to have my buttons in the same theme of vision os buttons thin , transparent background and round at corners.Following is the code i have written and need help with it
func createButton(label: String, position: SIMD3<Float>) -> ModelEntity {
let button = ModelEntity(mesh: .generateBox(size: [0.3, 0.1, 0.02], cornerRadius: 10), materials: [SimpleMaterial(color: .blue, isMetallic: false)])
button.generateCollisionShapes(recursive: true)
button.position = position
// Add button label
let buttonText = ModelEntity(mesh: .generateText(label, extrusionDepth: 0.005, font: .systemFont(ofSize: 0.05)))
buttonText.model?.materials = [SimpleMaterial(color: .white, isMetallic: true)]
buttonText.position = [-0.07, -0.02, 0.01]
button.addChild(buttonText)
return button
}