我正在制作一个基本应用程序,可以通过打开和关闭开关来告诉我一天中某个班级是否有作业。现在遇到的问题是重置按钮无法将所有开关变为关闭状态。如何在Swift中使用按钮更改开关状态?以下是我目前的代码:
//
// ViewController.swift
// HomeworkManager
//
// Created by Nate Parker on 9/2/14.
// Copyright (c) 2014 Nathan Parker. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func resetClicked(sender: AnyObject) {
}
@IBOutlet var spanish: UISwitch
@IBOutlet var algebra: UISwitch
@IBOutlet var amerCult: UISwitch
@IBOutlet var bio: UISwitch
@IBOutlet var col: UISwitch
}