Davidの回答のおかげで、完全な回答を提供できるようになりました。私が必要としていたのは3つのパーツでした。
- NSBezierPath を CGPath に変換します。これは、Apple のドキュメントに記載されている方法で行うことができます。または、iPhone フレームワーク機能を MacOS フレームワークに追加するhttps://github.com/iccir/XUIKitライブラリを使用することもできます。
- David の提案に従って、CGPathCreateCopyByStrokingPath 関数を使用します。
- 新しい CGPath を NSBezierPath に変換します。Ole Begemann のブロックへの David のリンクは、その方法を示すのに非常に役立ちました。しかし、XUIKit は再び一歩先を行き、
+(NSBezierPath) bezierPathWithCGPath:
機能を提供します。
結果はこんな感じ。
//con as Connector was the starting point
CGPathRef tapTargetPath = CGPathCreateCopyByStrokingPath(con.CGPath, NULL, 4, kCGLineCapButt, kCGLineJoinBevel, kCGLineJoinMiter );
NSBezierPath * hitPath = [NSBezierPath bezierPathWithCGPath:tapTargetPath];