Expected Declaration Error using Swift

前端 未结 1 1239
抹茶落季
抹茶落季 2020-11-22 12:21

I\'m trying to pass the boolean value of a UISwitch to another class using NSUserDefaults. For some reason, in the class that contains the switches

相关标签:
1条回答
  • 2020-11-22 13:13

    The problem is that you need to put your code inside a method. All you need is to move it to viewDidLoad() or any other method.

    0 讨论(0)
提交回复
热议问题