Forums
Learn
Careers
Store
About
SUBSCRIBE
GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>
Question 1/12: This code is valid Swift – true or false?
Hint: Make sure that private properties aren't accessed from outside their struct. Click to show.
private
struct FacebookUser { private var privatePosts: [String] public var publicPosts: [String] } let user = FacebookUser()
Correct! This has a private property, so Swift is unable to generate its memberwise initializer for us.
Oops – that's not correct. This has a private property, so Swift is unable to generate its memberwise initializer for us.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.