【发布时间】:2018-06-08 23:39:59
【问题描述】:
我在 Swift 中有以下类定义:
class LandlordHome : UIViewController, UICollectionViewDelegate, UICollectionViewDataSource {
}
我正在尝试在 F# 中创建它,但是 F# 中的继承模式只允许我像这样继承一个类:
[<Register ("LandlordHome")>]
type LandlordHome (handle:IntPtr) =
inherit UIViewController (handle)
如果我尝试像这样添加其他类:
[<Register ("LandlordHome")>]
type LandlordHome (handle:IntPtr) =
inherit UIViewController, UICollectionViewDelegate, UICollectionViewDataSource (handle)
这会引发错误。
【问题讨论】:
-
我没有使用 F# 的经验。但请注意,LandlordHome 继承自 single 类 UIViewController,并符合其他协议。
标签: swift inheritance f# uicollectionview superclass