Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDavide Callegari
5,360 PointsNo teacher's notes
The video mentions teacher's notes at the beginning where we can copy/paste some code but nothing is there.
4 Answers
Will Matthews
8,127 PointsHere's the snippet:
view.addSubview(firstChoiceButton)
firstChoiceButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
firstChoiceButton.centerXAnchor.constraint(equalTo: view.centerXAnchor),
firstChoiceButton.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -80.0)
])
view.addSubview(secondChoiceButton)
secondChoiceButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
secondChoiceButton.centerXAnchor.constraint(equalTo: view.centerXAnchor),
secondChoiceButton.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -32)
])
Davide Callegari
5,360 PointsWell, thanks but it's wrong, that's the whole package of the project, not only the code snippet.
Steven Parker
231,184 PointsIt looks like you've found a "bug".
Since at time index 0:23 the video explicitly states "As always, look in the teacher's notes for a link...", the empty teacher's notes are clearly a bug. Report it to the staff following the instructions on the Support page. It might even get you the "special Exterminator badge".
kjvswift93
13,515 PointsThe link to copy and paste code, in this case, isn't contained in the teacher's notes, rather under the downloads section.
http://treehouse-code-samples.s3.amazonaws.com/iOS10-Swift/InteractiveStory/InteractiveStory-S3.zip