F#构造函数覆盖

时间:2017-12-30 11:09:11

标签: c# swift constructor f# uicollectionviewcell

我试图将以下Swift代码转换为F#:

class BaseCell: UICollectionViewCell {
override init(frame: CGRect) {
    super.init(frame: frame)
}

required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
}

}

我已经看到在C#中可以这样做:

 public class BaseCell : UICollectionViewCell
{

    [Export ("initWithFrame:")]
    public BaseCell (CGRect frame) : base (frame)
    {

    }

我在F#中获得了以下内容:

[<Register ("BaseCell")>]
type BaseCell (handle: IntPtr) as this = 
    inherit UICollectionViewCell (handle)

但是,我不确定如何继续构造函数覆盖。

0 个答案:

没有答案
相关问题