UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Day 9: Referring to the current instance, Test Q.2 Potential Error

Forums > 100 Days of SwiftUI

First time posting. I think I have found a potential error in Q.2 of the Referring to the current instance test, I say potential because I am fairly new at coding and could be looking at it wrong. Anyway, the answer to [Q.2] (https://www.hackingwithswift.com/review/referring-to-the-current-instance) is true, but I believe it should be false because the second parameter of the initializer is superPowers not powers so .self is not needed when referring to the property powers. Other questions in the test do this same thing and thier answer is false. If I am wrong please explain to me how, I've taken the test 3 times now because of that one question, trying to figure out what I am missing. Thank you.

2      

self is not needed there, but it isn't an error to include it. The code is valid Swift.

2      

I understand now. I retook the test and read the answers for the other questions that I had mentioned and realized that I hadn't read them carefully enough. Thank you for the help.

2      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.