I am following a tutorial called "Starting Developing iOS Apps (Swift)" at this link. https://developer.apple.com/library/prerelease/ios/referencelibrary/GettingStarted/DevelopiOSAppsSwift/Lesson5.html#//apple_ref/doc/uid/TP40015214-CH19-SW1
I have followed the tutorial exactly, to the best of my knowledge, and am confused what the issue is with the last line of code in the following code block.
var ratingButtons = [UIButton]()
...
// MARK: Button Action
func ratingButtonTapped(button: UIButton){
//print("Button pressed ")
rating = ratingButtons.indexOf(button)! + 1
}
I am very new to iOS development and do not understand a few things here.
First, I get the error '[(UIButton)]' does not have a member named 'indexOf'. Is there significance to the brackets and parentheses surrounding UIButton? Also, to my understanding ratingButtons is an array so shouldn't indexOf work properly in this case?