Hello All,
I am currently working through ”Keep going with Apps” in Swift Playground. The section in the tutorial “Add a DancingCreature view” will not complete. I have tried to type it is as written in the tutorial and even used the copy and paste button provided. I have restarted the app and my IPad with no success. I have attached a screen shot of the tutorial prompt. Here is the code block:
import SwiftUI
import Guide
struct DancingCreatures: View {
//#-learning-code-snippet(varDeclaration)
@EnvironmentObject var data : CreatureZoo
var body: some View {
SPCAssessableGroup(view: self) {
VStack {
ZStack {
/*#-code-walkthrough(dance.forEach)*/
ForEach(data.creatures) { creature in
/*#-code-walkthrough(dance.forEach)*/
/*#-code-walkthrough(dance.textView)*/
Text(creature.emoji)
.resizableFont()
.offset(creature.offset)
.rotationEffect(creature.rotation)
/*#-code-walkthrough(dance.textView)*/
}
}
ZStack {
/*#-code-walkthrough(dance.forEach)*/
ForEach(data.creatures) { creature in
/*#-code-walkthrough(dance.forEach)*/
/*#-code-walkthrough(dance.textView)*/
Text(creature.emoji)
.resizableFont()
.offset(creature.offset)
.rotationEffect(creature.rotation)
/*#-code-walkthrough(dance.textView)*/
//#-learning-code-snippet(exp1)
//#-learning-code-snippet(animationSolution)
//#-learning-code-snippet(exp3)
}
}
/*#-code-walkthrough(dance.onTap)*/
.onTapGesture {
data.randomizeOffsets()
}
/*#-code-walkthrough(dance.onTap)*/
/*#-code-walkthrough(dance.onTap)*/
.onTapGesture {
data.randomizeOffsets()
}
/*#-code-walkthrough(dance.onTap)*/
}
}
}
}
struct DancingCreatures_Previews: PreviewProvider {
static var previews: some View {
DancingCreatures().environmentObject(CreatureZoo())
}
}
Device information: IPad Pro (11 inch, 2nd gen) iPad OS Version: 26.0.1 Playground Version: 4.6.4
Anyone else come across this?
Thank you in advance.