Hi,
From Chapter 20 of intro to Appl Development with Swift: MemeMaker
This code works fine in playground, but in project's ViewController or separate file, the code seems to be ignored. If I try to type to get autocompletion typing out "topChoice", nothing happens.
No idea why? Anyone got a clue?
struct CaptionOption {
let emojiOption: String
let captionphrase: String
}
let imCool = CaptionOption(emojiOption: " ", captionphrase: "I'm cool with that")
let unlucky = CaptionOption(emojiOption: " ", captionphrase: "I'm so unlucky")
let dweeb = CaptionOption(emojiOption: " ", captionphrase: "You're a dork")
let run = CaptionOption(emojiOption: " ♂️", captionphrase: "run away!")
var topChoice = [CaptionOption]()
var bottomChoice = [CaptionOption]()
topChoice.append(imCool) // this will fail: 1) As I type it doesn't autocomplete, and 2) fails with error "expected declaration"