I need help saving a variable well... two variables. here is my viewcontroller file.I tried NSUser but people said that it's only supposed to be used for settings user data etc.Any help is nice :) Thanks
import UIKit
var wreath = 0
var box = 0
class ViewController: UIViewController {
@IBOutlet weak var YouHaveB: UILabel!
@IBOutlet weak var YouHaveW: UILabel!
@IBAction func Wreaths(sender: AnyObject) {
wreath += 1
YouHaveW.text = "You Have \(wreath) Wreaths"
}
@IBAction func Boxes(sender: AnyObject) {
box += 1
YouHaveB.text = "You Have \(box) Boxes"
}
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.
}
}