}
}
如果不加改动,MyClass.method 将取到的是类型方法,如果我们想要取实例方法的话,可以显式地加上类型声明加以区别。这种方式不仅在这里有效,在其他大多数名字有歧义的情况下,都能很好地解决问题:
复制代码
let f1 = MyClass.method
// class func method 的版本
let f2: Int -> Int = MyClass.method
// 和 f1 相同
let f3: MyClass -> Int -> Int = MyClass.method
// func method 的柯里化版本
注:相关教程知识阅读请移步到swift教程频道。








