Swift Code在if(Donestate == true)中说“预期声明”

时间:2018-04-17 23:39:05

标签: swift xcode

我正在使用Xcode和swift。我收到预期声明的消息。你能帮我弄清楚出了什么问题吗?

CODE:

class ViewController: UIViewController {
    let grayColor = UIColor.gray
    var Done1State:Bool = false
    @IBOutlet weak var Name1: UILabel!
    @IBOutlet weak var Name2: UILabel!
    @IBOutlet weak var Name3: UILabel!
    @IBOutlet weak var Name4: UILabel!
    @IBOutlet weak var Name5: UILabel!
    @IBOutlet weak var Name6: UILabel!
    @IBOutlet weak var Time1: UILabel!
    @IBOutlet weak var Time2: UILabel!
    @IBOutlet weak var Time3: UILabel!
    @IBOutlet weak var Time4: UILabel!
    @IBOutlet weak var Time5: UILabel!
    @IBOutlet weak var Time6: UILabel!
    @IBAction func Done1(_ sender: Any) {
        Done1State = true
    }
    if ( Done1State == true ) {
        Name1.backgroundColor = grayColor
        Time1.backgroundColor = grayColor
    }
    @IBAction func AddNewTask(_ sender: Any) {

    }
    @IBOutlet weak var AddNewTask: UIButton!
    override func viewDidLoad() {
        super.viewDidLoad()
        AddNewTask.layer.cornerRadius = 6
        AddNewTask.clipsToBounds = true
    }
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "mySegue"{
            Done1State = true
        }
    }
}

谢谢!

0 个答案:

没有答案