Xcode9学习笔记78

来源:互联网 发布:网络代运营 编辑:程序博客网 时间:2024/06/06 09:12
    override func viewDidLoad() {        super.viewDidLoad()        // Do any additional setup after loading the view, typically from a nib.                Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(ViewController.timerAction(_:)), userInfo: "Apple", repeats: true)    }        @objc func timerAction(_ timer:Timer) {        let parameter = timer.userInfo        print("I am eating \(parameter!).")    }

原创粉丝点击