有人知道是否有一种方法可以将参数分为两种类型吗?
如为功能:
func email(from viewcontroller : (UIViewController, MFMailComposeViewControllerDelegate) {
}
泛化函数的定义:
func email<T>(from viewController : T) where T: UIViewController, T: MFMailComposeViewControllerDelegate {
// ...
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句