Call class method with argument from another class method

前端 未结 2 1230
耶瑟儿~
耶瑟儿~ 2021-01-23 11:21

In my code file MyItemVC.swift I have defined the following class and method:

class MyItemVC: UIViewController, UITextViewDelegate {

var timer          


        
2条回答
  •  庸人自扰
    2021-01-23 11:35

    The function you have specified is not a class function. Add class keyword before func keyword.

    The changed code:

    class func cycleTimer
    

    Note: In the previous versions of Swift you must use the following code (and also in C or other languages):

    static func cycleTimer
    

提交回复
热议问题