私はObjective-Cの初心者です。そこで、C# + Monotouch を使用してアプリを作成します。ここで、ObjC で記述されたサードパーティ ライブラリ TTTAttributedLabel を使用する必要があります。そのコードを C# にバインドする必要があります。興味深い構造がいくつかあります。
@protocol TTTAttributedLabel <NSObject>
@property (nonatomic, copy) id text;
@end
@interface TTTAttributedLabel : UILabel <TTTAttributedLabel, UIGestureRecognizerDelegate>
/* some code here */
@end
TTTAttributedLabel と UILabel の継承については明らかです。私はこのようにしました:
[BaseType (typeof (NSObject))]
interface TTTAttributedLabel{
// code here
}
[BaseType (typeof (UILabel))]
interface UITextField : TTTAttributedLabel{
}
しかし、 UIGestureRecognizerDelegateを継承する方法がわかりません。Objective -C ではプロトコルですが、Monotouch ではクラスであるためです。そのため、クラスからインターフェイスを継承できません。
これを行う正しい方法は何ですか?