Reputation: 2713
I am trying to translate this code for my Xamarin.iOS app:
https://github.com/yourtion/YXWaveView/blob/master/YXWaveView/YXWaveView.swift
On line 179:
let path = CGMutablePath()
I can't find CGMutablePath
in Xamarin?
Upvotes: 4
Views: 490
Reputation: 74209
An ObjC CGMutablePathRef
struct (or Swift CGMutablePath class) is wrapped by Xamarin.iOS
as a CGPath
(CoreGraphics
namespace).
var path = new CGPath();
public class CGPath : INativeObject, IDisposable {
internal IntPtr handle;
[DllImport (Constants.CoreGraphicsLibrary)]
extern static /* CGMutablePathRef */ IntPtr CGPathCreateMutable ();
public CGPath ()
{
handle = CGPathCreateMutable ();
}
[Mac(10,7)][iOS (5,0)]
public CGPath (CGPath reference, CGAffineTransform transform)
{
if (reference == null)
throw new ArgumentNullException ("reference");
handle = CGPathCreateMutableCopyByTransformingPath (reference.Handle, ref transform);
}
[DllImport (Constants.CoreGraphicsLibrary)]
extern static /* CGMutablePathRef */ IntPtr CGPathCreateMutableCopy (/* CGPathRef */ IntPtr path);
public CGPath (CGPath basePath)
{
if (basePath == null)
throw new ArgumentNullException ("basePath");
handle = CGPathCreateMutableCopy (basePath.handle);
}
~~~~~
Upvotes: 4