Group Group Group Group Group Group Group Group Group

Programming in Swift · Methods | Ray Wenderlich


#1

This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5994-programming-in-swift/lessons/44

#2

When I walk through the code examples presented, Xcode is reporting the following error when I try to define the Weekday enum to conform to the CaseIterable protocol

enum Weekday: CaseIterable {
case monday, tuesday, wednesday, thursday, friday, saturday, sunday
}

*** Type ‘Weekday’ does not conform to protocol ‘RawRepresentable’ ***

When I open the PS_5-07_End.playground to see how it defines this, I see the same error (and a whole bunch more, probably stemming from the first).

Is this because I don’t have a compatible simulator installed on my version of Xcode?

I am running Xcode 9.4.1 (9F2000) with the iOS 11.3 simulator


#3

@synerjohnny This is a Swift 4.2 feature, so you need to download and install Xcode 10 in order to run the playground properly. Please let me know if you have any other questions or issues about the whole thing. Thank you!


#4

Thanks for your reply. :slight_smile:

FYI - For anyone looking to determine the version of Swift they are running, I found the following command to run in the terminal on StackOverflow:

$ swift -version

In my case, the result looked like this:

Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)

Target: x86_64-apple-darwin17.7.0

So yes, I was running the older version of Swift.


#5

Hey, i am on Structures part, is it okay that i don’t understand some of the concepts in structures? I do get how it works, but with some parts of them i really confused. You guys, explain really quick and do not explain how some processes work. My question, will be it okay if i continue to the next parts ?


#6

@didar490 Please let us know what you don’t understand exactly about the whole thing when you get a chance. Thank you!


#8

Can you recommend some additional tools to increase the understanding of code?
Right now I totally sure you need to have strong mathematics
and logic skills to create the code like what we see in this lesson.

I understood nothing in this lesson, but don’t want to give up.
Maybe you have additional course, which is more easy.


#9

@ollybess Please check out our Swift Apprentice book when you get a chance:

https://store.raywenderlich.com/products/swift-apprentice

I hope it helps!


#10

You might also want to try going through the Your First iOS App course. You actually build an app in that course, and it may help you to see code used in a more concrete context.

Best of luck!


#11

Yes, I finished “Your first iOS App” several months ago. It was much easier.

I’m gonna try the book. Thanks.