func function(){} //func
self.function() //调用
Selector("function") //Seletor()
func function(one:Int){}
self.function(1)
Selector("function:")
func function(one:Int,two:Int){}
self.function(1, two: 2)
Selector("function:two:")
func function(one:Int,two:Int,three:Int){}
self.function(1, two: 2, three: 3)
Selector("function:two:three:")
func function(external one:Int){}
self.function(external: 1)
Selector("functionWithExternal:")
func function(external one:Int,two:Int){}
self.function(external: 1, two: 2)
Selector("functionWithExternal:two:")
func function(external one:Int,_ two:Int){}
self.function(external: 1, 2)
Selector("functionWithExternal::")
func function(one:Int,_ two:Int){}
self.function(1, 2)
Selector("function::")
----------
@objc private func privateMethod() { //使用函数定义定时器等时,private 方法前需加上 @objc
...
}
NSTimer.scheduledTimerWithTimeInterval(2.0, target: self, selector: Selector("privateMethod"), userInfo: nil, repeats: true)
Seletor()
最新推荐文章于 2020-03-03 15:17:37 发布