Error on page 70 of book?

Hi,

On page 70 the author tries to explain the OOPs concepts by writing code

Text("Welcome to my first app!") .fontWeight(.black) .color(.green)

But this code is giving error - Value of type ‘Text’ has no member ‘color’

Kindly guide what to do , and this is only the very basic start chapter, i hope later chapters are more kind to beginners like me …

Thanks

@amitsrivastava Thanks very much for your question!

This may sound really stupid, but have you tried writing the code using the indentation that the author uses, and without any spaces? I’m just wondering.

Hi @syedfa thanks , i have been studying from a different book, big nerd ranch one(it uses swift 3 though), i have not tried the apprentice book since i got stuck there …

I would personally go back to the Apprentice, and see if you can continue. The book is using the latest version of Swift, as well as iOS so it is only for your benefit to ensure you’re using the latest technology stack :slight_smile:

Please don’t give up this quickly!

1 Like

@syedfa - thanks, i did not give up , just changed the resource, i will go back to it after i finish the other book as apprentice has swiftui which is what i want to learn as well …

This topic was automatically closed after 166 days. New replies are no longer allowed.