Problems in Intro to app dev - Actions and Outlets

Hi,

I followed all the instructions listed in the ebook Apple Intro to app development with Swift but still these errors keep popping out. Can someone help me please?

Here is the link to image that shows the bugs

gKE8U3S.png

Replies

Apparently, there is an invalid character somewhere in your code. I don't see it, but maybe if you post your code we can check it (use the <> button in the forum editor).


Also, if you are still new to app development, you should probably use the current non-beta version of Xcode instead.

To find the invalid character, you can copy the whole text and paste it in another editor that shows special characters.

Here's the code I took from the ebook

“func updateColor() {


var red: CGFloat = 0


var green: CGFloat = 0


var blue: CGFloat = 0


if redSwitch.isOn {


red = 1


}


if greenSwitch.isOn

{


green = 1


}


if blueSwitch.isOn

{


blue = 1


}
 


let color = UIColor(red: red, green: green, blue: blue, alpha: 1)
 colorView.backgroundColor = color
}”



Excerpt From: Apple Education. “Intro to App Development with Swift.” Apple Inc. - Education, 2017. iBooks. https://itunes.apple.com/vn/book/intro-to-app-development-with-swift/id1118575552?mt=11